結果
| 問題 |
No.693 square1001 and Permutation 2
|
| コンテスト | |
| ユーザー |
neko_the_shadow
|
| 提出日時 | 2019-03-15 18:08:46 |
| 言語 | Ruby (3.4.1) |
| 結果 |
AC
|
| 実行時間 | 91 ms / 2,000 ms |
| コード長 | 108 bytes |
| コンパイル時間 | 43 ms |
| コンパイル使用メモリ | 7,424 KB |
| 実行使用メモリ | 12,288 KB |
| 最終ジャッジ日時 | 2024-07-01 20:03:32 |
| 合計ジャッジ時間 | 1,781 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 9 |
コンパイルメッセージ
Syntax OK
ソースコード
n = gets.to_i
a = gets.split.map(&:to_i).sort
puts a.zip([*1..n]).reduce(0){|sum, (x, y)| sum + (x - y).abs}
neko_the_shadow