結果
| 問題 |
No.1604 Swap Sort:ONE
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-06-23 00:28:56 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 88 ms / 2,000 ms |
| コード長 | 217 bytes |
| コンパイル時間 | 414 ms |
| コンパイル使用メモリ | 81,904 KB |
| 実行使用メモリ | 64,364 KB |
| 最終ジャッジ日時 | 2024-11-06 11:20:48 |
| 合計ジャッジ時間 | 3,204 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 24 |
ソースコード
N = int(input())
lsp = list(map(int,input().split()))
cnt = 0
for i in range(N):
v = i+1
cnt += lsp[i]-v
for j in range(i+1,N):
if lsp[j] < lsp[i]:
lsp[j] += 1
lsp[i] = v
print(cnt)