結果
問題 | No.361 門松ゲーム2 |
ユーザー |
![]() |
提出日時 | 2018-01-06 03:01:57 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 660 bytes |
コンパイル時間 | 568 ms |
コンパイル使用メモリ | 62,428 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-23 07:42:35 |
合計ジャッジ時間 | 2,502 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 18 WA * 10 |
ソースコード
#include <iostream> #include <set> using namespace std; int g[510]; int main() { int L, D; cin >> L >> D; for (int x = 6; x <= L; x++) { set<int> S; for (int L1 = 1; L1 * 3 <= L; L1++) { for (int L2 = L1 + 1; L - (L1 + L2) > L2; L2++) { int L3 = L - (L1 + L2); if (L3 - L1 > D) continue; S.insert(g[L1] ^ g[L2] ^ g[L3]); } } int num = 0; for (int n : S) { if (num != n) break; num++; } g[x] = num; } if (g[L]) cout << "kado" << endl; else cout << "matsu" << endl; return 0; }