結果

問題 No.397 NO MORE KADOMATSU
ユーザー pluto77pluto77
提出日時 2016-10-27 10:29:38
言語 Python2
(2.7.18)
結果
AC  
実行時間 49 ms / 2,000 ms
コード長 253 bytes
コンパイル時間 68 ms
コンパイル使用メモリ 6,660 KB
実行使用メモリ 24,324 KB
平均クエリ数 936.56
最終ジャッジ日時 2023-09-24 00:39:59
合計ジャッジ時間 1,811 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
23,352 KB
testcase_01 AC 29 ms
24,228 KB
testcase_02 AC 30 ms
23,904 KB
testcase_03 AC 29 ms
24,240 KB
testcase_04 AC 27 ms
23,616 KB
testcase_05 AC 31 ms
24,000 KB
testcase_06 AC 31 ms
23,616 KB
testcase_07 AC 34 ms
23,892 KB
testcase_08 AC 29 ms
24,324 KB
testcase_09 AC 28 ms
23,904 KB
testcase_10 AC 49 ms
24,204 KB
testcase_11 AC 28 ms
24,012 KB
testcase_12 AC 38 ms
23,328 KB
testcase_13 AC 40 ms
24,216 KB
testcase_14 AC 39 ms
23,796 KB
testcase_15 AC 39 ms
23,976 KB
testcase_16 AC 27 ms
23,616 KB
testcase_17 AC 27 ms
23,796 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki_397
import sys

n=int(raw_input())
a=map(int,raw_input().split())
cnt=0
l=[]
for i in xrange(n):
 for j in xrange(n-i-1):
  if a[j]>a[j+1]:
   a[j],a[j+1]=a[j+1],a[j]
   cnt+=1
   l+=[[j,j+1]]
print cnt
for x,y in l:
 print x,y
sys.stdout.flush()
0