結果

問題 No.397 NO MORE KADOMATSU
ユーザー TawaraTawara
提出日時 2016-07-20 20:06:37
言語 Python2
(2.7.18)
結果
RE  
実行時間 -
コード長 267 bytes
コンパイル時間 703 ms
コンパイル使用メモリ 6,724 KB
実行使用メモリ 24,408 KB
平均クエリ数 586.17
最終ジャッジ日時 2023-09-23 11:12:06
合計ジャッジ時間 3,842 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
24,048 KB
testcase_01 AC 35 ms
23,832 KB
testcase_02 RE -
testcase_03 RE -
testcase_04 AC 36 ms
23,628 KB
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 AC 35 ms
24,372 KB
testcase_10 AC 35 ms
23,400 KB
testcase_11 AC 36 ms
23,508 KB
testcase_12 AC 43 ms
23,820 KB
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 AC 36 ms
23,412 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from sys import stdout
N = int(raw_input())
A = map(int,raw_input().split())
M = 0
op = []
for i in xrange(N):
	for j in xrange(i+1,N):
		if A[j]>A[j-1]:
			A[j-1],A[j]=A[j],A[j-1]
			M+=1
			op.append([j-1,j])
print M
for u,v in op:
	print u,v
stdout.flush()
input()
0