結果
| 問題 | No.184 たのしい排他的論理和(HARD) |
| コンテスト | |
| ユーザー |
tottoripaper
|
| 提出日時 | 2015-05-23 19:04:41 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 37 ms / 5,000 ms |
| コード長 | 621 bytes |
| 記録 | |
| コンパイル時間 | 484 ms |
| コンパイル使用メモリ | 51,256 KB |
| 実行使用メモリ | 6,144 KB |
| 最終ジャッジ日時 | 2026-03-25 19:30:34 |
| 合計ジャッジ時間 | 1,923 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 34 |
ソースコード
#include <cstdio>
#include <algorithm>
typedef long long ll;
int N;
ll A[100000];
int main(){
scanf("%d", &N);
for(int i=0;i<N;i++){
scanf("%lld", A+i);
}
int rank = 0;
for(int i=0;i<=60;i++){
{
int j = rank;
for(;j<N;j++){
if(A[j] >> i & 1){break;}
}
if(j == N){continue;}
std::swap(A[j], A[rank]);
}
for(int j=rank+1;j<N;j++){
if(!(A[j] >> i & 1)){continue;}
A[j] ^= A[rank];
}
++rank;
}
printf("%lld\n", 1ll << rank);
}
tottoripaper