結果

問題 No.1687 What the Heck?
ユーザー ああいいああいい
提出日時 2022-03-04 09:46:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 176 ms / 2,000 ms
コード長 264 bytes
コンパイル時間 275 ms
コンパイル使用メモリ 86,988 KB
実行使用メモリ 110,668 KB
最終ジャッジ日時 2023-09-25 08:33:21
合計ジャッジ時間 4,707 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
71,172 KB
testcase_01 AC 77 ms
71,024 KB
testcase_02 AC 75 ms
71,264 KB
testcase_03 AC 76 ms
71,236 KB
testcase_04 AC 71 ms
71,020 KB
testcase_05 AC 70 ms
71,028 KB
testcase_06 AC 69 ms
71,324 KB
testcase_07 AC 111 ms
95,536 KB
testcase_08 AC 118 ms
104,576 KB
testcase_09 AC 106 ms
95,412 KB
testcase_10 AC 99 ms
89,004 KB
testcase_11 AC 97 ms
89,120 KB
testcase_12 AC 167 ms
110,492 KB
testcase_13 AC 165 ms
110,664 KB
testcase_14 AC 168 ms
110,668 KB
testcase_15 AC 166 ms
110,592 KB
testcase_16 AC 176 ms
109,440 KB
testcase_17 AC 83 ms
77,864 KB
testcase_18 AC 170 ms
110,520 KB
testcase_19 AC 78 ms
76,424 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
P = list(map(int,input().split()))

import sys
if N == 1:
    print(0)
    exit()

ans = 0
point = 0
D = {v:i + 1 for i,v in enumerate(P)}
for i in range(1,N):
    point += D[i]
    if point - D[i+1] > ans:
        ans = point - D[i+1]
print(ans)
0