結果
| 問題 | No.183 たのしい排他的論理和(EASY) |
| コンテスト | |
| ユーザー |
Tawara
|
| 提出日時 | 2015-08-28 11:19:19 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 697 bytes |
| 記録 | |
| コンパイル時間 | 484 ms |
| コンパイル使用メモリ | 101,320 KB |
| 実行使用メモリ | 738,304 KB |
| 最終ジャッジ日時 | 2026-04-02 08:59:01 |
| 合計ジャッジ時間 | 6,191 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 11 MLE * 7 |
ソースコード
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <cmath>
#include <string>
using namespace std;
typedef long long LL;
#define range(i,a,b) for(int i=(a); i < (b); i++)
#define rep(i,n) range(i,0,n)
#define MAX_INT 2147483647
int main(){
int N, M = 1<<15, ans = 0;
vector < vector <int> > dp;
cin >> N;
LL A[N];
dp = vector <vector <int> >(N, vector <int> (M, 0));
rep(i,N) cin >> A[i];
dp[0][0] = 1;
dp[0][A[0]] = 1;
rep(i,N-1){
rep(j,M){
if(dp[i][j]){
dp[i+1][j] = 1;
dp[i+1][j^A[i+1]] = 1;
}
}
}
rep(i,M) ans += dp[N-1][i];
cout << ans << endl;
return 0;
}
Tawara