結果
問題 |
No.152 貯金箱の消失
|
ユーザー |
|
提出日時 | 2015-02-16 01:40:21 |
言語 | PyPy2 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 295 bytes |
コンパイル時間 | 164 ms |
コンパイル使用メモリ | 77,224 KB |
実行使用メモリ | 85,532 KB |
最終ジャッジ日時 | 2024-06-23 20:38:59 |
合計ジャッジ時間 | 15,876 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 6 TLE * 1 -- * 5 |
ソースコード
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