結果

問題 No.693 square1001 and Permutation 2
ユーザー maspymaspy
提出日時 2020-01-19 02:47:36
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 140 ms / 2,000 ms
コード長 269 bytes
コンパイル時間 320 ms
コンパイル使用メモリ 10,576 KB
実行使用メモリ 29,840 KB
最終ジャッジ日時 2023-09-11 03:26:55
合計ジャッジ時間 3,297 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 139 ms
29,720 KB
testcase_01 AC 140 ms
29,804 KB
testcase_02 AC 140 ms
29,644 KB
testcase_03 AC 138 ms
29,840 KB
testcase_04 AC 137 ms
29,756 KB
testcase_05 AC 139 ms
29,588 KB
testcase_06 AC 139 ms
29,640 KB
testcase_07 AC 139 ms
29,780 KB
testcase_08 AC 138 ms
29,764 KB
testcase_09 AC 138 ms
29,772 KB
testcase_10 AC 138 ms
29,704 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

import numpy as np

N = int(readline())
A = np.array(read().split(),np.int64)

A.sort()
x = np.arange(1,N+1) - A

answer = np.abs(x).sum()
print(answer)
0