結果

問題 No.694 square1001 and Permutation 3
ユーザー MarioMario
提出日時 2018-06-08 23:09:33
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 327 bytes
コンパイル時間 345 ms
コンパイル使用メモリ 10,736 KB
実行使用メモリ 12,580 KB
最終ジャッジ日時 2023-09-13 00:11:46
合計ジャッジ時間 5,165 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,784 KB
testcase_01 AC 15 ms
7,812 KB
testcase_02 AC 15 ms
7,900 KB
testcase_03 TLE -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = [int(input()) for i in range(n)]

for i in range(n):
    v = []

    for j in range(n):
        v.append(a[(i + j) % n])
    cnt = 0

    for i in range(0, n):
        for j in range(0, n-1):
            if v[j] > v[j+1]:
                v[j], v[j+1] = v[j+1], v[j]
                cnt += 1

    print(cnt)
0