結果
問題 | No.130 XOR Minimax |
ユーザー |
|
提出日時 | 2019-01-29 18:23:00 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 414 bytes |
コンパイル時間 | 489 ms |
コンパイル使用メモリ | 64,572 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-10 23:59:05 |
合計ジャッジ時間 | 2,389 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 2 WA * 19 |
ソースコード
#include<iostream> using namespace std; int main(){ int n; cin >> n; int a[n]; for(int i = 0; i < n; i++) cin >> a[i]; int ans = 0; for(int i = 30; i >= 0; i--){ int judge = 0; for(int j = 0; j < n; j++){ judge += (a[j]>>i)&1; } if(judge == 0 || judge == n) continue; ans += (1<<i); } cout << ans << endl; return 0; }