結果

問題 No.634 硬貨の枚数1
ユーザー GrayCoder
提出日時 2018-01-19 22:52:54
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 342 bytes
コンパイル時間 230 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-12-25 19:37:50
合計ジャッジ時間 4,574 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 9 WA * 66
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    N = int(input())

    n = N
    num = 0
    while 1:
        i = coin(n)
        n -= i
        num += 1
        if not n:
            break
    print(num)

def coin(n):
    i = 1
    while 1:
        k = i * (i + 1) // 2
        if k > n:
            break
        else:
            x = k
        i += 1
    return x

main()
0