結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
23,576 KB
testcase_01 AC 39 ms
23,592 KB
testcase_02 AC 40 ms
23,444 KB
testcase_03 AC 42 ms
23,616 KB
testcase_04 AC 41 ms
23,784 KB
testcase_05 AC 42 ms
23,604 KB
testcase_06 AC 44 ms
23,764 KB
testcase_07 AC 45 ms
24,448 KB
testcase_08 AC 41 ms
23,488 KB
testcase_09 AC 40 ms
23,964 KB
testcase_10 AC 66 ms
24,536 KB
testcase_11 AC 40 ms
23,440 KB
testcase_12 AC 49 ms
24,212 KB
testcase_13 AC 54 ms
24,504 KB
testcase_14 AC 55 ms
24,380 KB
testcase_15 AC 54 ms
24,656 KB
testcase_16 AC 39 ms
23,952 KB
testcase_17 AC 40 ms
24,324 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

input()
a=list(map(int,input().split()))
c=len(a)
l=[]
for i in range(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]
print(len(l))
for i in l:print(i[0],i[1])
input()
0