結果

問題 No.397 NO MORE KADOMATSU
ユーザー hanorverhanorver
提出日時 2016-09-07 17:45:40
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 197 bytes
コンパイル時間 90 ms
コンパイル使用メモリ 10,724 KB
実行使用メモリ 24,504 KB
平均クエリ数 1.00
最終ジャッジ日時 2023-09-23 11:30:44
合計ジャッジ時間 3,805 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 AC 41 ms
23,396 KB
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 AC 39 ms
24,060 KB
testcase_10 RE -
testcase_11 AC 39 ms
23,432 KB
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 AC 39 ms
24,016 KB
testcase_17 AC 37 ms
24,048 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]];swap(a[j],a[j+1])
 i+=1
print(len(l))
for i in l:print(i[0],i[1])
input()
0