結果
| 問題 | No.152 貯金箱の消失 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-07-09 16:24:57 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 114 ms / 5,000 ms |
| コード長 | 321 bytes |
| 記録 | |
| コンパイル時間 | 343 ms |
| コンパイル使用メモリ | 85,248 KB |
| 実行使用メモリ | 61,056 KB |
| 最終ジャッジ日時 | 2026-06-04 14:59:42 |
| 合計ジャッジ時間 | 2,165 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 12 |
ソースコード
from math import gcd
l = int(input()) // 4
lst = []
m = 2
ans = 0
while 1:
if 2 * m * (m + 1) >= l:
break
n = 1
while n < m and 2 * m * (m + n) <= l:
a, b, c = m * m - n * n, 2 * m * n, m * m + n * n
if gcd(gcd(a, b), c) == 1:
ans += 1
n += 1
m += 1
print(ans)