結果

問題 No.123 カードシャッフル
ユーザー nonokai10nonokai10
提出日時 2018-03-12 12:50:52
言語 Ruby
(3.3.0)
結果
AC  
実行時間 240 ms / 5,000 ms
コード長 160 bytes
コンパイル時間 45 ms
コンパイル使用メモリ 7,680 KB
実行使用メモリ 38,400 KB
最終ジャッジ日時 2024-04-25 03:10:58
合計ジャッジ時間 2,619 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
12,288 KB
testcase_01 AC 81 ms
12,160 KB
testcase_02 AC 75 ms
12,288 KB
testcase_03 AC 76 ms
12,416 KB
testcase_04 AC 77 ms
12,416 KB
testcase_05 AC 76 ms
12,160 KB
testcase_06 AC 77 ms
12,160 KB
testcase_07 AC 82 ms
12,288 KB
testcase_08 AC 78 ms
12,416 KB
testcase_09 AC 77 ms
12,288 KB
testcase_10 AC 186 ms
21,504 KB
testcase_11 AC 229 ms
32,896 KB
testcase_12 AC 240 ms
38,400 KB
testcase_13 AC 233 ms
38,400 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:1: warning: assigned but unused variable - m
Syntax OK

ソースコード

diff #

n, m = gets.split.map(&:to_i)
shuffle = gets.split.map(&:to_i)
cards = (1..n).to_a
shuffle.each do |i|
  cards[0..i-1] = cards[0..i-1].rotate(-1)
end
p cards[0]
0