結果
| 問題 | No.429 CupShuffle |
| コンテスト | |
| ユーザー |
neko_the_shadow
|
| 提出日時 | 2016-10-03 00:31:47 |
| 言語 | Ruby (3.4.1) |
| 結果 |
AC
|
| 実行時間 | 360 ms / 2,000 ms |
| コード長 | 432 bytes |
| 記録 | |
| コンパイル時間 | 226 ms |
| コンパイル使用メモリ | 7,424 KB |
| 実行使用メモリ | 27,264 KB |
| 最終ジャッジ日時 | 2024-12-26 06:43:05 |
| 合計ジャッジ時間 | 3,855 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 16 |
コンパイルメッセージ
Syntax OK
ソースコード
def f(cups, logs)
logs.each{|x, y| cups[x - 1], cups[y - 1] = cups[y - 1], cups[x - 1]}
end
n, k, x = gets.split.map(&:to_i)
ls = (1..k).each_with_object([]){|_, arr| arr << gets.split.map(&:to_i)}
before = ls[0, x - 1]
after = ls[x..-1].reverse
start = (1..n).to_a; f(start, before)
answer = gets.split.map(&:to_i); f(answer, after)
puts (0...n).each_with_object([]){|i, arr| arr << i + 1 if start[i] != answer[i]}.join("\s")
neko_the_shadow