| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 67745 | ekrem | XOR Sum (info1cup17_xorsum) | C++98 | 1663 ms | 4364 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define st first
#define nd second
#define mp make_pair
#define pb push_back
#define N 1000005
using namespace std;
int n, a[N], top, ans, ans2;
void yz(int bit){
if(bit == 0)return;
yz(bit/2);
printf("%d",bit%2);
}
void yaz(int bit){
yz(bit);
puts("");
}
int main() {
// freopen("in.txt", "r", stdin);
// freopen("out.txt", "w", stdout);
scanf("%d",&n);
for(int i = 1; i <= n; i++){
scanf("%d", a + i);
// yaz(a[i]);
top += a[i];
}
// cout << "AMK" << ((a[1] + a[2])^(a[1] + a[1])) << endl;
// cout <<(a[1]^a[2]) << endl;
// puts("");
for(int i = 1; i <= n; i++)
for(int j = i; j <= n; j++){
int zorla = 0;
for(int k = 0; (1<<k) <= a[i] or (1<<k) <= a[j]; k++){
if(a[i]&(1<<k) and a[j]&(1<<k))
zorla |= (1<<k);
if(k > 0 and (a[i]|a[j])&(1<<k) and zorla & (1<<(k - 1)))
zorla |= (1<<k);
}
// yaz(a[i]);
// yaz(a[j]);
// yaz(a[i] + a[j]);
// // yaz( (a[i]|a[j])*2 );
// yaz(a[i]^a[j] ^ ((zorla)*2) );
// puts("");
ans ^= a[i]^a[j];
ans2 ^= a[i]^a[j] ^ ((zorla)*2);
}
// yaz(ans);
// yaz(ans2);
printf("%d\n",ans2);
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
