結果
| 問題 |
No.1231 Make a Multiple of Ten
|
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2020-09-18 21:43:28 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 294 bytes |
| コンパイル時間 | 254 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 33,116 KB |
| 最終ジャッジ日時 | 2024-06-22 09:16:48 |
| 合計ジャッジ時間 | 15,447 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 TLE * 3 |
ソースコード
import sys
input = sys.stdin.readline
import copy
N=int(input())
A=list(map(int,input().split()))
DP=[-1]*10
DP[0]=0
for a in A:
NDP=copy.deepcopy(DP)
for i in range(10):
if DP[i]!=-1:
NDP[(i+a)%10]=max(DP[(i+a)%10],DP[i]+1)
DP=NDP
print(DP[0])
titia