結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
24,192 KB
testcase_01 AC 37 ms
23,564 KB
testcase_02 AC 38 ms
23,808 KB
testcase_03 AC 39 ms
24,024 KB
testcase_04 AC 39 ms
23,716 KB
testcase_05 AC 39 ms
24,204 KB
testcase_06 AC 43 ms
24,084 KB
testcase_07 AC 46 ms
24,000 KB
testcase_08 AC 39 ms
24,204 KB
testcase_09 AC 39 ms
24,036 KB
testcase_10 AC 66 ms
24,416 KB
testcase_11 AC 39 ms
23,748 KB
testcase_12 AC 48 ms
24,468 KB
testcase_13 AC 52 ms
24,256 KB
testcase_14 AC 55 ms
24,192 KB
testcase_15 AC 53 ms
24,828 KB
testcase_16 AC 38 ms
23,492 KB
testcase_17 AC 38 ms
23,616 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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