結果
問題 | No.693 square1001 and Permutation 2 |
ユーザー |
![]() |
提出日時 | 2018-10-23 19:44:00 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 30 ms / 2,000 ms |
コード長 | 272 bytes |
コンパイル時間 | 101 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-11-19 04:35:16 |
合計ジャッジ時間 | 898 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 9 |
ソースコード
n = int(input())a = sorted(list(map(int, input().split())))b, c = [], []d = set(a)ans = 0nums = [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)