結果

問題 No.365 ジェンガソート
ユーザー UEUEUE66
提出日時 2019-07-17 17:23:03
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 405 bytes
コンパイル時間 182 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 31,276 KB
最終ジャッジ日時 2024-12-22 21:43:06
合計ジャッジ時間 74,059 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 11 WA * 6 TLE * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

def insertion_sort(n, a, c):
    for i in range(n):
        flag = 0
        for j in reversed(range(i)):
            if a[j] > a[j + 1]:
                a[j], a[j + 1] = a[j + 1], a[j]
                flag = 1
            else:
                break
        if flag == 1:
            c += 1
    return c


N = int(input())
A = list(map(int, input().split()))
count = 0

print(insertion_sort(N, A, count))
0