| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1330094 | gkos5678 | Question (Grader is different from the original contest) (CEOI14_question_grader) | C++20 | 0 ms | 0 KiB |
#include <bits/stdc++.h>
using namespace std;
const int maxn = 930;
int ab, n, t, br[maxn];
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int tr = 1;
for (int i = 1; i < (1 << 12); i++){
if (__builtin_popcount(i) != 6)
continue;
br[tr] = i;
tr++;
}
cin >> ab >> n >> t;
while(t--){
if (ab == 1){
int x, y;
cin >> x >> y;
for (int i = 0; i < 12; i++){
if (((br[x] >> i) & 1) == 1 && ((br[y] >> i) & 1) == 0){
cout << i + 1 << "\n";
break;
}
}
} else {
int q, h;
cin >> q >> h;
h--;
if ((br[q] >> h) & 1)
cout << "yes\n";
else
cout << "no\n";
}
}
return 0;
}
#include <bits/stdc++.h>
using namespace std;
const int maxn = 930;
int ab, n, t, br[maxn];
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int tr = 1;
for (int i = 1; i < (1 << 12); i++){
if (__builtin_popcount(i) != 6)
continue;
br[tr] = i;
tr++;
}
cin >> ab >> n >> t;
while(t--){
if (ab == 1){
int x, y;
cin >> x >> y;
for (int i = 0; i < 12; i++){
if (((br[x] >> i) & 1) == 1 && ((br[y] >> i) & 1) == 0){
cout << i + 1 << "\n";
break;
}
}
} else {
int q, h;
cin >> q >> h;
h--;
if ((br[q] >> h) & 1)
cout << "yes\n";
else
cout << "no\n";
}
}
return 0;
}
