結果
| 問題 | No.152 貯金箱の消失 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-10-31 01:54:22 |
| 言語 | PyPy2 (7.3.20) |
| 結果 |
AC
|
| 実行時間 | 182 ms / 5,000 ms |
| コード長 | 285 bytes |
| 記録 | |
| コンパイル時間 | 563 ms |
| コンパイル使用メモリ | 80,896 KB |
| 実行使用メモリ | 97,920 KB |
| 最終ジャッジ日時 | 2026-05-19 05:22:15 |
| 合計ジャッジ時間 | 3,833 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 12 |
ソースコード
import math
from fractions import gcd
L = input()/4
R = int(math.sqrt(L))+1
ans = 0
for n in xrange(1, R):
for m in xrange(n+1, R, 2):
if gcd(m, n) != 1:
continue
a, b, c = m*m-n*n, 2*m*n, m*m+n*n
if a+b+c <= L:
ans += 1
print ans