結果
問題 |
No.326 あみだますたー
|
ユーザー |
![]() |
提出日時 | 2025-02-04 21:02:01 |
言語 | PyPy3 (7.3.15) |
結果 |
MLE
|
実行時間 | - |
コード長 | 382 bytes |
コンパイル時間 | 775 ms |
コンパイル使用メモリ | 82,904 KB |
実行使用メモリ | 78,580 KB |
最終ジャッジ日時 | 2025-02-04 21:02:07 |
合計ジャッジ時間 | 5,279 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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)