結果

問題 No.365 ジェンガソート
コンテスト
ユーザー 1235486527
提出日時 2019-11-30 19:06:01
言語 Python3
(3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
WA  
実行時間 -
コード長 361 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 53 ms
コンパイル使用メモリ 14,848 KB
実行使用メモリ 20,152 KB
最終ジャッジ日時 2026-09-27 08:10:06
合計ジャッジ時間 7,065 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge4_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10 WA * 7 TLE * 1 -- * 23
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

def count_sort(L):
    S = set()
    for i, left in enumerate(L):
        if left in S:
            continue
        for right in L[i:]:
            if left > right:
                S.add(right)
    count = len(S)
    if L[0] < L[-1] and L[-1] in S:
        count += 1
    return count

N = int(input())
a = list(map(int, input().split()))

print(count_sort(a))
0