結果

問題 No.1231 Make a Multiple of Ten
ユーザー pluto77pluto77
提出日時 2020-10-05 08:56:47
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,358 ms / 2,000 ms
コード長 235 bytes
コンパイル時間 591 ms
コンパイル使用メモリ 10,700 KB
実行使用メモリ 31,636 KB
最終ジャッジ日時 2023-09-27 01:42:45
合計ジャッジ時間 9,809 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,732 KB
testcase_01 AC 15 ms
7,900 KB
testcase_02 AC 16 ms
7,772 KB
testcase_03 AC 16 ms
7,816 KB
testcase_04 AC 623 ms
18,012 KB
testcase_05 AC 559 ms
16,752 KB
testcase_06 AC 227 ms
11,596 KB
testcase_07 AC 643 ms
18,676 KB
testcase_08 AC 377 ms
13,820 KB
testcase_09 AC 143 ms
9,952 KB
testcase_10 AC 592 ms
17,268 KB
testcase_11 AC 692 ms
19,324 KB
testcase_12 AC 1,301 ms
30,564 KB
testcase_13 AC 1,338 ms
31,636 KB
testcase_14 AC 15 ms
7,736 KB
testcase_15 AC 1,358 ms
29,964 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki231
n=int(input())
a=list(map(int,input().split()))
l=[]
for i in a:
 l.append(i%10)
dp=[-100000]*10
dp[0]=0
for i in range(n):
 t=[-100000]*10
 for j in range(10):
  t[(j+l[i])%10]=max(dp[j]+1,dp[(j+l[i])%10])
 dp=t
print(dp[0])
0