結果
| 問題 |
No.183 たのしい排他的論理和(EASY)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-01-09 01:24:54 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 329 bytes |
| コンパイル時間 | 660 ms |
| コンパイル使用メモリ | 65,456 KB |
| 実行使用メモリ | 83,420 KB |
| 最終ジャッジ日時 | 2024-12-17 23:29:24 |
| 合計ジャッジ時間 | 2,237 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 15 WA * 3 |
コンパイルメッセージ
main.cpp:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
4 | main()
| ^~~~
ソースコード
#include<iostream>
using namespace std;
bool dp[5001][(1<<14)+1];
main()
{
int n;cin>>n;
int a[5000];for(int i=0;i<n;i++)cin>>a[i];
dp[0][0]=1;
for(int i=0;i<n;i++)
{
for(int j=0;j<=1<<14;j++)
{
if(dp[i][j])dp[i+1][j^a[i]]=dp[i+1][j]=1;
}
}
int cnt=0;
for(int j=0;j<=1<<14;j++)cnt+=dp[n][j];
cout<<cnt<<endl;
}