結果
| 問題 |
No.781 円周上の格子点の数え上げ
|
| コンテスト | |
| ユーザー |
ntuda
|
| 提出日時 | 2025-01-16 19:54:21 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 396 bytes |
| コンパイル時間 | 534 ms |
| コンパイル使用メモリ | 82,388 KB |
| 実行使用メモリ | 386,272 KB |
| 最終ジャッジ日時 | 2025-01-16 19:54:50 |
| 合計ジャッジ時間 | 27,178 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 13 TLE * 8 |
ソースコード
from bisect import *
from collections import defaultdict
dic = defaultdict(int)
X,Y = map(int,input().split())
r = int(Y ** 0.5) + 1
for i in range(r):
for j in range(1,r):
dic[i**2 + j**2] += 1
KV = list(dic.items())
KV.sort()
K = []
V = []
for k,v in KV:
K.append(k)
V.append(v)
x = bisect_left(K,X)
y = bisect(K,Y)
if x == y:
print(0)
else:
print(max(V[x:y]) * 4)
ntuda