結果

問題 No.2658 L-R Nim
ユーザー SnowBeenDidingSnowBeenDiding
提出日時 2024-03-01 23:07:35
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 959 bytes
コンパイル時間 6,175 ms
コンパイル使用メモリ 314,204 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-03-01 23:12:35
合計ジャッジ時間 115,159 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,548 KB
testcase_01 AC 6,181 ms
6,548 KB
testcase_02 AC 6,178 ms
6,548 KB
testcase_03 AC 6,175 ms
6,548 KB
testcase_04 AC 2 ms
6,548 KB
testcase_05 AC 948 ms
6,548 KB
testcase_06 AC 6,196 ms
6,548 KB
testcase_07 AC 3,380 ms
6,548 KB
testcase_08 AC 2,545 ms
6,548 KB
testcase_09 AC 6,164 ms
6,548 KB
testcase_10 AC 6,161 ms
6,548 KB
testcase_11 WA -
testcase_12 AC 6,176 ms
6,548 KB
testcase_13 AC 6,274 ms
6,548 KB
testcase_14 AC 6,188 ms
6,548 KB
testcase_15 AC 126 ms
6,548 KB
testcase_16 AC 6,193 ms
6,548 KB
testcase_17 AC 6,214 ms
6,548 KB
testcase_18 AC 6,165 ms
6,548 KB
testcase_19 AC 6,105 ms
6,548 KB
testcase_20 WA -
testcase_21 AC 6,153 ms
6,548 KB
testcase_22 AC 6,181 ms
6,548 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 6,209 ms
6,548 KB
testcase_34 AC 6,168 ms
6,548 KB
testcase_35 AC 6,227 ms
6,548 KB
testcase_36 AC 6,205 ms
6,548 KB
testcase_37 AC 21 ms
6,548 KB
testcase_38 AC 6,206 ms
6,548 KB
testcase_39 AC 6,189 ms
6,548 KB
testcase_40 AC 6,197 ms
6,548 KB
testcase_41 AC 6,199 ms
6,548 KB
testcase_42 AC 6,195 ms
6,548 KB
testcase_43 AC 6,198 ms
6,548 KB
testcase_44 AC 6,166 ms
6,548 KB
testcase_45 AC 6,206 ms
6,548 KB
testcase_46 AC 6,183 ms
6,548 KB
testcase_47 AC 6,189 ms
6,548 KB
testcase_48 WA -
testcase_49 WA -
testcase_50 WA -
testcase_51 AC 6,236 ms
6,548 KB
testcase_52 AC 6,202 ms
6,548 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

#include <atcoder/all>
#define rep(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++)
using namespace std;
using namespace atcoder;

typedef long long ll;

int f(vector<int> a) {
    int n = a.size();
    unordered_map<int, int> ma;
    int x = 0;
    ma[0]++;
    rep(i, 0, n) {
        x ^= a[i];
        ma[x]++;
    }
    x = 0;
    int ct = 0;
    rep(i, 0, n) {
        ma[x]--;
        ct += ma[x];
        x ^= a[i];
    }
    return ct;
}

int main() {
    int n, k;
    cin >> n >> k;
    vector<int> a(n);
    rep(i, 0, n) cin >> a[i];
    if (f(a) == 0) {
        cout << "Yes" << endl;
        return 0;
    }
    while (clock() < 6000000) {
        int ind = rand() % n;
        int ad = rand() % k + 1;
        if (rand() % 2) ad *= -1;
        a[ind] += ad;
        if (a[ind] > 0 && f(a) == 0) {
            cout << "Yes" << endl;
            return 0;
        }
        a[ind] -= ad;
    }
    cout << "No" << endl;
}
0