結果

問題 No.152 貯金箱の消失
ユーザー pluto77pluto77
提出日時 2016-03-13 09:17:35
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 131 ms / 5,000 ms
コード長 315 bytes
コンパイル時間 2,228 ms
コンパイル使用メモリ 77,560 KB
実行使用メモリ 79,072 KB
最終ジャッジ日時 2023-10-26 03:17:46
合計ジャッジ時間 3,792 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
76,308 KB
testcase_01 AC 76 ms
76,308 KB
testcase_02 AC 76 ms
76,308 KB
testcase_03 AC 77 ms
76,308 KB
testcase_04 AC 87 ms
78,524 KB
testcase_05 AC 86 ms
78,524 KB
testcase_06 AC 90 ms
78,524 KB
testcase_07 AC 96 ms
79,032 KB
testcase_08 AC 131 ms
79,068 KB
testcase_09 AC 129 ms
79,072 KB
testcase_10 AC 119 ms
78,888 KB
testcase_11 AC 105 ms
79,060 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# 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