結果

問題 No.152 貯金箱の消失
ユーザー H3PO4H3PO4
提出日時 2020-05-06 23:16:10
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 739 ms / 5,000 ms
コード長 283 bytes
コンパイル時間 74 ms
コンパイル使用メモリ 10,584 KB
実行使用メモリ 7,988 KB
最終ジャッジ日時 2023-09-16 07:37:29
合計ジャッジ時間 10,251 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 725 ms
7,960 KB
testcase_01 AC 711 ms
7,980 KB
testcase_02 AC 712 ms
7,988 KB
testcase_03 AC 718 ms
7,924 KB
testcase_04 AC 717 ms
7,928 KB
testcase_05 AC 725 ms
7,904 KB
testcase_06 AC 718 ms
7,908 KB
testcase_07 AC 725 ms
7,892 KB
testcase_08 AC 739 ms
7,956 KB
testcase_09 AC 734 ms
7,904 KB
testcase_10 AC 731 ms
7,964 KB
testcase_11 AC 719 ms
7,932 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import gcd

L = int(input())
MOD = 1000003
ans = 0
for m in range(2, 2000):
    for n in range(m % 2 + 1, m, 2):
        if gcd(m, n) != 1:
            continue
        if (abs(m ** 2 - n ** 2) + 2 * m * n + m ** 2 + n ** 2) * 4 <= L:
            ans += 1
print(ans % MOD)
0