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