結果

問題 No.1186 長方形の敷き詰め
ユーザー yatsurugiyatsurugi
提出日時 2020-09-26 15:07:25
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 329 bytes
コンパイル時間 281 ms
コンパイル使用メモリ 10,724 KB
実行使用メモリ 816,836 KB
最終ジャッジ日時 2023-09-11 11:56:55
合計ジャッジ時間 3,284 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 16 ms
8,172 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 16 ms
8,124 KB
testcase_06 AC 17 ms
8,088 KB
testcase_07 AC 16 ms
8,224 KB
testcase_08 AC 16 ms
8,116 KB
testcase_09 AC 16 ms
8,124 KB
testcase_10 AC 16 ms
8,128 KB
testcase_11 AC 16 ms
8,200 KB
testcase_12 AC 16 ms
8,108 KB
testcase_13 AC 16 ms
8,252 KB
testcase_14 AC 16 ms
8,112 KB
testcase_15 AC 16 ms
8,272 KB
testcase_16 WA -
testcase_17 AC 15 ms
8,020 KB
testcase_18 AC 16 ms
8,260 KB
testcase_19 AC 16 ms
8,096 KB
testcase_20 AC 16 ms
8,128 KB
testcase_21 AC 15 ms
8,244 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()
if N == M:
    print(2)
    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)
0