結果

問題 No.152 貯金箱の消失
コンテスト
ユーザー pluto77
提出日時 2016-03-13 09:17:35
言語 PyPy2
(7.3.20)
コンパイル:
pypy2 -m py_compile _filename_
実行:
/usr/bin/pypy2 Main.pyc
結果
AC  
実行時間 87 ms / 5,000 ms
コード長 315 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 965 ms
コンパイル使用メモリ 81,152 KB
実行使用メモリ 83,584 KB
最終ジャッジ日時 2026-04-12 15:48:27
合計ジャッジ時間 2,775 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 12
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

# coding: utf-8
#yuki_152
import math

def gcd(a, b):
 while b:
  a, b = b, a % b
 return a

L=int(raw_input())
L=L/4
sq=int(math.sqrt(L))
count=0
for n in xrange(1,sq+1):
 for m in xrange(n+1,sq+1):
  if (m-n)%2==0 or gcd(m,n)!=1:
   continue
  if L>0:
   l=2*m*(m+n)
   if l>L:
    break
   count+=1

print count
0