結果

問題 No.2038 Strange Arrange
ユーザー tktk_snsntktk_snsn
提出日時 2022-08-13 11:01:15
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 36 ms / 2,000 ms
コード長 246 bytes
コンパイル時間 107 ms
コンパイル使用メモリ 11,856 KB
実行使用メモリ 10,080 KB
最終ジャッジ日時 2023-10-24 23:19:32
合計ジャッジ時間 863 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,044 KB
testcase_01 AC 36 ms
10,080 KB
testcase_02 AC 34 ms
10,080 KB
testcase_03 AC 28 ms
10,040 KB
testcase_04 AC 28 ms
10,040 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())

A = [1] * (N + 1)
for i in range(2, N + 1, 2):
    A[i] = 3
for i in range(2, N + 1, 2):
    for j in range(2, i, 2):
        if A[i] == A[j] and i + j <= N:
            A[i + j] = max(A[i + j], A[j] + 1)

print(*A[1:], sep="")
0