結果

問題 No.669 対決!!! 飲み比べ
ユーザー AC2KAC2K
提出日時 2023-04-26 22:58:03
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,378 bytes
コンパイル時間 2,764 ms
コンパイル使用メモリ 243,480 KB
実行使用メモリ 11,424 KB
最終ジャッジ日時 2024-04-27 23:32:54
合計ジャッジ時間 4,092 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 5 ms
11,116 KB
testcase_01 AC 5 ms
11,148 KB
testcase_02 WA -
testcase_03 AC 7 ms
11,228 KB
testcase_04 AC 43 ms
11,244 KB
testcase_05 AC 39 ms
11,292 KB
testcase_06 AC 30 ms
11,136 KB
testcase_07 AC 5 ms
11,100 KB
testcase_08 AC 19 ms
11,328 KB
testcase_09 AC 5 ms
11,128 KB
testcase_10 AC 10 ms
11,156 KB
testcase_11 AC 25 ms
11,184 KB
testcase_12 AC 17 ms
11,276 KB
testcase_13 AC 6 ms
11,140 KB
testcase_14 AC 5 ms
11,192 KB
testcase_15 AC 41 ms
11,184 KB
testcase_16 AC 22 ms
11,128 KB
testcase_17 AC 15 ms
11,424 KB
testcase_18 AC 6 ms
11,160 KB
testcase_19 AC 36 ms
11,252 KB
testcase_20 AC 15 ms
11,256 KB
testcase_21 AC 11 ms
11,112 KB
testcase_22 AC 7 ms
11,104 KB
testcase_23 AC 18 ms
11,232 KB
testcase_24 AC 5 ms
11,172 KB
testcase_25 AC 5 ms
11,148 KB
testcase_26 AC 5 ms
11,180 KB
testcase_27 AC 5 ms
11,320 KB
testcase_28 AC 6 ms
11,176 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#line 2 "library/src/template.hpp"
#include<bits/stdc++.h>
#define rep(i, N) for (int i = 0; i < (N); i++)
#define all(x) (x).begin(),(x).end()
#define popcount(x) __builtin_popcount(x)
using i128=__int128_t;
using ll = long long;
using ld = long double;
using graph = std::vector<std::vector<int>>;
using P = std::pair<int, int>;
constexpr int inf = 1e9;
constexpr ll infl = 1e18;
constexpr ld eps = 1e-6;
const long double pi = acos(-1);
constexpr uint64_t MOD = 1e9 + 7;
constexpr uint64_t MOD2 = 998244353;
constexpr int dx[] = { 1,0,-1,0 };
constexpr int dy[] = { 0,1,0,-1 };
template<class T>constexpr inline void chmax(T&x,T y){if(x<y)x=y;}
template<class T>constexpr inline void chmin(T&x,T y){if(x>y)x=y;}
#line 2 "main.cpp"
using namespace std;
int main() {
    int n, k;
    cin >> n >> k;
    int grundy[(int)1e6 + 1];
    memset(grundy, 0, sizeof(grundy));
    int cnt[(int)1e6 + 2];
    memset(cnt, 0, sizeof(cnt));
    grundy[0] = 0;
    for (int i = 1; i <= 100000; ++i) {
        if (i - k - 1 >= 0) {
            --cnt[grundy[i - k - 1]];
        }
        ++cnt[grundy[i - 1]];
        int mex = 0;
        while (1){
            if (!cnt[mex]) break;
            else ++mex;
        }
        grundy[i] = mex;
    }

    int XOR_SUM = 0;
    rep(i, n) {
        int a;
        cin>>a;
        XOR_SUM ^= grundy[a];
    }

    puts(XOR_SUM ? "YES" : "NO");
}
0