結果

問題 No.781 円周上の格子点の数え上げ
ユーザー 👑 CleyL
提出日時 2023-03-28 15:25:18
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 134 ms / 2,000 ms
コード長 328 bytes
コンパイル時間 816 ms
コンパイル使用メモリ 70,324 KB
最終ジャッジ日時 2025-02-11 18:50:59
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <map>
using namespace std;
int A[10000010];
int main(){
  int x,y;cin>>x>>y;
  for(int i = 1; 4000 > i; i++){
    for(int j = 0; 4000 > j; j++){
      if(x <= i*i+j*j && i*i+j*j <= y)A[i*i+j*j]++;
    }
  }
  int ans = 0;
  for(int i = x; y >= i; i++)ans = max(ans,A[i]);
  cout << ans*4 << endl;
}
0