結果

問題 No.619 CardShuffle
ユーザー くれちーくれちー
提出日時 2017-12-12 07:49:37
言語 Ruby
(3.3.0)
結果
TLE  
実行時間 -
コード長 271 bytes
コンパイル時間 50 ms
コンパイル使用メモリ 11,572 KB
実行使用メモリ 22,420 KB
最終ジャッジ日時 2023-08-24 13:54:39
合計ジャッジ時間 6,663 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
22,420 KB
testcase_01 AC 79 ms
15,224 KB
testcase_02 AC 80 ms
15,340 KB
testcase_03 AC 79 ms
15,264 KB
testcase_04 AC 80 ms
15,288 KB
testcase_05 AC 79 ms
15,292 KB
testcase_06 AC 78 ms
15,148 KB
testcase_07 AC 78 ms
15,356 KB
testcase_08 AC 79 ms
15,140 KB
testcase_09 AC 79 ms
15,144 KB
testcase_10 AC 77 ms
15,076 KB
testcase_11 AC 78 ms
15,308 KB
testcase_12 AC 80 ms
15,364 KB
testcase_13 AC 79 ms
15,272 KB
testcase_14 AC 79 ms
15,352 KB
testcase_15 AC 80 ms
15,148 KB
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
        fxy = (eval c[x .. y]) % 1000000007
        puts fxy
    end
end
0