結果

問題 No.429 CupShuffle
ユーザー hogeover30hogeover30
提出日時 2017-01-04 22:21:47
言語 Ruby
(3.2.2)
結果
AC  
実行時間 275 ms / 2,000 ms
コード長 173 bytes
コンパイル時間 421 ms
コンパイル使用メモリ 11,292 KB
実行使用メモリ 47,080 KB
最終ジャッジ日時 2023-08-25 03:19:07
合計ジャッジ時間 3,726 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
外部呼び出し有り
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
15,044 KB
testcase_01 AC 79 ms
15,160 KB
testcase_02 AC 82 ms
15,260 KB
testcase_03 AC 83 ms
15,244 KB
testcase_04 AC 87 ms
15,132 KB
testcase_05 AC 82 ms
15,024 KB
testcase_06 AC 85 ms
15,120 KB
testcase_07 AC 83 ms
15,304 KB
testcase_08 AC 81 ms
15,316 KB
testcase_09 AC 83 ms
15,028 KB
testcase_10 AC 103 ms
18,148 KB
testcase_11 AC 275 ms
47,004 KB
testcase_12 AC 265 ms
46,684 KB
testcase_13 AC 269 ms
47,080 KB
testcase_14 AC 267 ms
45,936 KB
testcase_15 AC 80 ms
15,272 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n,k,x,*t=`dd`.split.map &:to_i
c=0,*t.pop(n)
s=*0..n
f=->v,m{m.times{|i|a,b=t[i*2,2];v[a],v[b]=v[b],v[a]}}
f[s,x-1]
t.reverse!
f[c,k-x]
puts (1..n).select{|i|c[i]!=s[i]}*' '
0