結果
| 問題 | No.152 貯金箱の消失 |
| コンテスト | |
| ユーザー |
gew1fw
|
| 提出日時 | 2025-06-12 14:21:16 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 106 ms / 5,000 ms |
| + 120µs | |
| コード長 | 415 bytes |
| 記録 | |
| コンパイル時間 | 227 ms |
| コンパイル使用メモリ | 95,340 KB |
| 実行使用メモリ | 83,328 KB |
| 最終ジャッジ日時 | 2026-07-11 11:33:18 |
| 合計ジャッジ時間 | 2,332 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 12 |
ソースコード
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)
gew1fw