結果
問題 |
No.326 あみだますたー
|
ユーザー |
|
提出日時 | 2019-11-04 11:39:33 |
言語 | Python2 (2.7.18) |
結果 |
AC
|
実行時間 | 30 ms / 2,000 ms |
コード長 | 342 bytes |
コンパイル時間 | 550 ms |
コンパイル使用メモリ | 6,784 KB |
実行使用メモリ | 6,400 KB |
最終ジャッジ日時 | 2024-09-14 23:38:46 |
合計ジャッジ時間 | 2,609 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 26 |
ソースコード
#yuki326 n=int(raw_input()) k=int(raw_input()) m=[] for i in range(k): x,y=map(int,raw_input().split()) m.append(x) l=map(int,raw_input().split()) for x in m: l[x-1],l[x]=l[x],l[x-1] res=[] for p in range(1,n+1): q=l.index(p) for i in range(q,p-1,-1): res.append(i) l[i-1],l[i]=l[i],l[i-1] print len(res) for i in res: print i,i+1