제출 #22634

#제출 시각아이디문제언어결과실행 시간메모리
22634버거킹 송죽SK점 우수고객 (#40)Window XOR (KRIII5_WX)C++14
0 / 7
1000 ms10612 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pp; typedef pair<ll,ll> pll; #define all(x) (x).begin(),(x).end() #define pb push_back #define x first #define y second int n, k; ll t; int a[2][100010]; int sp[20][100010]; void trans(int h, int F, int T){ ll w = (1ll << h) % n; if(w == 0){ if(k%2 == 0) for(int i=0; i<n; ++i) a[T][i]=0; else for(int i=0; i<n; ++i) a[T][i]=a[F][i]; return; } for(int i=0; i<n; ++i){ sp[0][i] = a[F][i]; } for(int i=1; i<=16; ++i){ for(int j=0; j<n; ++j){ sp[i][j]=sp[i-1][j] ^ sp[i-1][(j+w*(1<<(i-1)))%n]; } } for(int i=0; i<w; ++i){ a[T][i] = 0; ll p=i; for(int j=16; 0<=j; --j){ if(1&(k>>j)){ a[T][i] ^= sp[j][p]; p += w*(1<<j)%n; p %= n; } } } for(int i=w; i<n; ++i){ a[T][i] = a[T][i-w] ^ a[F][i-w] ^ a[F][(i+w*(k-1))%n]; } } int main() { //freopen("out.txt", "w", stdout); //n=1e5; k=n/2; t=12345678987654; scanf("%d%d%lld", &n, &k, &t); int F=0, T=1; for(int i=0; i<n; ++i){ //a[F][i]=rand()%int(1e9); scanf("%d", &a[F][i]); } for(int i=62; 0<=i; --i){ if(1 & (t>>i)){ trans(i, F, T); swap(F, T); } } for(int i=0; i<n; ++i){ printf("%d ", a[F][i]); } return 0; }

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

WX.cpp: In function 'int main()':
WX.cpp:52: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:56:24: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d", &a[F][i]);
                        ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...