結果
問題 | No.1770 N言っちゃダメゲーム (6) |
ユーザー | trineutron |
提出日時 | 2020-05-30 17:26:03 |
言語 | C++17 (gcc 12.3.0 + boost 1.83.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 832 bytes |
コンパイル時間 | 793 ms |
コンパイル使用メモリ | 78,872 KB |
実行使用メモリ | 17,204 KB |
最終ジャッジ日時 | 2023-09-16 21:56:09 |
合計ジャッジ時間 | 4,820 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
8,760 KB |
testcase_01 | AC | 1 ms
4,380 KB |
testcase_02 | AC | 2 ms
4,380 KB |
testcase_03 | AC | 1 ms
4,376 KB |
testcase_04 | AC | 1 ms
4,380 KB |
testcase_05 | AC | 1 ms
4,380 KB |
testcase_06 | AC | 19 ms
17,140 KB |
testcase_07 | AC | 20 ms
17,204 KB |
testcase_08 | AC | 2 ms
4,376 KB |
testcase_09 | AC | 1 ms
4,380 KB |
testcase_10 | AC | 21 ms
17,136 KB |
testcase_11 | AC | 22 ms
17,192 KB |
testcase_12 | AC | 21 ms
17,044 KB |
testcase_13 | AC | 8 ms
4,380 KB |
testcase_14 | AC | 2 ms
4,380 KB |
testcase_15 | AC | 1 ms
4,376 KB |
testcase_16 | AC | 3 ms
4,380 KB |
testcase_17 | AC | 4 ms
4,380 KB |
testcase_18 | AC | 2 ms
4,380 KB |
testcase_19 | AC | 2 ms
4,380 KB |
testcase_20 | AC | 1 ms
4,376 KB |
testcase_21 | AC | 2 ms
4,384 KB |
testcase_22 | AC | 2 ms
4,380 KB |
testcase_23 | TLE | - |
testcase_24 | -- | - |
testcase_25 | -- | - |
testcase_26 | -- | - |
testcase_27 | -- | - |
testcase_28 | -- | - |
testcase_29 | -- | - |
testcase_30 | -- | - |
testcase_31 | -- | - |
testcase_32 | -- | - |
testcase_33 | -- | - |
testcase_34 | -- | - |
testcase_35 | -- | - |
testcase_36 | -- | - |
testcase_37 | -- | - |
testcase_38 | -- | - |
testcase_39 | -- | - |
testcase_40 | -- | - |
testcase_41 | -- | - |
testcase_42 | -- | - |
testcase_43 | -- | - |
testcase_44 | -- | - |
testcase_45 | -- | - |
testcase_46 | -- | - |
ソースコード
#include <iostream> #include <vector> #include <cassert> int main() { int n, k; std::cin >> n >> k; assert(1 <= k and k < n and n <= 200000); std::vector<std::vector<bool>> dp(n + k, std::vector<bool>(k + 1)); // declarer for (int i = 0; i <= k; i++) { dp.at(n - 1).at(i) = true; } for (int i = n - 2; i >= 0; i--) { for (int j = 1; j <= k; j++) { dp.at(i).at(j) = true; for (int l = 1; l <= k; l++) { if (j == l) continue; if (dp.at(i + l).at(l)) dp.at(i).at(j) = false; } } } bool win = false; for (int i = 1; i <= k; i++) { if (dp.at(i).at(i)) { win = true; std::cout << i << std::endl; } } if (!win) { std::cout << 0 << std::endl; } }