# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
22590 | 2017-04-30T05:45:46 Z | 팀명을 한번 정하면 못바꿀까?(#898, qja0950) | Window XOR (KRIII5_WX) | C++14 | 1000 ms | 3052 KB |
#include <stdio.h> #include <algorithm> #include <vector> #include <functional> #include <set> #include <map> #include <queue> #include <tuple> #include <string.h> using namespace std; #define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++) typedef long long ll; typedef pair<int, int> pi; const int MAX_N = 1e5 + 10, LOG_T = 70; int N, K; ll T; vector<int> list[LOG_T]; int main() { scanf("%d%d%lld", &N, &K, &T); vector<int> Nr; Nr = vector<int>(N, 0); for(int i=0; i<N; i++) scanf("%d", &Nr[i]); for(int i=0; i<K; i++) list[0].push_back(i); int p2 = 1; while(T) { if(T%2) { vector<int> next; next = vector<int>(N, 0); vector<bool> chk; chk = vector<bool>(N, false); for(int s=0; s<N; s++) { if(chk[s] == true) continue; int l = s, r = (1ll * p2 * (K-1) + s) % N; for(int i=0; i<K; i++) next[s] ^= Nr[(1ll * p2 * i + s) % N]; chk[s] = true; while(1) { int nl = (l+p2) % N, nr = (r+p2) % N; if(chk[nl] == true) break; next[nl] = next[l] ^ Nr[l] ^ Nr[nr]; chk[nl] = true; l = nl; r = nr; } } Nr = next; } p2 *= 2; p2 %= N; T/=2; } for(int i=0; i<N; i++) printf("%d ", Nr[i]); return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 1932 KB | Output is correct |
2 | Correct | 0 ms | 1932 KB | Output is correct |
3 | Correct | 0 ms | 1932 KB | Output is correct |
4 | Correct | 136 ms | 2792 KB | Output is correct |
5 | Correct | 33 ms | 2716 KB | Output is correct |
6 | Correct | 133 ms | 2792 KB | Output is correct |
7 | Correct | 33 ms | 2716 KB | Output is correct |
8 | Correct | 129 ms | 2792 KB | Output is correct |
9 | Correct | 119 ms | 2792 KB | Output is correct |
10 | Correct | 139 ms | 2792 KB | Output is correct |
11 | Correct | 123 ms | 2792 KB | Output is correct |
12 | Correct | 203 ms | 2524 KB | Output is correct |
13 | Correct | 219 ms | 2524 KB | Output is correct |
14 | Correct | 79 ms | 2524 KB | Output is correct |
15 | Correct | 89 ms | 2524 KB | Output is correct |
16 | Correct | 166 ms | 2780 KB | Output is correct |
17 | Correct | 199 ms | 2780 KB | Output is correct |
18 | Correct | 79 ms | 2488 KB | Output is correct |
19 | Correct | 79 ms | 2488 KB | Output is correct |
20 | Correct | 109 ms | 2792 KB | Output is correct |
21 | Correct | 96 ms | 2792 KB | Output is correct |
22 | Correct | 96 ms | 2792 KB | Output is correct |
23 | Correct | 86 ms | 2792 KB | Output is correct |
24 | Correct | 89 ms | 2792 KB | Output is correct |
25 | Correct | 106 ms | 2792 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 123 ms | 2792 KB | Output is correct |
2 | Correct | 66 ms | 2792 KB | Output is correct |
3 | Correct | 93 ms | 2792 KB | Output is correct |
4 | Correct | 149 ms | 2792 KB | Output is correct |
5 | Correct | 153 ms | 2792 KB | Output is correct |
6 | Correct | 86 ms | 2792 KB | Output is correct |
7 | Correct | 79 ms | 2792 KB | Output is correct |
8 | Correct | 123 ms | 2780 KB | Output is correct |
9 | Correct | 139 ms | 2780 KB | Output is correct |
10 | Correct | 296 ms | 2524 KB | Output is correct |
11 | Correct | 46 ms | 2524 KB | Output is correct |
12 | Correct | 49 ms | 2524 KB | Output is correct |
13 | Correct | 13 ms | 2088 KB | Output is correct |
14 | Correct | 13 ms | 2088 KB | Output is correct |
15 | Correct | 279 ms | 2856 KB | Output is correct |
16 | Correct | 33 ms | 2064 KB | Output is correct |
17 | Execution timed out | 1000 ms | 3052 KB | Execution timed out |
18 | Halted | 0 ms | 0 KB | - |