結果

問題 No.123 カードシャッフル
ユーザー らっしー(raccy)らっしー(raccy)
提出日時 2015-01-12 00:24:46
言語 Ruby
(3.3.0)
結果
AC  
実行時間 220 ms / 5,000 ms
コード長 158 bytes
コンパイル時間 72 ms
コンパイル使用メモリ 11,532 KB
実行使用メモリ 21,524 KB
最終ジャッジ日時 2023-09-04 04:43:11
合計ジャッジ時間 2,737 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 85 ms
15,136 KB
testcase_01 AC 88 ms
15,136 KB
testcase_02 AC 89 ms
15,092 KB
testcase_03 AC 89 ms
15,096 KB
testcase_04 AC 87 ms
15,284 KB
testcase_05 AC 89 ms
15,180 KB
testcase_06 AC 85 ms
15,064 KB
testcase_07 AC 84 ms
15,136 KB
testcase_08 AC 85 ms
15,132 KB
testcase_09 AC 88 ms
15,276 KB
testcase_10 AC 147 ms
21,352 KB
testcase_11 AC 185 ms
21,208 KB
testcase_12 AC 220 ms
21,524 KB
testcase_13 AC 215 ms
21,428 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n, = gets.split.map(&:to_i)
a = gets.split.map(&:to_i)

list = (1..n).to_a

a.each do |i|
  j = list[i-1]
  list.delete(j)
  list.unshift(j)
end
puts list[0]
0