結果

問題 No.152 貯金箱の消失
ユーザー gew1fw
提出日時 2025-06-12 14:21:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 87 ms / 5,000 ms
コード長 415 bytes
コンパイル時間 185 ms
コンパイル使用メモリ 82,732 KB
実行使用メモリ 63,196 KB
最終ジャッジ日時 2025-06-12 14:21:42
合計ジャッジ時間 1,544 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

L = int(input())
count = 0
if L < 8:
    print(0)
else:
    m_max = int((L // 8) ** 0.5)
    for m in range(2, m_max + 1):
        for n in range(1, m):
            if math.gcd(m, n) != 1:
                continue
            if (m % 2) == (n % 2):
                continue
            d = 8 * m * (m + n)
            if d > L:
                continue
            count += 1
    print(count % 1000003)
0