結果

問題 No.429 CupShuffle
ユーザー hogeover30hogeover30
提出日時 2017-01-04 22:42:40
言語 Ruby
(3.3.0)
結果
AC  
実行時間 266 ms / 2,000 ms
コード長 168 bytes
コンパイル時間 48 ms
コンパイル使用メモリ 11,548 KB
実行使用メモリ 47,052 KB
最終ジャッジ日時 2023-08-25 03:10:55
合計ジャッジ時間 3,432 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
外部呼び出し有り
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
15,248 KB
testcase_01 AC 81 ms
15,152 KB
testcase_02 AC 82 ms
15,140 KB
testcase_03 AC 81 ms
15,056 KB
testcase_04 AC 83 ms
15,036 KB
testcase_05 AC 79 ms
15,368 KB
testcase_06 AC 82 ms
15,332 KB
testcase_07 AC 85 ms
15,056 KB
testcase_08 AC 80 ms
15,092 KB
testcase_09 AC 83 ms
15,100 KB
testcase_10 AC 100 ms
18,068 KB
testcase_11 AC 265 ms
45,904 KB
testcase_12 AC 261 ms
45,948 KB
testcase_13 AC 264 ms
45,676 KB
testcase_14 AC 266 ms
47,052 KB
testcase_15 AC 82 ms
15,256 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]
$><<(1..n).select{|i|c[i]!=s[i]}*' '
0