# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
22386 | 버거킹 송죽SK점 우수고객 (#40) | Window XOR (KRIII5_WX) | C++14 | 1000 ms | 11004 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pp;
typedef pair<ll,ll> pll;
void read(int& x){ scanf("%d",&x); }
void read(ll& x){ scanf("%lld",&x); }
template<typename T,typename... Args>
void read(T& a,Args&... b){ read(a); read(b...); }
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define x first
#define y second
int n, k;
ll t;
int a[100010];
int tmp[100010];
int get(ll p){ return a[p%n]; }
int sp[21][100010];
void trans(int h){
ll w = (1ll << h) % n;
for(int i=0; i<n; ++i){
sp[0][i] = a[i];
}
for(int i=1; i<=20; ++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<n; ++i){
tmp[i] = 0;
ll p=i;
for(int j=20; 0<=j; --j){
if(1&(k>>j)){
tmp[i] ^= sp[j][p];
p += w*(1<<j);
p %= n;
}
}
}
memcpy(a, tmp, sizeof(tmp));
}
int main()
{
read(n, k, t);
for(int i=0; i<n; ++i) read(a[i]);
for(int i=62; 0<=i; --i){
if(1 & (t>>i)) trans(i);
}
for(int i=0; i<n; ++i){
printf("%d ", a[i]);
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |