結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー cureskol
提出日時 2020-04-10 13:49:00
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 10 ms / 5,000 ms
コード長 329 bytes
コンパイル時間 1,652 ms
コンパイル使用メモリ 176,012 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-15 00:17:52
合計ジャッジ時間 2,571 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

signed main(){
  int n;cin>>n;
  set<int> s;
  queue<int> que;
  s.insert(0);
  while(n--){
    int a;cin>>a;
    if(s.count(a))continue;
    for(int p:s)que.push(p);
    while(que.size()){
      int p=que.front();que.pop();
      s.insert(p^a);
    }
  }
  cout<<s.size()<<endl;
}
0