結果
問題 | No.326 あみだますたー |
ユーザー |
![]() |
提出日時 | 2015-12-19 16:55:45 |
言語 | Python2 (2.7.18) |
結果 |
AC
|
実行時間 | 31 ms / 2,000 ms |
コード長 | 261 bytes |
コンパイル時間 | 100 ms |
コンパイル使用メモリ | 7,040 KB |
実行使用メモリ | 6,656 KB |
最終ジャッジ日時 | 2024-11-07 23:22:41 |
合計ジャッジ時間 | 1,829 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 26 |
ソースコード
f=lambda:map(int,raw_input().split())N=input();a=[];I=range(N+1)for i in xrange(input()):x,y=f();I[x],I[y]=I[y],I[x]A=[0]+f();i=1while i<=N:p=I.index(A.index(i))while i<p:q=p-1;a+=[(q,p)];I[q],I[p]=I[p],I[q];p=qi+=1print len(a)for x,y in a:print x,y