# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
22267 | 2017-04-30T03:21:07 Z | 크리콘 B번 문제는 그리디로 풀려요(#918, imsifile) | Window XOR (KRIII5_WX) | C++ | 386 ms | 3484 KB |
#include<stdio.h> #include<memory.h> typedef long long lld; int N, K; lld T, ba[101010], im[101010], chk[101010]; lld gcd(lld a, lld b){ return b?gcd(b,a%b):a; } void trans(int ji){ lld per = (1ll<<ji) % N, K2 = K; lld tmp = N / gcd(N, per); K2 %= 2*tmp; memset(chk, 0, sizeof(chk)); int cnt=0; for(lld i=0; i<N; i++){ if(chk[i])continue; lld xo=0; for(lld j=0; j<K2; j++)xo ^= ba[(i+j*per) % N]; for(lld j=0; j<tmp; j++){ im[(i+j*per) % N] = xo, chk[(i+j*per) % N] = 1; xo ^= ba[(i+j*per) % N]; xo ^= ba[(i+(j+K2)*per) % N]; } } memcpy(ba, im, sizeof(ba)); } int main(){ scanf("%d%d%lld", &N, &K, &T); for(int i=0; i<N; i++)scanf("%lld", &ba[i]); for(int i=0; i<63; i++){ if((1ll<<i) & T) trans(i); } for(int i=0; i<N; i++)printf("%lld ", ba[i]); return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 3484 KB | Output is correct |
2 | Correct | 6 ms | 3484 KB | Output is correct |
3 | Correct | 6 ms | 3484 KB | Output is correct |
4 | Correct | 223 ms | 3484 KB | Output is correct |
5 | Correct | 26 ms | 3484 KB | Output is correct |
6 | Correct | 233 ms | 3484 KB | Output is correct |
7 | Correct | 26 ms | 3484 KB | Output is correct |
8 | Correct | 236 ms | 3484 KB | Output is correct |
9 | Correct | 233 ms | 3484 KB | Output is correct |
10 | Correct | 239 ms | 3484 KB | Output is correct |
11 | Correct | 246 ms | 3484 KB | Output is correct |
12 | Correct | 136 ms | 3484 KB | Output is correct |
13 | Correct | 173 ms | 3484 KB | Output is correct |
14 | Correct | 133 ms | 3484 KB | Output is correct |
15 | Correct | 129 ms | 3484 KB | Output is correct |
16 | Correct | 226 ms | 3484 KB | Output is correct |
17 | Correct | 243 ms | 3484 KB | Output is correct |
18 | Correct | 143 ms | 3484 KB | Output is correct |
19 | Correct | 139 ms | 3484 KB | Output is correct |
20 | Correct | 166 ms | 3484 KB | Output is correct |
21 | Correct | 153 ms | 3484 KB | Output is correct |
22 | Correct | 153 ms | 3484 KB | Output is correct |
23 | Correct | 133 ms | 3484 KB | Output is correct |
24 | Correct | 149 ms | 3484 KB | Output is correct |
25 | Correct | 146 ms | 3484 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 226 ms | 3484 KB | Output is correct |
2 | Correct | 119 ms | 3484 KB | Output is correct |
3 | Correct | 159 ms | 3484 KB | Output is correct |
4 | Correct | 226 ms | 3484 KB | Output is correct |
5 | Correct | 239 ms | 3484 KB | Output is correct |
6 | Correct | 123 ms | 3484 KB | Output is correct |
7 | Correct | 129 ms | 3484 KB | Output is correct |
8 | Correct | 229 ms | 3484 KB | Output is correct |
9 | Correct | 236 ms | 3484 KB | Output is correct |
10 | Correct | 169 ms | 3484 KB | Output is correct |
11 | Correct | 63 ms | 3484 KB | Output is correct |
12 | Correct | 76 ms | 3484 KB | Output is correct |
13 | Correct | 23 ms | 3484 KB | Output is correct |
14 | Correct | 26 ms | 3484 KB | Output is correct |
15 | Correct | 383 ms | 3484 KB | Output is correct |
16 | Correct | 33 ms | 3484 KB | Output is correct |
17 | Correct | 296 ms | 3484 KB | Output is correct |
18 | Correct | 36 ms | 3484 KB | Output is correct |
19 | Correct | 203 ms | 3484 KB | Output is correct |
20 | Correct | 29 ms | 3484 KB | Output is correct |
21 | Correct | 153 ms | 3484 KB | Output is correct |
22 | Correct | 39 ms | 3484 KB | Output is correct |
23 | Correct | 209 ms | 3484 KB | Output is correct |
24 | Correct | 299 ms | 3484 KB | Output is correct |
25 | Correct | 26 ms | 3484 KB | Output is correct |
26 | Correct | 239 ms | 3484 KB | Output is correct |
27 | Correct | 26 ms | 3484 KB | Output is correct |
28 | Correct | 223 ms | 3484 KB | Output is correct |
29 | Correct | 29 ms | 3484 KB | Output is correct |
30 | Correct | 216 ms | 3484 KB | Output is correct |
31 | Correct | 26 ms | 3484 KB | Output is correct |
32 | Correct | 239 ms | 3484 KB | Output is correct |
33 | Correct | 33 ms | 3484 KB | Output is correct |
34 | Correct | 306 ms | 3484 KB | Output is correct |
35 | Correct | 353 ms | 3484 KB | Output is correct |
36 | Correct | 356 ms | 3484 KB | Output is correct |
37 | Correct | 386 ms | 3484 KB | Output is correct |
38 | Correct | 373 ms | 3484 KB | Output is correct |
39 | Correct | 329 ms | 3484 KB | Output is correct |
40 | Correct | 286 ms | 3484 KB | Output is correct |
41 | Correct | 166 ms | 3484 KB | Output is correct |
42 | Correct | 379 ms | 3484 KB | Output is correct |
43 | Correct | 256 ms | 3484 KB | Output is correct |
44 | Correct | 259 ms | 3484 KB | Output is correct |
45 | Correct | 206 ms | 3484 KB | Output is correct |
46 | Correct | 246 ms | 3484 KB | Output is correct |
47 | Correct | 279 ms | 3484 KB | Output is correct |
48 | Correct | 216 ms | 3484 KB | Output is correct |
49 | Correct | 129 ms | 3484 KB | Output is correct |
50 | Correct | 206 ms | 3484 KB | Output is correct |
51 | Correct | 239 ms | 3484 KB | Output is correct |
52 | Correct | 253 ms | 3484 KB | Output is correct |
53 | Correct | 299 ms | 3484 KB | Output is correct |
54 | Correct | 133 ms | 3484 KB | Output is correct |
55 | Correct | 176 ms | 3484 KB | Output is correct |
56 | Correct | 73 ms | 3484 KB | Output is correct |
57 | Correct | 133 ms | 3484 KB | Output is correct |
58 | Correct | 189 ms | 3484 KB | Output is correct |
59 | Correct | 146 ms | 3484 KB | Output is correct |
60 | Correct | 236 ms | 3484 KB | Output is correct |
61 | Correct | 243 ms | 3484 KB | Output is correct |
62 | Correct | 249 ms | 3484 KB | Output is correct |
63 | Correct | 136 ms | 3484 KB | Output is correct |
64 | Correct | 209 ms | 3484 KB | Output is correct |
65 | Correct | 106 ms | 3484 KB | Output is correct |
66 | Correct | 109 ms | 3484 KB | Output is correct |
67 | Correct | 229 ms | 3484 KB | Output is correct |
68 | Correct | 186 ms | 3484 KB | Output is correct |
69 | Correct | 149 ms | 3484 KB | Output is correct |
70 | Correct | 206 ms | 3484 KB | Output is correct |
71 | Correct | 223 ms | 3484 KB | Output is correct |
72 | Correct | 209 ms | 3484 KB | Output is correct |
73 | Correct | 149 ms | 3484 KB | Output is correct |
74 | Correct | 183 ms | 3484 KB | Output is correct |
75 | Correct | 213 ms | 3484 KB | Output is correct |
76 | Correct | 6 ms | 3484 KB | Output is correct |
77 | Correct | 6 ms | 3484 KB | Output is correct |
78 | Correct | 6 ms | 3484 KB | Output is correct |
79 | Correct | 223 ms | 3484 KB | Output is correct |
80 | Correct | 26 ms | 3484 KB | Output is correct |
81 | Correct | 233 ms | 3484 KB | Output is correct |
82 | Correct | 26 ms | 3484 KB | Output is correct |
83 | Correct | 236 ms | 3484 KB | Output is correct |
84 | Correct | 233 ms | 3484 KB | Output is correct |
85 | Correct | 239 ms | 3484 KB | Output is correct |
86 | Correct | 246 ms | 3484 KB | Output is correct |
87 | Correct | 136 ms | 3484 KB | Output is correct |
88 | Correct | 173 ms | 3484 KB | Output is correct |
89 | Correct | 133 ms | 3484 KB | Output is correct |
90 | Correct | 129 ms | 3484 KB | Output is correct |
91 | Correct | 226 ms | 3484 KB | Output is correct |
92 | Correct | 243 ms | 3484 KB | Output is correct |
93 | Correct | 143 ms | 3484 KB | Output is correct |
94 | Correct | 139 ms | 3484 KB | Output is correct |
95 | Correct | 166 ms | 3484 KB | Output is correct |
96 | Correct | 153 ms | 3484 KB | Output is correct |
97 | Correct | 153 ms | 3484 KB | Output is correct |
98 | Correct | 133 ms | 3484 KB | Output is correct |
99 | Correct | 149 ms | 3484 KB | Output is correct |
100 | Correct | 146 ms | 3484 KB | Output is correct |