# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
686580 | QwertyPi | Present (RMI21_present) | C++14 | 1303 ms | 3884 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int all = 28, half = 14;
uint64_t allow[all][1 << half];
uint64_t p2m1[all];
int g[65][65];
int B = 1;
bool ok(uint64_t b){
for(int i = 0; i < B; i++){
if((b & (1ULL << i)) && (b & allow[i][b & ((1ULL << i + 1) - 1)]) != b) return false;
}
return true;
}
void out(uint64_t b){
vector<int> v;
for(int i = 0; i < 64; i++){
if(b & (1ULL << i)) v.push_back(i + 1);
}
cout << v.size() << ' ';
for(auto i : v) cout << i << ' ';
cout << endl;
}
int main(){
for(int i = 1; i <= 64; i++) for(int j = 1; j <= 64; j++) g[i - 1][j - 1] = __gcd(i, j) - 1;
for(int i = 1; i <= all; i++){
for(int j = 0; j < (1ULL << half); j++){
uint64_t u = 0;
for(int k1 = 0; k1 < half; k1++){
for(int k2 = 0; k2 < all; k2++){
if((j & (1ULL << k1)) && __gcd(i, k2 + 1) == k1 + 1) u |= 1ULL << k2;
}
}
allow[i - 1][j] = u;
}
}
int cnt = 0;
for(int i = 0; i <= 7; i++){
while(i >= (1ULL << B)) B++;
if(ok(i)) { if(cnt % 1 == 0) out(i); cnt++; }
}
int L; cin >> L;
for(int i = 0; i < L; i++){
int x; cin >> x;
B = 0;
for(int i = 0; ; i++){
while(i >= (1ULL << B)) B++;
if(ok(i)) { if(x == 0) { out(i); break; } x--; }
}
}
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |