알고리즘 문제 풀이/1DP_과제(~180615)
180104_13116_30번
//https://www.acmicpc.net/problem/13116 #include #include using namespace std;int a[11];int b[11]; int main() { int T, A, B; bool chk; cin >> T; for(int tc=0 ; tc> A >> B; memset(a,0,11*sizeof(int)); memset(b,0,11*sizeof(int)); int j=0; for(int i=A; i>0; i/=2) a[j++]=i; j=0; for(int i=B; i>0; i/=2) b[j++]=i; chk=0; for(int i=0; i