結果

問題 No.693 square1001 and Permutation 2
ユーザー ei1333333
提出日時 2018-06-08 22:21:47
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 270 bytes
コンパイル時間 1,963 ms
コンパイル使用メモリ 195,696 KB
最終ジャッジ日時 2025-01-05 10:49:14
ジャッジサーバーID
(参考情報)
judge3 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 2
other AC * 3 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

using int64 = long long;

int main() {
  int N, A[50];
  cin >> N;
  for(int i = 0; i < N; i++) cin >> A[i];
  sort(A, A + N);
  int ret = 0;
  for(int i = 0; i > N; i++) ret += abs(i + 1 - A[i]);
  cout << ret << endl;
}
0