반응형 분류 전체보기199 BOJ 12851 - 숨바꼭질 2 https://www.acmicpc.net/problem/12851 12851번: 숨바꼭질 2 수빈이는 동생과 숨바꼭질을 하고 있다. 수빈이는 현재 점 N(0 ≤ N ≤ 100,000)에 있고, 동생은 점 K(0 ≤ K ≤ 100,000)에 있다. 수빈이는 걷거나 순간이동을 할 수 있다. 만약, 수빈이의 위치가 X일 때 www.acmicpc.net 문제 설명 숨바꼭질 2 문제 수빈이는 동생과 숨바꼭질을 하고 있다. 수빈이는 현재 점 N(0 ≤ N ≤ 100,000)에 있고, 동생은 점 K(0 ≤ K ≤ 100,000)에 있다. 수빈이는 걷거나 순간이동을 할 수 있다. 만약, 수빈이의 위치가 X일 때 걷는다면 1초 후에 X-1 또는 X+1로 이동하게 된다. 순간이동을 하는 경우에는 1초 후에 2*X의 위치.. 2021. 10. 31. [flutter] How to adjust the height of the Grid View widget(그리드 뷰 위젯 높이 조절하는 방법) [flutter]How to adjust the height of the Grid View widget(그리드 뷰 위젯 높이 조절하는 방법)GridView.count의 childAspectRatio를 설정하면 된다. (Set the childAspectRatio of GridView.count.)Widget build(BuildContext context) { var size = MediaQuery.of(context).size; final double itemHeight = (size.height - kToolbarHeight - 24) / 2; final double itemWidth = size.width / 2; return new Scaffold( appBar: n.. 2021. 10. 31. [LeetCode.412][easy] Fizz Buzz https://leetcode.com/problems/fizz-buzz/ Fizz Buzz - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 접근 방법 1부터 n까지에 대해 3과5의 공배수인지, 3의 배수인지, 5의 배수인지 체크한다. O(n)의 시간복잡도를 차지하는 알고리즘으로 풀었다. 풀이 코드 class Solution { public: vector fizzBuzz(int n) { vector ans; for(int i=1;i 2021. 10. 30. [flutter] How to keep the contents in the tab even if the tab is moved - Inde [flutter플러터] How to keep the contents in the tab even if the tab is moved - IndexedStack (Tab 이동하더라도 Tab 내의 내용은 유지되도록 하는 방법 - IndexedStack) 기존에는 아래와 같이 탭바를 사용하였지만 탭을 이동하고 돌아오니 기존의 내용이 초기화되는 문제가 있었다. (Previously, the tab bar was used as follows, but when the tab was moved and returned, there was a problem that the existing content was initialized.) return Scaffold( body: _children[_currentIndex],.. 2021. 10. 29. 이전 1 ··· 46 47 48 49 50 다음 반응형