# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
129222 | mraron | 질문 (CEOI14_question_grader) | C++14 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
int main() {
vector<int> sts;
for(int i=0;i<(1<<12);++i) {
int cnt=0;
for(int j=0;j<12;++j) {
cnt+=((1<<j)&i)!=0;
}
if(cnt==6) sts.push_back(i);
}
int typ;
cin>>typ;
if(typ==1) {
int n,t;
cin>>n>>t;
for(int i=0;i<t;++i) {
int x,y;
cin>>x>>y;
int X=sts[x], Y=sts[Y];
int h=-1;
for(int j=0;j<12;++j) {
if((X&(1<<j)) && !(Y&(1<<j))) h=j+1;
}
cout<<h<<"\n";
}
}else {
int n,t;
cin>>n>>t;
for(int i=0;i<t;++i) {
int q,h;
cin>>q>>h;
cout<<((sts[q]&(1<<(h-1)))?"yes":"no")<<"\n";
}
}
return 0;
}