結果

問題 No.1632 Sorting Integers (GCD of M)
コンテスト
ユーザー rin204
提出日時 2021-07-30 21:00:53
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
MLE  
実行時間 -
コード長 575 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,341 ms
コンパイル使用メモリ 84,480 KB
実行使用メモリ 1,089,520 KB
最終ジャッジ日時 2026-04-05 00:38:40
合計ジャッジ時間 11,752 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 MLE * 1
other AC * 36 WA * 19 OLE * 2 -- * 2
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

n = int(input())
cnt = [0] + list(map(int, input().split()))
tot = 0
two = 8
five = 5
seven = 7
for i, c in enumerate(cnt):
    if c == n:
        print(str(i) * n)
        exit()
    
    tot += i * c
    if c > 0:
        if i == 8:
            pass
        elif i == 4:
            two = min(two, 4)
        elif i == 2:
            two = min(two, 2)
        else:
            two = 1
        if i != 5:
            five = 1
        if i != 7:
            seven = 1
        
ans = two * five * seven
if tot % 9 == 0:
    ans *= 9
elif tot % 3 == 0:
    ans *= 3
print(ans)
0