結果
| 問題 | No.1687 What the Heck? |
| コンテスト | |
| ユーザー |
mesame3993
|
| 提出日時 | 2021-09-24 22:13:21 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 385 bytes |
| 記録 | |
| コンパイル時間 | 223 ms |
| コンパイル使用メモリ | 81,768 KB |
| 実行使用メモリ | 86,564 KB |
| 最終ジャッジ日時 | 2024-07-05 10:44:33 |
| 合計ジャッジ時間 | 4,095 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 2 WA * 3 TLE * 1 -- * 12 |
ソースコード
n = int(input()) p = list(map(int, input().split())) p = list(reversed(p)) takeda = [x for x in range(1, n+1)] ansT, ansS = 0, 0 for i in range(n): score = n-i for j in range(len(takeda)): if takeda[j] > p[i]: ansT += score takeda.remove(takeda[j]) break else: if takeda == p: takeda = takeda[1:] continue takeda = takeda[1:] ansS += score print(ansT - ansS)
mesame3993