# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
985888 | simona1230 | 질문 (CEOI14_question_grader) | C++17 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define endl "\n"
using namespace std;
int n,t;
int tp;
int x,y,q,h;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
cin>>tp;
cin>>n>>t;
if(tp==1)
{
for(int i=1;i<=t;i++)
{
cin>>x>>y;
int j=0;
while(((1<<j)&x)&&((1<<j)&y)||!((1<<j)&x)&&!((1<<j)&y))
j++;
if((1<<j)&x)j=j+1;
else j=10+j+1;
cout<<j<<endl;
}
}
if(tp==2)
{
for(int i=1;i<=t;i++)
{
cin>>q>>h;
int c1=0;
if(h>10)h-=10,c1=1;
h--;
if((1<<(h%10))&q)
{
if(c1==0)cout<<"yes"<<endl;
else cout<<"no"<<endl;
}
else
{
if(c1==0)cout<<"no"<<endl;
else cout<<"yes"<<endl;
}
}
}
return 0;
}
/*
0
0
0
1
0
0
2
5 6
1 1
4 11
2 1
3 2
5 11
2 1
*/