結果
問題 | No.999 てん vs. ほむ |
ユーザー | bliss_10969 |
提出日時 | 2020-02-28 22:37:03 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 250 bytes |
コンパイル時間 | 327 ms |
コンパイル使用メモリ | 82,260 KB |
実行使用メモリ | 111,780 KB |
最終ジャッジ日時 | 2024-04-21 19:46:02 |
合計ジャッジ時間 | 4,745 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 37 ms
57,344 KB |
testcase_01 | AC | 41 ms
51,712 KB |
testcase_02 | AC | 37 ms
51,584 KB |
testcase_03 | AC | 37 ms
51,968 KB |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | AC | 37 ms
51,840 KB |
testcase_08 | WA | - |
testcase_09 | TLE | - |
testcase_10 | -- | - |
testcase_11 | -- | - |
testcase_12 | -- | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
testcase_20 | -- | - |
testcase_21 | -- | - |
testcase_22 | -- | - |
ソースコード
n=int(input()) a=list(map(int,input().split())) ans=0 select=0 for i in range(n): ans+=max(a[0]-a[1],a[-1]-a[-2]) select=max(a[0]-a[1],a[-1]-a[-2]) if select==a[0]-a[1]: del a[0],a[0] else: del a[-1],a[-1] print(ans)