結果
問題 | No.152 貯金箱の消失 |
ユーザー | yaoshimax |
提出日時 | 2015-02-16 00:36:29 |
言語 | Python2 (2.7.18) |
結果 |
WA
|
実行時間 | - |
コード長 | 408 bytes |
コンパイル時間 | 479 ms |
コンパイル使用メモリ | 6,692 KB |
実行使用メモリ | 6,192 KB |
最終ジャッジ日時 | 2023-09-06 01:32:49 |
合計ジャッジ時間 | 5,229 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 11 ms
5,928 KB |
testcase_01 | AC | 12 ms
6,188 KB |
testcase_02 | AC | 11 ms
6,172 KB |
testcase_03 | AC | 12 ms
5,920 KB |
testcase_04 | AC | 23 ms
6,104 KB |
testcase_05 | AC | 24 ms
6,048 KB |
testcase_06 | AC | 34 ms
5,916 KB |
testcase_07 | AC | 174 ms
5,932 KB |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | AC | 491 ms
6,192 KB |
ソースコード
import math L=int(raw_input()) mod=100003 triLen=L/4 def gcd(a,b): if a > b: return gcd(b,a) if b%a==0: return a return gcd(b%a,a) ans = 0 for n in range(1, int(math.sqrt(triLen))+1 ): for m in range(n+1, int(math.sqrt(triLen-n*n))+1 ): if gcd(m,n)==1 and (m-n)%2==1 and 2*m*m+2*m*n<=triLen: #print m*m+n*n,2*m*n,m*m-n*n ans+=1 print ans%mod