# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
23135 | 2017-05-03T11:43:47 Z | ainta | Window XOR (KRIII5_WX) | C++14 | 129 ms | 2004 KB |
#include<cstdio> #include<algorithm> using namespace std; int n, K, X[101000], TP[101000]; bool v[101000]; long long T; int main(){ int i, x, j, c = 1, t1, t2; scanf("%d%d%lld",&n,&K,&T); for(i=0;i<n;i++)scanf("%d",&X[i]); while(T){ if(T&1){ for(i=0;i<n;i++)v[i]=false; int s = 0; for(i=0;i<n;i++){ if(v[i])continue; t1 = t2 = i; for(j=0;j<K-1;j++){ s^= X[t2]; t2 = (t2 + c)%n; } for(;;){ v[t1] = true; s ^= X[t2]; TP[t1] = s; s ^= X[t1]; t2=(t2+c)%n; t1=(t1+c)%n; if(t1==i)break; } } for(i=0;i<n;i++)X[i] = TP[i]; } c=(c<<1)%n; T>>=1; } for(i=0;i<n;i++)printf("%d ",X[i]); }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 2004 KB | Output is correct |
2 | Correct | 0 ms | 2004 KB | Output is correct |
3 | Correct | 0 ms | 2004 KB | Output is correct |
4 | Correct | 119 ms | 2004 KB | Output is correct |
5 | Correct | 26 ms | 2004 KB | Output is correct |
6 | Correct | 106 ms | 2004 KB | Output is correct |
7 | Correct | 26 ms | 2004 KB | Output is correct |
8 | Incorrect | 129 ms | 2004 KB | Output isn't correct |
9 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 119 ms | 2004 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |