結果

問題 No.999 てん vs. ほむ
ユーザー nasnas
提出日時 2020-03-06 21:07:25
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 366 bytes
コンパイル時間 138 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 33,524 KB
最終ジャッジ日時 2024-04-22 04:31:28
合計ジャッジ時間 15,865 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,752 KB
testcase_01 AC 30 ms
10,752 KB
testcase_02 AC 31 ms
10,752 KB
testcase_03 AC 31 ms
10,752 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 TLE -
testcase_16 WA -
testcase_17 AC 164 ms
29,128 KB
testcase_18 AC 1,952 ms
28,936 KB
testcase_19 AC 167 ms
29,132 KB
testcase_20 TLE -
testcase_21 AC 888 ms
32,620 KB
testcase_22 AC 1,437 ms
31,628 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

if __name__ == '__main__':
    n=int(input())
    A=[int(i) for i in input().split()]
    ans=0
    while 1:
        if len(A)==1:
            hom+=A[0]
            break
        if len(A)==0:
            break
        if A[0]>A[-1]:
            ans+=A[0]-A[1]
            del A[0:2]
        else:
            ans+=A[-1]-A[-2]
            del A[-2:]

    print(ans)
0