제출 #23135

#제출 시각아이디문제언어결과실행 시간메모리
23135aintaWindow XOR (KRIII5_WX)C++14
0 / 7
129 ms2004 KiB
#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]); }

컴파일 시 표준 에러 (stderr) 메시지

WX.cpp: In function 'int main()':
WX.cpp:8:12: warning: unused variable 'x' [-Wunused-variable]
     int i, x, j, c = 1, t1, t2;
            ^
WX.cpp:9:31: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d%lld",&n,&K,&T);
                               ^
WX.cpp:10:38: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     for(i=0;i<n;i++)scanf("%d",&X[i]);
                                      ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...