結果

問題 No.123 カードシャッフル
ユーザー HKDnetHKDnet
提出日時 2015-01-12 00:29:07
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 272 bytes
コンパイル時間 243 ms
コンパイル使用メモリ 11,348 KB
実行使用メモリ 22,560 KB
最終ジャッジ日時 2023-09-04 04:45:08
合計ジャッジ時間 2,322 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
15,044 KB
testcase_01 AC 79 ms
15,136 KB
testcase_02 AC 79 ms
15,160 KB
testcase_03 AC 77 ms
15,280 KB
testcase_04 AC 82 ms
15,040 KB
testcase_05 AC 79 ms
15,324 KB
testcase_06 WA -
testcase_07 AC 80 ms
15,036 KB
testcase_08 AC 79 ms
15,180 KB
testcase_09 AC 79 ms
15,128 KB
testcase_10 AC 127 ms
22,236 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

gets # 不要なので捨て
shuffles = gets.chomp.split.map{|str| str.to_i}
target = 1
shuffles.reverse.each {|tmp|
  if target == 1
    target = tmp
    next
  end
  if tmp < target
    next
  elsif tmp > target
    target -= 1
  else
    target = 1
  end
}
puts target
0