結果
問題 | No.669 対決!!! 飲み比べ |
ユーザー |
![]() |
提出日時 | 2023-04-26 22:56:31 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,306 bytes |
コンパイル時間 | 2,931 ms |
コンパイル使用メモリ | 242,564 KB |
実行使用メモリ | 7,884 KB |
最終ジャッジ日時 | 2024-11-16 06:57:46 |
合計ジャッジ時間 | 3,734 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 24 WA * 1 |
ソースコード
#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]; int cnt[(int)1e6 + 1]; 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"); }