結果
問題 |
No.781 円周上の格子点の数え上げ
|
ユーザー |
![]() |
提出日時 | 2019-01-11 22:13:15 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 396 bytes |
コンパイル時間 | 220 ms |
コンパイル使用メモリ | 82,688 KB |
実行使用メモリ | 77,440 KB |
最終ジャッジ日時 | 2024-11-30 08:10:45 |
合計ジャッジ時間 | 10,343 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 16 WA * 2 TLE * 3 |
ソースコード
import bisect X,Y = map(int,input().split()) arr = [] a = 1 while a*a <= Y: arr.append(a*a) a += 1 def calc(n): ret = 0 for a in arr: i = bisect.bisect_left(arr, n-a) j = bisect.bisect(arr, n-a) ret += j-i if n**0.5 == int(n**0.5): ret += 1 return ret * 4 ans = 0 for n in range(max(X,Y-2000),Y+1): ans = max(ans, calc(n)) print(ans)