結果

問題 No.429 CupShuffle
ユーザー hogeover30hogeover30
提出日時 2017-01-04 23:16:25
言語 Ruby
(3.2.2)
結果
AC  
実行時間 272 ms / 2,000 ms
コード長 166 bytes
コンパイル時間 140 ms
コンパイル使用メモリ 11,300 KB
実行使用メモリ 46,896 KB
最終ジャッジ日時 2023-08-25 01:46:31
合計ジャッジ時間 3,373 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
外部呼び出し有り
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
14,960 KB
testcase_01 AC 84 ms
15,068 KB
testcase_02 AC 84 ms
15,044 KB
testcase_03 AC 86 ms
15,112 KB
testcase_04 AC 85 ms
15,220 KB
testcase_05 AC 84 ms
15,072 KB
testcase_06 AC 88 ms
15,304 KB
testcase_07 AC 87 ms
15,256 KB
testcase_08 AC 83 ms
15,284 KB
testcase_09 AC 86 ms
15,072 KB
testcase_10 AC 105 ms
18,136 KB
testcase_11 AC 270 ms
45,900 KB
testcase_12 AC 267 ms
46,008 KB
testcase_13 AC 269 ms
45,224 KB
testcase_14 AC 272 ms
46,896 KB
testcase_15 AC 84 ms
15,092 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

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