Submission #62064596
Source Code Expand
Copy
#include <bits/stdc++.h>#include <atcoder/all>using namespace std;using namespace atcoder;#define all(x) (x).begin(), (x).end()#define rep(i, n) for (int i = 0; i < (int)(n); i++)#define rrep(i, n) for(int i = (int)(n - 1); i >= 0; i--)template <typename T> bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;}template <typename T> bool chmin(T &a,const T &b){if(a>b){a=b;return true;}return false;}using ll = long long;#define int llusing vi = vector<int>;using vvi = vector<vector<int>>;using vb = vector<bool>;using vvb = vector<vector<bool>>;using vs = vector<string>;using pii = pair<int, int>;/*using mint = modint;using vm = vector<mint>;using vvm = vector<vector<mint>>;
#include <bits/stdc++.h> #include <atcoder/all> using namespace std; using namespace atcoder; #define all(x) (x).begin(), (x).end() #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rrep(i, n) for(int i = (int)(n - 1); i >= 0; i--) template <typename T> bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;} template <typename T> bool chmin(T &a,const T &b){if(a>b){a=b;return true;}return false;} using ll = long long; #define int ll using vi = vector<int>; using vvi = vector<vector<int>>; using vb = vector<bool>; using vvb = vector<vector<bool>>; using vs = vector<string>; using pii = pair<int, int>; /* using mint = modint; using vm = vector<mint>; using vvm = vector<vector<mint>>; */ signed main(){ int n; cin >> n; vi a(n); rep(i, n) cin >> a.at(i); vi per(n, 0); vi finish(n); rep(i, n) finish.at(i) = i; set<int> ans; while(true){ vi b(n, 0); rep(i, n) b.at(per.at(i)) += a.at(i); int sum = 0; //rep(i, n) cerr << b.at(i) << (i == n - 1 ? '\n' : ' '); rep(i, n) sum ^= b.at(i); ans.insert(sum); per.at(n - 1)++; bool finish = false; rrep(i, n){ if(i == 0){ finish = true; break; } if(per.at(i) != i + 1) break; per.at(i) = 0; per.at(i - 1)++; } if(finish) break; } cout << ans.size() << endl; }
Submission Info
Submission Time | |
---|---|
Task | D - Stone XOR |
User | yoniha |
Language | C++ 23 (gcc 12.2) |
Score | 0 |
Code Size | 1338 Byte |
Status | TLE |
Exec Time | 3313 ms |
Memory | 9004 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 400 | ||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | example_00.txt, example_01.txt, example_02.txt |
All | example_00.txt, example_01.txt, example_02.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt, random_20.txt, random_21.txt, random_22.txt, random_23.txt, random_24.txt, random_25.txt, random_26.txt, random_27.txt, random_28.txt, random_29.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
example_00.txt | AC | 1 ms | 3496 KB |
example_01.txt | AC | 1 ms | 3536 KB |
example_02.txt | AC | 1 ms | 3548 KB |
hand_00.txt | TLE | 3310 ms | 3240 KB |
hand_01.txt | TLE | 3310 ms | 3288 KB |
hand_02.txt | TLE | 3310 ms | 3296 KB |
hand_03.txt | TLE | 3311 ms | 5816 KB |
hand_04.txt | AC | 1 ms | 3504 KB |
hand_05.txt | TLE | 3310 ms | 3220 KB |
random_00.txt | AC | 319 ms | 8940 KB |
random_01.txt | AC | 1 ms | 3496 KB |
random_02.txt | AC | 1 ms | 3508 KB |
random_03.txt | AC | 4 ms | 3676 KB |
random_04.txt | TLE | 3312 ms | 8764 KB |
random_05.txt | TLE | 3310 ms | 3240 KB |
random_06.txt | AC | 177 ms | 3536 KB |
random_07.txt | AC | 1 ms | 3508 KB |
random_08.txt | TLE | 3310 ms | 3328 KB |
random_09.txt | AC | 185 ms | 3636 KB |
random_10.txt | TLE | 3310 ms | 3480 KB |
random_11.txt | AC | 196 ms | 3560 KB |
random_12.txt | AC | 214 ms | 3984 KB |
random_13.txt | TLE | 3310 ms | 4480 KB |
random_14.txt | AC | 2459 ms | 5236 KB |
random_15.txt | TLE | 3311 ms | 8732 KB |
random_16.txt | TLE | 3311 ms | 8804 KB |
random_17.txt | AC | 307 ms | 8980 KB |
random_18.txt | AC | 322 ms | 9004 KB |
random_19.txt | AC | 1 ms | 3500 KB |
random_20.txt | AC | 1 ms | 3420 KB |
random_21.txt | TLE | 3313 ms | 5056 KB |
random_22.txt | AC | 259 ms | 4844 KB |
random_23.txt | AC | 1 ms | 3504 KB |
random_24.txt | AC | 2999 ms | 8464 KB |
random_25.txt | AC | 175 ms | 3504 KB |
random_26.txt | AC | 1 ms | 3496 KB |
random_27.txt | AC | 1957 ms | 3436 KB |
random_28.txt | AC | 179 ms | 3632 KB |
random_29.txt | TLE | 3313 ms | 3280 KB |