結果

問題 No.365 ジェンガソート
ユーザー simansiman
提出日時 2020-10-01 18:40:15
言語 Ruby
(3.3.0)
結果
AC  
実行時間 132 ms / 2,000 ms
コード長 148 bytes
コンパイル時間 238 ms
コンパイル使用メモリ 11,412 KB
実行使用メモリ 21,600 KB
最終ジャッジ日時 2023-09-21 07:02:29
合計ジャッジ時間 5,902 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
15,128 KB
testcase_01 AC 79 ms
15,116 KB
testcase_02 AC 78 ms
15,264 KB
testcase_03 AC 82 ms
15,096 KB
testcase_04 AC 78 ms
15,280 KB
testcase_05 AC 80 ms
15,128 KB
testcase_06 AC 81 ms
15,000 KB
testcase_07 AC 81 ms
15,308 KB
testcase_08 AC 80 ms
15,312 KB
testcase_09 AC 79 ms
15,004 KB
testcase_10 AC 79 ms
15,060 KB
testcase_11 AC 78 ms
15,208 KB
testcase_12 AC 78 ms
15,008 KB
testcase_13 AC 78 ms
14,996 KB
testcase_14 AC 78 ms
15,136 KB
testcase_15 AC 78 ms
15,112 KB
testcase_16 AC 112 ms
19,804 KB
testcase_17 AC 124 ms
21,136 KB
testcase_18 AC 85 ms
15,472 KB
testcase_19 AC 124 ms
20,900 KB
testcase_20 AC 93 ms
17,044 KB
testcase_21 AC 88 ms
16,356 KB
testcase_22 AC 110 ms
19,880 KB
testcase_23 AC 98 ms
17,924 KB
testcase_24 AC 110 ms
19,656 KB
testcase_25 AC 87 ms
16,064 KB
testcase_26 AC 105 ms
18,596 KB
testcase_27 AC 125 ms
21,348 KB
testcase_28 AC 103 ms
18,696 KB
testcase_29 AC 113 ms
20,640 KB
testcase_30 AC 105 ms
19,056 KB
testcase_31 AC 93 ms
16,708 KB
testcase_32 AC 91 ms
16,392 KB
testcase_33 AC 125 ms
21,556 KB
testcase_34 AC 85 ms
15,800 KB
testcase_35 AC 109 ms
19,676 KB
testcase_36 AC 125 ms
21,588 KB
testcase_37 AC 125 ms
21,600 KB
testcase_38 AC 126 ms
21,456 KB
testcase_39 AC 126 ms
21,584 KB
testcase_40 AC 132 ms
21,568 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N = gets.to_i
A = gets.split.map(&:to_i)

ans = 0
cur = N

A.reverse_each do |a|
  if cur == a
    cur -= 1
  else
    ans += 1
  end
end

puts ans
0