# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
22504 | 버거킹 송죽SK점 우수고객 (#40) | Window Xor (KRIII5_WX) | C++14 | 1000 ms | 10612 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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[100010][20];
void trans(int h, int F, int T){
ll w = (1ll << h) % n;
for(int i=0; i<n; ++i){
sp[i][0] = a[F][i];
}
for(int i=1; i<=16; ++i){
for(int j=0; j<n; ++j){
sp[j][i]=sp[j][i-1] ^ sp[(j+w*(1<<(i-1)))%n][i-1];
}
}
for(int i=0; i<n; ++i){
a[T][i] = 0;
ll p=i;
for(int j=16; 0<=j; --j){
if(1&(k>>j)){
a[T][i] ^= sp[p][j];
p += w*(1<<j)%n;
p %= 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) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |