結果

問題 No.1628 Sorting Integers (MAX of M)
ユーザー ygd.ygd.
提出日時 2021-07-30 20:33:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 79 ms / 2,000 ms
コード長 285 bytes
コンパイル時間 500 ms
コンパイル使用メモリ 86,728 KB
実行使用メモリ 71,436 KB
最終ジャッジ日時 2023-10-14 02:47:29
合計ジャッジ時間 1,934 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,276 KB
testcase_01 AC 75 ms
71,104 KB
testcase_02 AC 79 ms
71,272 KB
testcase_03 AC 74 ms
70,896 KB
testcase_04 AC 72 ms
71,044 KB
testcase_05 AC 74 ms
71,116 KB
testcase_06 AC 75 ms
71,160 KB
testcase_07 AC 75 ms
71,044 KB
testcase_08 AC 74 ms
71,284 KB
testcase_09 AC 72 ms
71,436 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    N = int(input())
    C = list(map(int,input().split()))
    A = []
    for i in range(9):
        for j in range(C[i]):
            A.append(str(i+1))

    A.sort(reverse=True)
    ans = A[:N]
    ans = "".join(ans)
    print(ans)

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