結果
問題 | No.1456 Range Xor |
ユーザー | mmn15277198 |
提出日時 | 2021-04-02 23:19:27 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 3,032 bytes |
コンパイル時間 | 1,319 ms |
コンパイル使用メモリ | 105,756 KB |
実行使用メモリ | 26,240 KB |
最終ジャッジ日時 | 2024-06-06 08:18:51 |
合計ジャッジ時間 | 5,864 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 4 ms
6,528 KB |
testcase_01 | AC | 4 ms
6,656 KB |
testcase_02 | AC | 4 ms
6,400 KB |
testcase_03 | AC | 161 ms
26,240 KB |
testcase_04 | AC | 116 ms
21,376 KB |
testcase_05 | AC | 131 ms
23,040 KB |
testcase_06 | AC | 153 ms
24,960 KB |
testcase_07 | AC | 121 ms
21,888 KB |
testcase_08 | AC | 125 ms
21,760 KB |
testcase_09 | AC | 143 ms
24,704 KB |
testcase_10 | AC | 117 ms
21,376 KB |
testcase_11 | AC | 23 ms
10,240 KB |
testcase_12 | AC | 11 ms
7,936 KB |
testcase_13 | AC | 41 ms
13,056 KB |
testcase_14 | AC | 36 ms
12,032 KB |
testcase_15 | AC | 90 ms
18,560 KB |
testcase_16 | AC | 88 ms
18,560 KB |
testcase_17 | AC | 59 ms
15,488 KB |
testcase_18 | AC | 30 ms
11,136 KB |
testcase_19 | AC | 66 ms
16,000 KB |
testcase_20 | AC | 87 ms
18,304 KB |
testcase_21 | AC | 60 ms
15,360 KB |
testcase_22 | AC | 69 ms
16,128 KB |
testcase_23 | AC | 34 ms
11,776 KB |
testcase_24 | AC | 19 ms
9,600 KB |
testcase_25 | AC | 39 ms
12,160 KB |
testcase_26 | AC | 68 ms
16,512 KB |
testcase_27 | AC | 73 ms
16,896 KB |
testcase_28 | AC | 30 ms
11,392 KB |
testcase_29 | AC | 149 ms
25,216 KB |
testcase_30 | AC | 117 ms
21,888 KB |
testcase_31 | AC | 29 ms
11,264 KB |
testcase_32 | AC | 25 ms
10,368 KB |
testcase_33 | AC | 46 ms
13,312 KB |
testcase_34 | AC | 149 ms
24,448 KB |
testcase_35 | AC | 51 ms
14,080 KB |
testcase_36 | AC | 116 ms
21,120 KB |
testcase_37 | AC | 137 ms
24,320 KB |
testcase_38 | AC | 19 ms
9,472 KB |
testcase_39 | AC | 106 ms
20,224 KB |
testcase_40 | AC | 85 ms
18,048 KB |
testcase_41 | AC | 6 ms
6,784 KB |
testcase_42 | AC | 14 ms
8,576 KB |
testcase_43 | WA | - |
testcase_44 | AC | 4 ms
6,656 KB |
testcase_45 | AC | 4 ms
6,656 KB |
testcase_46 | AC | 5 ms
6,528 KB |
testcase_47 | WA | - |
testcase_48 | AC | 4 ms
6,528 KB |
ソースコード
#include <iostream> #include <vector> #include <algorithm> #include <functional> #include <map> #include <iomanip> #include <stdio.h> #include <math.h> #include <queue> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; #define rep(i,n) for(int i = 0; i < (n); i++) #define pb push_back #define eb emplace_back #define fi first #define se second #define all(x) x.begin() , x.end() #define vi vector<int> #define vll vector<ll> #define vb vector<bool> const static int INF = 1001001001; const static ll LINF = 1001001001001001001LL; const static ld PI = 3.1415926535897932384626L; const static int MOD = int(1e9) + int(7); //const static ll MOD = ll(1e9) + ll(7); //const static int MOD = 998244353; //const static int MOD = 998244353; const static int MX = 202020; ll gcd (ll a , ll b) { if (a < b) swap(a , b); if (a % b == 0) return b; else return gcd (b , a % b); } ll lcm (ll a , ll b) { return (a / gcd (a , b) * b); } int keta (ll x) { int ret = 0; while(x) { ret++; x /= 10; } return ret; } inline int in () { int x; scanf("%d" , &x); return x; } inline ll lin () { ll x; scanf("%lld" , &x); return x; } void io_setup () { cout << fixed << setprecision(15); //cin.tie(0); //ios::sync_with_stdio(false); } bool is_prime (ll x) { if (x == 2 || x == 3 || x == 5 || x == 7) { return true; } for (ll i = 3; i * i <= x; i++) { if (x % i == 0) { return false; } } return true; } vb prime_table(MX , true); void prime () { prime_table[0] = prime_table[1] = false; for (int i = 2; i < MX; i++) { for(int j = i + i; j < MX; j += i) { prime_table[j] = false; } } } ll modpow (ll x , ll p) { ll ret = 1; while (p > 0) { if (p & 1) ret = ret * x % MOD; x = x * x % MOD; p >>= 1; } return ret; } vector<ll> fact(MX , 0); vector<ll> factinv(MX , 0); void calc_fact () { fact[0] = 1; for (int i = 1; i < MX; i++) fact[i] = 1LL * i * fact[i - 1] % MOD; for (int i = 0; i < MX; i++) factinv[i] = modpow(fact[i], MOD - 2); } ll nCk (ll n , ll k) { return fact[n] * factinv[k] % MOD * factinv[n - k] % MOD; } ll modsub (ll a , ll b) { if (a >= b) return (a - b) % MOD; else return (MOD + a - b) % MOD; } /* //memo v.erase(unique(all(v)), v.end()); */ void solve() { map<ll,int> mp1 , mp2; int n = in(); ll k = lin(); vll a(n); rep(i,n) a[i] = lin(); vll sum(n); rep(i,n) { if(i == 0) sum[i] = a[i]; else sum[i] = sum[i - 1] ^ a[i]; mp1[sum[i]] = 1; } vll sum2(n); rep(i,n) { if(i == 0) sum2[i] = a[i] ^ k; else sum2[i] = sum[i] ^ k; mp2[sum2[i]] = 1; } for (auto i : mp1) { if(mp2[i.fi] == 1) { cout << "Yes" << endl; return; } } cout << "No" << endl; return; } int main () { io_setup(); //prime(); //calc_fact(); solve(); return 0; }