結果
| 問題 | No.693 square1001 and Permutation 2 |
| コンテスト | |
| ユーザー |
turner18_jp
|
| 提出日時 | 2018-10-23 19:44:00 |
| 言語 | Python3 (3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 21 ms / 2,000 ms |
| + 207µs | |
| コード長 | 272 bytes |
| 記録 | |
| コンパイル時間 | 63 ms |
| コンパイル使用メモリ | 15,104 KB |
| 実行使用メモリ | 11,008 KB |
| 最終ジャッジ日時 | 2026-09-26 12:33:24 |
| 合計ジャッジ時間 | 1,382 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 9 |
ソースコード
n = int(input())
a = sorted(list(map(int, input().split())))
b, c = [], []
d = set(a)
ans = 0
nums = [i for i in range(1, 51) if not i in d]
for i in a:
if i in b:
c.append(i)
else:
b.append(i)
for i in range(len(c)):
ans += abs(nums[i] - c[i])
print(ans)
turner18_jp