結果

問題 No.397 NO MORE KADOMATSU
ユーザー takakintakakin
提出日時 2020-06-09 22:37:25
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 150 ms / 2,000 ms
コード長 311 bytes
コンパイル時間 94 ms
コンパイル使用メモリ 10,904 KB
実行使用メモリ 24,408 KB
平均クエリ数 936.56
最終ジャッジ日時 2023-09-24 02:39:06
合計ジャッジ時間 2,544 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
23,568 KB
testcase_01 AC 40 ms
23,520 KB
testcase_02 AC 39 ms
24,036 KB
testcase_03 AC 45 ms
23,652 KB
testcase_04 AC 38 ms
23,616 KB
testcase_05 AC 46 ms
24,012 KB
testcase_06 AC 58 ms
23,808 KB
testcase_07 AC 66 ms
23,412 KB
testcase_08 AC 42 ms
24,300 KB
testcase_09 AC 38 ms
23,684 KB
testcase_10 AC 150 ms
23,992 KB
testcase_11 AC 37 ms
24,408 KB
testcase_12 AC 83 ms
24,236 KB
testcase_13 AC 106 ms
24,012 KB
testcase_14 AC 109 ms
24,320 KB
testcase_15 AC 106 ms
24,212 KB
testcase_16 AC 37 ms
24,312 KB
testcase_17 AC 37 ms
24,024 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=lambda: sys.stdin.readline().rstrip()
n=int(input())
A=[int(i) for i in input().split()]
Ans=[]
for i in range(n)[::-1]:
  for j in range(i):
    if A[j]>A[j+1]:
      A[j],A[j+1]=A[j+1],A[j]
      Ans.append((j,j+1))
print(len(Ans),flush=True)
for u,v in Ans:
  print(u,v,flush=True)
D=input()
0