結果
| 問題 |
No.183 たのしい排他的論理和(EASY)
|
| コンテスト | |
| ユーザー |
otamay6
|
| 提出日時 | 2019-11-18 10:31:39 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 560 bytes |
| コンパイル時間 | 1,670 ms |
| コンパイル使用メモリ | 175,020 KB |
| 実行使用メモリ | 13,696 KB |
| 最終ジャッジ日時 | 2024-10-01 06:50:45 |
| 合計ジャッジ時間 | 5,217 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 15 WA * 3 |
ソースコード
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0,i##_len=(n);i<i##_len;++i)
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
#define All(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
int main(){
int N;cin>>N;
vector<int> A(N);
REP(i, N) cin >> A[i];
vector<vector<bool>> dp(N+1,vector<bool>((1<<14)+1,false));
dp[0][0]=true;
REP(i,N) REP(j,(1<<14)+1){
dp[i+1][j] = dp[i][j]|dp[i][min(j^A[i],1<<14)];
}
int ans=0;
REP(i,(1<<14)+1) if(dp[N][i]){
ans++;
}
cout<<ans<<endl;
}
otamay6