結果
問題 | No.183 たのしい排他的論理和(EASY) |
ユーザー | karinohito |
提出日時 | 2021-04-19 20:18:04 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,318 bytes |
コンパイル時間 | 913 ms |
コンパイル使用メモリ | 106,420 KB |
実行使用メモリ | 23,416 KB |
最終ジャッジ日時 | 2023-09-17 08:22:06 |
合計ジャッジ時間 | 5,001 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
4,380 KB |
testcase_01 | AC | 2 ms
4,380 KB |
testcase_02 | AC | 2 ms
4,376 KB |
testcase_03 | AC | 2 ms
4,380 KB |
testcase_04 | AC | 2 ms
4,380 KB |
testcase_05 | AC | 2 ms
4,376 KB |
testcase_06 | AC | 2 ms
4,380 KB |
testcase_07 | WA | - |
testcase_08 | AC | 357 ms
20,908 KB |
testcase_09 | AC | 245 ms
15,436 KB |
testcase_10 | AC | 296 ms
17,868 KB |
testcase_11 | AC | 387 ms
22,500 KB |
testcase_12 | WA | - |
testcase_13 | AC | 1 ms
4,380 KB |
testcase_14 | AC | 204 ms
23,416 KB |
testcase_15 | AC | 403 ms
23,384 KB |
testcase_16 | AC | 2 ms
4,380 KB |
testcase_17 | AC | 90 ms
7,624 KB |
testcase_18 | WA | - |
testcase_19 | AC | 45 ms
5,112 KB |
ソースコード
//#include <atcoder/all> #include <iostream> #include <numeric> #include <cmath> #include <limits> #include <stdio.h> #include <iomanip> #include <string> // string, to_string, stoi #include <vector> // vector #include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <utility> // pair, make_pair #include <tuple> // tuple, make_tuple #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <map> // map #include <queue> // queue, priority_queue #include <set> // set #include <stack> // stack #include <deque> // deque #include <unordered_map> // unordered_map #include <unordered_set> // unordered_set #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower using namespace std; //using namespace atcoder; using ll = long long; #define all(A) A.begin(),A.end() using vll = vector<ll>; #define rep(i, n) for (long long i = 0; i < (long long)(n); i++) using Graph = vector<vector<ll>>; int main() { ll N; cin >> N; vll A(N); rep(i, N)cin >> A[i]; vector<vector<bool>> DP(N + 1, vector<bool>(32769, false)); DP[0][0] = true; rep(i, N) { rep(k, 32679) { if (DP[i][k]) { DP[i + 1][k] = true; DP[i + 1][k ^ A[i]] = true; } } } ll an = 0; rep(k, 32679) { if (DP[N][k])an++; } cout << an << endl; }