![](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fb4f1UN%2FbtsH9hq3qXD%2FkhfFqONWlYTctKfv1EYaA1%2Fimg.jpg)
[백준 2048번] Hello, 2048!
·
📚알고리즘/백준
https://www.acmicpc.net/problem/2048노가다를 좀 하다가 맞을 거 같아서 찍었다...찍었다고 말하긴 했지만 사실상 수학적 직관력이 필요한 문제아몰랑 노가다의 결과는 r >= 4이면, 마지막에 붙인 수를 2로 r만큼 나누면 홀수가 된다. 따라서 r >= 4 일때는 r이 답이고, 다른 경우에는 수가 작으니 직접 다 붙여서 2로 몇번이나 나눠지는지 직접 나눠보면 된다. #include #include #include #define endl "\n"using namespace std;int t,l,r;int main() { ios_base::sync_with_stdio(false); cin.tie(0);cout.tie(0); cin >> t; while(t--){ cin >> l ..