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