# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
290911 | 2020-09-04T14:33:02 Z | Plurm | "The Lyuboyn" code (IZhO19_lyuboyn) | C++11 | 340 ms | 34148 KB |
#include <bits/stdc++.h> using namespace std; int lsb[300005]; int rmp[300005]; set<string> s; int main(){ int n,k,t; scanf("%d%d%d",&n,&k,&t); if(k % 2 == 0 || k >= n || (k != 1 && n % k == 0)){ printf("-1\n"); return 0; } for(int i = 0; i <= 18; i++) rmp[1 << i] = i; printf("%d\n", 1 << n); char bs[32]; scanf("%s",bs); if(strlen(bs) != n) while(true); int parsed = 0; for(int i = 0; i < n; i++){ parsed *= 2; parsed += bs[i] == '1' ? 1 : 0; } printf("%s\n",bs); s.insert(bs); for(int i = 1; i < (1 << n); i++){ int bit = rmp[i & -i]; for(int j = 0; j < k; j++){ int toggidx = (bit+j) % n; bs[n-toggidx-1] = '0'+'1'-bs[n-toggidx-1]; } printf("%s\n",bs); if(s.count(bs)) while(true); s.insert(bs); } return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 384 KB | Ok |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 384 KB | Ok |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 256 KB | Ok |
2 | Correct | 0 ms | 256 KB | Ok |
3 | Correct | 1 ms | 256 KB | Ok |
4 | Correct | 1 ms | 384 KB | Ok |
5 | Correct | 0 ms | 256 KB | Ok |
6 | Correct | 0 ms | 256 KB | Ok |
7 | Correct | 0 ms | 384 KB | Ok |
8 | Correct | 1 ms | 384 KB | Ok |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 246 ms | 34040 KB | Ok |
2 | Correct | 137 ms | 17132 KB | Ok |
3 | Correct | 1 ms | 512 KB | Ok |
4 | Correct | 1 ms | 384 KB | Ok |
5 | Correct | 0 ms | 384 KB | Ok |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 384 KB | Ok |
2 | Correct | 7 ms | 1152 KB | Ok |
3 | Correct | 130 ms | 17144 KB | Ok |
4 | Correct | 64 ms | 8696 KB | Ok |
5 | Incorrect | 0 ms | 384 KB | Output -1 while solution exists |
6 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 340 ms | 34088 KB | Ok |
2 | Correct | 302 ms | 34044 KB | Ok |
3 | Incorrect | 1 ms | 384 KB | Output -1 while solution exists |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 246 ms | 34040 KB | Ok |
2 | Correct | 137 ms | 17132 KB | Ok |
3 | Correct | 1 ms | 512 KB | Ok |
4 | Correct | 1 ms | 384 KB | Ok |
5 | Correct | 0 ms | 384 KB | Ok |
6 | Correct | 1 ms | 384 KB | Ok |
7 | Correct | 7 ms | 1152 KB | Ok |
8 | Correct | 130 ms | 17144 KB | Ok |
9 | Correct | 64 ms | 8696 KB | Ok |
10 | Incorrect | 0 ms | 384 KB | Output -1 while solution exists |
11 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 169 ms | 17144 KB | Ok |
2 | Correct | 309 ms | 34040 KB | Ok |
3 | Correct | 328 ms | 34148 KB | Ok |
4 | Correct | 15 ms | 1920 KB | Ok |
5 | Correct | 1 ms | 384 KB | Ok |
6 | Correct | 30 ms | 3448 KB | Ok |
7 | Correct | 302 ms | 34040 KB | Ok |
8 | Incorrect | 0 ms | 384 KB | Output -1 while solution exists |
9 | Halted | 0 ms | 0 KB | - |