結果
問題 | No.183 たのしい排他的論理和(EASY) |
ユーザー |
![]() |
提出日時 | 2017-03-18 15:49:52 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 130 ms / 5,000 ms |
コード長 | 333 bytes |
コンパイル時間 | 1,294 ms |
コンパイル使用メモリ | 166,184 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-30 00:48:39 |
合計ジャッジ時間 | 2,853 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 18 |
ソースコード
#include <bits/stdc++.h> #define REP(i,n,N) for(int i=n;i<N;i++) #define p(S) cout<<(S)<<endl using namespace std; bool dp[1<<15]={}; int main(){ int N; cin>>N; int A[5002]; REP(i,0,N) cin>>A[i]; dp[0]=true; REP(i,0,N) REP(X,0,1<<15) if(dp[X]) dp[X ^ A[i]]=dp[X]; int cnt=count(dp,dp+(1<<15),true); p(cnt); return 0; }