結果

問題 No.258 回転寿司(2)
ユーザー rlangevinrlangevin
提出日時 2023-09-28 12:32:51
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 394 bytes
コンパイル時間 301 ms
コンパイル使用メモリ 86,940 KB
実行使用メモリ 71,560 KB
最終ジャッジ日時 2023-09-28 12:33:04
合計ジャッジ時間 12,067 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
71,160 KB
testcase_01 WA -
testcase_02 AC 77 ms
71,072 KB
testcase_03 AC 76 ms
71,256 KB
testcase_04 AC 78 ms
71,224 KB
testcase_05 WA -
testcase_06 AC 78 ms
71,032 KB
testcase_07 AC 76 ms
71,176 KB
testcase_08 WA -
testcase_09 AC 80 ms
71,192 KB
testcase_10 AC 75 ms
71,252 KB
testcase_11 AC 77 ms
71,296 KB
testcase_12 WA -
testcase_13 AC 74 ms
71,076 KB
testcase_14 AC 77 ms
71,100 KB
testcase_15 WA -
testcase_16 AC 74 ms
71,032 KB
testcase_17 AC 76 ms
71,196 KB
testcase_18 AC 80 ms
71,068 KB
testcase_19 WA -
testcase_20 AC 79 ms
71,108 KB
testcase_21 WA -
testcase_22 AC 75 ms
71,064 KB
testcase_23 AC 75 ms
70,916 KB
testcase_24 AC 74 ms
70,872 KB
testcase_25 AC 73 ms
71,080 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 AC 77 ms
70,868 KB
testcase_47 AC 79 ms
70,992 KB
testcase_48 AC 76 ms
71,292 KB
testcase_49 WA -
testcase_50 WA -
testcase_51 WA -
testcase_52 WA -
testcase_53 AC 77 ms
71,096 KB
testcase_54 AC 80 ms
71,044 KB
testcase_55 WA -
testcase_56 WA -
testcase_57 WA -
testcase_58 WA -
testcase_59 WA -
testcase_60 WA -
testcase_61 WA -
testcase_62 WA -
testcase_63 WA -
testcase_64 WA -
testcase_65 WA -
testcase_66 WA -
testcase_67 WA -
testcase_68 WA -
testcase_69 WA -
testcase_70 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
V = list(map(int, input().split()))
inf = 10 ** 18
dp0 = [-inf] * (N + 1)
dp1 = [-inf] * (N + 1)
dp0[0] = 0
for i in range(N):
    dp1[i + 1] = dp0[i] + V[i]
    dp0[i + 1] = max(dp0[i], dp1[i])

now = dp1[-1]
print(now)
ans = []
for i in range(N, 0, -1):
    if now == dp1[i] and now == dp0[i - 1] + V[i - 1]:
        ans.append(i)
        now -= V[i - 1]

print(*sorted(ans))
0