結果
問題 | No.8 N言っちゃダメゲーム |
ユーザー | soylio |
提出日時 | 2020-01-17 21:51:57 |
言語 | C++14 (gcc 13.2.0 + boost 1.83.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 449 bytes |
コンパイル時間 | 675 ms |
コンパイル使用メモリ | 69,240 KB |
実行使用メモリ | 7,648 KB |
最終ジャッジ日時 | 2023-09-08 02:28:04 |
合計ジャッジ時間 | 7,403 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge13 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
4,384 KB |
testcase_01 | AC | 1 ms
4,376 KB |
testcase_02 | AC | 1 ms
4,380 KB |
testcase_03 | TLE | - |
testcase_04 | -- | - |
testcase_05 | -- | - |
testcase_06 | -- | - |
testcase_07 | -- | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
testcase_10 | -- | - |
ソースコード
#include <iostream> #include <algorithm> #include <vector> using namespace std; bool iswin[120005]; int main() { int p; cin >> p; for (int x = 0; x < p; x++) { int n, k; cin >> n >> k; for (int i = n; i >= 0; i--) { iswin[i] = false; for (int j = 1; j <= k; j++) { if (i + j >=n)break; if (!iswin[i + j]) { iswin[i] = true; break; } } } if (iswin[0]) cout << "Win\n"; else cout << "Lose\n"; } return 0; }