結果
| 問題 | No.183 たのしい排他的論理和(EASY) |
| コンテスト | |
| ユーザー |
158b
|
| 提出日時 | 2015-05-30 10:59:54 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 132 ms / 5,000 ms |
| コード長 | 658 bytes |
| 記録 | |
| コンパイル時間 | 494 ms |
| コンパイル使用メモリ | 87,632 KB |
| 実行使用メモリ | 7,716 KB |
| 最終ジャッジ日時 | 2026-03-18 11:24:10 |
| 合計ジャッジ時間 | 1,981 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 18 |
ソースコード
#include <iostream>
#include <algorithm>
#include <functional>
#include <string>
#include <limits.h>
#include <vector>
#include <numeric>
using namespace std;
int main(){
const int Max = 32768;
int check[Max] = {0};
int n;
int plus;
int ans;
check[0] = 2;
cin >> n;
for(int i=0; i<n; i++){
cin >> plus;
for(int i2=0; i2<Max; i2++){
if(check[i2] == 2 && check[i2 ^ plus] == 0){
check[i2 ^ plus] = 1;
}
}
//確定
for(int i2=0; i2<Max; i2++){
if(check[i2] == 1){
check[i2] = 2;
}
}
}
//集計
ans = 0;
for(int i=0; i<Max; i++){
if(check[i] == 2){
ans ++;
}
}
cout << ans << endl;
return 0;
}
158b