結果
問題 | No.326 あみだますたー |
ユーザー |
![]() |
提出日時 | 2015-12-19 16:13:50 |
言語 | Python2 (2.7.18) |
結果 |
WA
|
実行時間 | - |
コード長 | 255 bytes |
コンパイル時間 | 248 ms |
コンパイル使用メモリ | 7,040 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-16 16:07:23 |
合計ジャッジ時間 | 4,125 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 2 |
other | AC * 7 WA * 19 |
ソースコード
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=1 while i<=N: p=I.index(A[i]) while i<p:q=p-1;a+=[(q,p)];I[q],I[p]=I[p],I[q];p=q i+=1 print len(a) for x,y in a:print x,y