結果

問題 No.397 NO MORE KADOMATSU
ユーザー hanorverhanorver
提出日時 2016-09-07 17:39:48
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 62 ms / 2,000 ms
コード長 221 bytes
コンパイル時間 376 ms
コンパイル使用メモリ 10,644 KB
実行使用メモリ 24,520 KB
平均クエリ数 936.56
最終ジャッジ日時 2023-09-24 00:30:45
合計ジャッジ時間 2,116 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
23,496 KB
testcase_01 AC 38 ms
23,952 KB
testcase_02 AC 38 ms
23,732 KB
testcase_03 AC 39 ms
23,484 KB
testcase_04 AC 37 ms
24,036 KB
testcase_05 AC 39 ms
23,672 KB
testcase_06 AC 42 ms
24,016 KB
testcase_07 AC 42 ms
23,964 KB
testcase_08 AC 37 ms
24,024 KB
testcase_09 AC 38 ms
23,364 KB
testcase_10 AC 62 ms
24,520 KB
testcase_11 AC 37 ms
23,580 KB
testcase_12 AC 45 ms
24,100 KB
testcase_13 AC 47 ms
24,208 KB
testcase_14 AC 51 ms
24,432 KB
testcase_15 AC 49 ms
24,020 KB
testcase_16 AC 37 ms
23,576 KB
testcase_17 AC 36 ms
23,992 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

input()
a=list(map(int,input().split()))
l=[]
for i in range(len(a)):
 for j in range(len(a)-i-1):
  if a[j]>a[j+1]:l+=[j,j+1];a[j],a[j+1]=a[j+1],a[j]
print(len(l)//2)
for i in range(0,len(l),2):print(l[i],l[i+1])
input()
0