結果
問題 | No.152 貯金箱の消失 |
ユーザー | roiti46 |
提出日時 | 2015-02-16 01:40:21 |
言語 | PyPy2 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 295 bytes |
コンパイル時間 | 1,097 ms |
コンパイル使用メモリ | 77,684 KB |
実行使用メモリ | 83,940 KB |
最終ジャッジ日時 | 2023-09-06 01:34:42 |
合計ジャッジ時間 | 8,270 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 74 ms
76,584 KB |
testcase_01 | AC | 124 ms
79,552 KB |
testcase_02 | AC | 77 ms
76,696 KB |
testcase_03 | AC | 107 ms
79,648 KB |
testcase_04 | TLE | - |
testcase_05 | -- | - |
testcase_06 | -- | - |
testcase_07 | -- | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
testcase_10 | -- | - |
testcase_11 | -- | - |
ソースコード
def gcd(a,b): while b: a,b = b,a%b return a N = int(raw_input()) ans = 0 for a in xrange(3,N/4/2+1): for b in xrange(2,a): c2 = a*a+b*b c = int(c2**0.5) if N-4*(a+b+c) < 0: break if c*c != c2: continue if gcd(a,b) == 1: ans += 1 print ans