結果
| 問題 |
No.693 square1001 and Permutation 2
|
| コンテスト | |
| ユーザー |
yosswi414
|
| 提出日時 | 2018-06-20 00:59:15 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 210 bytes |
| コンパイル時間 | 1,653 ms |
| コンパイル使用メモリ | 160,780 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-06-30 17:21:49 |
| 合計ジャッジ時間 | 2,032 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 2 |
| other | WA * 9 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
int main(){
int A[50] = {0}, N, sum=0;
cin >> N;
sort(A, A+N);
for(int i=1;i<=N;i++)sum+=(int)abs(i-A[i-1]);
cout << sum << endl;
return 0;
}
yosswi414