結果

問題 No.781 円周上の格子点の数え上げ
ユーザー Navier_BoltzmannNavier_Boltzmann
提出日時 2023-12-31 13:52:36
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 260 ms / 2,000 ms
コード長 514 bytes
コンパイル時間 5,643 ms
コンパイル使用メモリ 308,144 KB
実行使用メモリ 81,420 KB
最終ジャッジ日時 2023-12-31 13:52:47
合計ジャッジ時間 9,996 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
81,420 KB
testcase_01 AC 78 ms
81,420 KB
testcase_02 AC 79 ms
81,420 KB
testcase_03 AC 79 ms
81,420 KB
testcase_04 AC 78 ms
81,420 KB
testcase_05 AC 78 ms
81,420 KB
testcase_06 AC 78 ms
81,420 KB
testcase_07 AC 78 ms
81,420 KB
testcase_08 AC 260 ms
81,420 KB
testcase_09 AC 233 ms
81,420 KB
testcase_10 AC 79 ms
81,420 KB
testcase_11 AC 78 ms
81,420 KB
testcase_12 AC 238 ms
81,420 KB
testcase_13 AC 240 ms
81,420 KB
testcase_14 AC 81 ms
81,420 KB
testcase_15 AC 77 ms
81,420 KB
testcase_16 AC 78 ms
81,420 KB
testcase_17 AC 164 ms
81,420 KB
testcase_18 AC 162 ms
81,420 KB
testcase_19 AC 157 ms
81,420 KB
testcase_20 AC 186 ms
81,420 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>


using namespace std;
using namespace atcoder;
#define rep(i,m,n) for (int i = (int)(m); i < (int)(n); i++)
#define ll long long

int main(){

    ll x,y;
    cin >> x >> y ;
    vector<ll> m(10000001);
    ll v;
    rep(i,-3163,3163){
        rep(j,-3163,3163){
            v = i*i + j*j;
            if (v<=y){
            m[v]++;
            }}
    }
    ll ans = 0;
    rep(i,x,y+1){
        ans = max(ans,m[i]);
    };
    cout << ans << endl;
    return 0;

}
0