結果
| 問題 |
No.326 あみだますたー
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-06-28 17:25:53 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 468 bytes |
| コンパイル時間 | 122 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 11,264 KB |
| 最終ジャッジ日時 | 2024-10-11 23:29:01 |
| 合計ジャッジ時間 | 4,989 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 2 |
| other | AC * 7 WA * 19 |
ソースコード
#!/usr/bin/env python3
n = int(input())
f = list(range(1,n+1))
for _ in range(int(input())):
x, y = map(int,input().split())
x -= 1
y -= 1
f[x], f[y] = f[y], f[x]
sigma = list(map(int,input().split()))
for i in range(n):
f[i] = sigma.index(f[i])
ans = []
for i in range(n):
for j in range(n-1):
if f[j] > f[j+1]:
f[j], f[j+1] = f[j+1], f[j]
ans += [(j, j+1)]
print(len(ans))
for x, y in ans:
print(x+1, y+1)