結果
| 問題 | No.781 円周上の格子点の数え上げ | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2022-06-01 22:45:04 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 1,728 ms / 2,000 ms | 
| コード長 | 637 bytes | 
| コンパイル時間 | 157 ms | 
| コンパイル使用メモリ | 82,304 KB | 
| 実行使用メモリ | 259,224 KB | 
| 最終ジャッジ日時 | 2024-09-21 01:45:19 | 
| 合計ジャッジ時間 | 5,679 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 21 | 
ソースコード
from collections import defaultdict
x, y = map(int, input().split())
ans = 0
Sq = [i**2 for i in range(3201)]
PointCounter = defaultdict(int)
for i in range(3201):
    for j in range(i, 3201):
        if Sq[i] + Sq[j] < x:
            continue
        if Sq[i] + Sq[j] > y:
            break
        if i == j:
            if i == 0:
                continue
            else:
                PointCounter[Sq[i] + Sq[j]] += 4
        else:
            if i == 0:
                PointCounter[Sq[j]] += 4
            else:
                PointCounter[Sq[i] + Sq[j]] += 8
        ans = max(ans, PointCounter[Sq[i] + Sq[j]])
print(ans)
            
            
            
        