結果

問題 No.1186 長方形の敷き詰め
ユーザー yatsurugiyatsurugi
提出日時 2020-09-26 15:05:29
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 297 bytes
コンパイル時間 294 ms
コンパイル使用メモリ 10,596 KB
実行使用メモリ 816,844 KB
最終ジャッジ日時 2023-09-11 11:52:44
合計ジャッジ時間 4,161 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,936 KB
testcase_01 AC 16 ms
7,872 KB
testcase_02 AC 16 ms
8,100 KB
testcase_03 AC 16 ms
7,868 KB
testcase_04 AC 15 ms
7,804 KB
testcase_05 WA -
testcase_06 AC 16 ms
8,096 KB
testcase_07 WA -
testcase_08 AC 15 ms
8,172 KB
testcase_09 AC 15 ms
8,180 KB
testcase_10 AC 16 ms
8,180 KB
testcase_11 AC 16 ms
8,156 KB
testcase_12 AC 16 ms
8,084 KB
testcase_13 AC 16 ms
8,112 KB
testcase_14 AC 16 ms
8,088 KB
testcase_15 AC 16 ms
8,172 KB
testcase_16 WA -
testcase_17 AC 16 ms
8,076 KB
testcase_18 AC 15 ms
8,244 KB
testcase_19 AC 16 ms
8,228 KB
testcase_20 AC 15 ms
8,124 KB
testcase_21 AC 16 ms
8,180 KB
testcase_22 MLE -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M = map(int, input().split())

if N == 1 or N > M:
    print(1)
    exit()

dp = [0] * (M + 2)
dp[0] = 1

if N == 2:
    for i in range(M + 1):
        dp[i + 1] = dp[i] + dp[i - 1]
else:
    dp[1], dp[2] = 1, 1
    for i in range(3, M + 1):
        dp[i] = dp[i - 1] + dp[i - 3]

print(dp[M])
0