結果

問題 No.619 CardShuffle
ユーザー くれちーくれちー
提出日時 2017-12-12 07:46:49
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 240 bytes
コンパイル時間 651 ms
コンパイル使用メモリ 11,352 KB
実行使用メモリ 105,428 KB
最終ジャッジ日時 2023-08-24 13:54:29
合計ジャッジ時間 8,029 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
19,500 KB
testcase_01 AC 79 ms
15,152 KB
testcase_02 AC 78 ms
15,356 KB
testcase_03 AC 78 ms
15,264 KB
testcase_04 AC 79 ms
15,176 KB
testcase_05 WA -
testcase_06 AC 77 ms
15,284 KB
testcase_07 AC 77 ms
15,288 KB
testcase_08 AC 79 ms
15,284 KB
testcase_09 AC 78 ms
15,288 KB
testcase_10 WA -
testcase_11 AC 79 ms
15,172 KB
testcase_12 AC 80 ms
15,308 KB
testcase_13 AC 79 ms
15,308 KB
testcase_14 AC 79 ms
15,348 KB
testcase_15 WA -
testcase_16 TLE -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:1: warning: assigned but unused variable - n
Main.rb:4: warning: assigned but unused variable - i
Syntax OK

ソースコード

diff #

n = gets.to_i
c = gets.chomp.delete(' ')
q = gets.to_i
for i in 1 .. q do
    t, *p = gets.split
    x, y = p.map(&:to_i).map{|n| n - 1}
    if t == "!" then
        c[y], c[x] = c[x], c[y]
    else
        puts (eval c[x .. y])
    end
end
0