結果
| 問題 |
No.693 square1001 and Permutation 2
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-01-18 18:14:12 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 279 bytes |
| コンパイル時間 | 288 ms |
| コンパイル使用メモリ | 82,432 KB |
| 実行使用メモリ | 54,016 KB |
| 最終ジャッジ日時 | 2024-11-23 13:24:15 |
| 合計ジャッジ時間 | 1,313 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 6 WA * 3 |
ソースコード
from collections import defaultdict
n=int(input())
a=list(map(int,input().split()))
d=defaultdict(int)
for i in a:
d[i]+=1
cnt_in=0
cnt_out=0
for i in range(1,n+1):
if d[i]>0:
cnt_in+=i
else:
cnt_out+=i
g=sum(a)
ans=abs(g-(cnt_in+cnt_out))
print(ans)