結果

問題 No.781 円周上の格子点の数え上げ
ユーザー coco18000
提出日時 2019-01-11 22:02:52
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 615 bytes
コンパイル時間 1,310 ms
コンパイル使用メモリ 165,904 KB
実行使用メモリ 81,152 KB
最終ジャッジ日時 2024-11-30 06:56:14
合計ジャッジ時間 5,547 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10 WA * 3 RE * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

typedef long long int ll;
typedef pair<ll, ll> pll;

#define FOR(i, n, m) for (ll(i) = (m); (i) < (n); ++(i))
#define REP(i, n) FOR(i, n, 0)
#define OF64 std::setprecision(10)

const ll MOD = 1000000007;
const ll INF = (ll)1e15;

ll S[10000005] = {0};

int main()
{
    ll X, Y;
    cin >> X >> Y;

    for (int i = 0; i * i <= Y; ++i)
    {
        for (int j = 0; j * j <= Y; ++j)
        {
            S[i * i + j * j]++;
        }
    }

    ll max = 0;
    FOR(i, Y + 1, X)
    {
        max = std::max(S[i], max);
    }
    cout << max*4 << endl;
    return 0;
}
0