結果

問題 No.1373 Directed Operations
ユーザー yuruhiyayuruhiya
提出日時 2021-02-06 15:08:51
言語 Ruby
(3.3.0)
結果
AC  
実行時間 637 ms / 2,000 ms
コード長 187 bytes
コンパイル時間 273 ms
コンパイル使用メモリ 11,368 KB
実行使用メモリ 31,940 KB
最終ジャッジ日時 2023-09-15 22:26:54
合計ジャッジ時間 10,019 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
15,056 KB
testcase_01 AC 79 ms
15,320 KB
testcase_02 AC 446 ms
31,744 KB
testcase_03 AC 385 ms
28,296 KB
testcase_04 AC 390 ms
28,540 KB
testcase_05 AC 79 ms
15,156 KB
testcase_06 AC 628 ms
31,628 KB
testcase_07 AC 89 ms
15,428 KB
testcase_08 AC 128 ms
16,092 KB
testcase_09 AC 574 ms
28,968 KB
testcase_10 AC 490 ms
22,276 KB
testcase_11 AC 172 ms
16,820 KB
testcase_12 AC 474 ms
22,156 KB
testcase_13 AC 121 ms
15,648 KB
testcase_14 AC 632 ms
31,940 KB
testcase_15 AC 554 ms
23,696 KB
testcase_16 AC 637 ms
31,936 KB
testcase_17 AC 475 ms
23,316 KB
testcase_18 AC 235 ms
23,104 KB
testcase_19 AC 281 ms
21,564 KB
testcase_20 AC 367 ms
24,484 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

ans = [0] * ~-gets.to_i
gets.split.map(&:to_i).each_with_index.to_a.sort.each_with_index do |(a, j), i|
	puts('NO') + exit if i + 1 < a
	ans[j] = i + 2 - a
end
puts 'YES', ans.join("\n")
0