結果
| 問題 |
No.326 あみだますたー
|
| コンテスト | |
| ユーザー |
ntuda
|
| 提出日時 | 2025-02-04 21:20:58 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 382 bytes |
| コンパイル時間 | 624 ms |
| コンパイル使用メモリ | 82,560 KB |
| 実行使用メモリ | 78,592 KB |
| 最終ジャッジ日時 | 2025-02-04 21:21:07 |
| 合計ジャッジ時間 | 5,851 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 5 MLE * 21 |
ソースコード
N = int(input())
K = int(input())
XY = [list(map(int,input().split())) for _ in range(K)]
A = list(map(int,input().split()))
for x,y in XY:
x -= 1
y -= 1
A[x],A[y] = A[y],A[x]
ans = []
for i in range(1,N+1):
x = A.index(i)
while x >= i:
A[x-1],A[x] = A[x],A[x-1]
ans.append((x,x + 1))
x -= 1
print(len(ans))
for a in ans:
print(*a)
ntuda