結果

問題 No.123 カードシャッフル
ユーザー LeonardoneLeonardone
提出日時 2015-10-16 22:16:36
言語 Ruby
(3.3.0)
結果
AC  
実行時間 565 ms / 5,000 ms
コード長 250 bytes
コンパイル時間 54 ms
コンパイル使用メモリ 11,292 KB
実行使用メモリ 21,820 KB
最終ジャッジ日時 2023-09-28 23:59:49
合計ジャッジ時間 3,160 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
15,272 KB
testcase_01 AC 80 ms
15,200 KB
testcase_02 AC 81 ms
15,336 KB
testcase_03 AC 81 ms
15,120 KB
testcase_04 AC 81 ms
15,112 KB
testcase_05 AC 81 ms
15,288 KB
testcase_06 AC 81 ms
15,032 KB
testcase_07 AC 81 ms
15,280 KB
testcase_08 AC 81 ms
15,304 KB
testcase_09 AC 82 ms
15,116 KB
testcase_10 AC 142 ms
21,576 KB
testcase_11 AC 565 ms
21,820 KB
testcase_12 AC 356 ms
21,588 KB
testcase_13 AC 357 ms
21,760 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

#! ruby
# yukicoder My Practice
# author: Leornadone @ NEETSDKASU

(N, M), A = $<.map{|x| x.chomp.split.map(&:to_i)}

cards = (0..N).to_a

M.times do |i|
	cards[0] = cards[A[i]]
	A[i].downto(1) do |j|
		cards[j] = cards[j - 1]
	end
end

puts cards[1]
0