結果

問題 No.1628 Sorting Integers (MAX of M)
ユーザー wesoweeenwesoweeen
提出日時 2021-08-01 18:53:31
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 17 ms / 2,000 ms
コード長 308 bytes
コンパイル時間 357 ms
コンパイル使用メモリ 10,544 KB
実行使用メモリ 7,972 KB
最終ジャッジ日時 2023-10-14 19:00:03
合計ジャッジ時間 1,334 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,972 KB
testcase_01 AC 16 ms
7,856 KB
testcase_02 AC 17 ms
7,844 KB
testcase_03 AC 16 ms
7,740 KB
testcase_04 AC 16 ms
7,748 KB
testcase_05 AC 17 ms
7,892 KB
testcase_06 AC 17 ms
7,776 KB
testcase_07 AC 16 ms
7,820 KB
testcase_08 AC 16 ms
7,860 KB
testcase_09 AC 16 ms
7,812 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    N = int(input())
    C = list(map(int, input().split()))
    nums = []
    for i, c in enumerate(C):
        if c > 0:
            for _ in range(c):
                nums.append(i + 1)

    n = sorted(nums, reverse=True)
    print(''.join(map(str, n)))

if __name__ == '__main__':
    main()
0