結果

問題 No.152 貯金箱の消失
ユーザー yuppe19 😺yuppe19 😺
提出日時 2015-04-16 22:36:14
言語 Python2
(2.7.18)
結果
AC  
実行時間 167 ms / 5,000 ms
コード長 267 bytes
コンパイル時間 78 ms
コンパイル使用メモリ 6,492 KB
実行使用メモリ 8,200 KB
最終ジャッジ日時 2023-09-17 20:59:03
合計ジャッジ時間 1,846 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 24 ms
8,188 KB
testcase_01 AC 23 ms
8,004 KB
testcase_02 AC 23 ms
8,200 KB
testcase_03 AC 23 ms
7,952 KB
testcase_04 AC 25 ms
8,152 KB
testcase_05 AC 24 ms
8,004 KB
testcase_06 AC 26 ms
8,004 KB
testcase_07 AC 45 ms
7,980 KB
testcase_08 AC 165 ms
8,008 KB
testcase_09 AC 167 ms
8,004 KB
testcase_10 AC 134 ms
8,152 KB
testcase_11 AC 86 ms
7,976 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/python
from fractions import gcd

L = int(raw_input())
res = 0
M = int((L/8)**.5)
for n in xrange(1, M+1):
    for m in xrange(n+1, M+1, 2):
        if gcd(m, n) == 1:
            if 8 * m * (m + n) > L:
                break
            res += 1
print res
0