結果

問題 No.123 カードシャッフル
ユーザー finefine
提出日時 2015-10-14 00:03:45
言語 Ruby
(3.3.0)
結果
AC  
実行時間 140 ms / 5,000 ms
コード長 173 bytes
コンパイル時間 441 ms
コンパイル使用メモリ 11,432 KB
実行使用メモリ 21,700 KB
最終ジャッジ日時 2023-09-28 13:01:54
合計ジャッジ時間 2,523 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
15,220 KB
testcase_01 AC 81 ms
15,248 KB
testcase_02 AC 81 ms
15,204 KB
testcase_03 AC 81 ms
15,152 KB
testcase_04 AC 81 ms
15,132 KB
testcase_05 AC 82 ms
15,152 KB
testcase_06 AC 81 ms
15,112 KB
testcase_07 AC 81 ms
15,112 KB
testcase_08 AC 83 ms
15,216 KB
testcase_09 AC 80 ms
15,116 KB
testcase_10 AC 139 ms
21,440 KB
testcase_11 AC 139 ms
21,700 KB
testcase_12 AC 139 ms
21,456 KB
testcase_13 AC 140 ms
21,608 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n,m = gets.chomp.split(" ").map(&:to_i)
shuffle = gets.chomp.split(" ").map(&:to_i)
cards = [*1..n]
m.times{|i|
	cards.unshift(cards.slice!(shuffle[i] - 1))
}

puts cards[0]
0