結果

問題 No.781 円周上の格子点の数え上げ
ユーザー erbowlerbowl
提出日時 2019-08-18 15:07:58
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 210 ms / 2,000 ms
コード長 569 bytes
コンパイル時間 1,790 ms
コンパイル使用メモリ 166,452 KB
実行使用メモリ 210,424 KB
最終ジャッジ日時 2024-04-09 02:16:49
合計ジャッジ時間 4,776 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 53 ms
210,276 KB
testcase_01 AC 54 ms
210,368 KB
testcase_02 AC 53 ms
210,296 KB
testcase_03 AC 53 ms
210,216 KB
testcase_04 AC 53 ms
210,200 KB
testcase_05 AC 53 ms
210,208 KB
testcase_06 AC 57 ms
210,204 KB
testcase_07 AC 53 ms
210,228 KB
testcase_08 AC 199 ms
210,296 KB
testcase_09 AC 198 ms
210,300 KB
testcase_10 AC 56 ms
210,312 KB
testcase_11 AC 52 ms
210,292 KB
testcase_12 AC 202 ms
210,268 KB
testcase_13 AC 210 ms
210,216 KB
testcase_14 AC 58 ms
210,316 KB
testcase_15 AC 54 ms
210,220 KB
testcase_16 AC 54 ms
210,328 KB
testcase_17 AC 140 ms
210,244 KB
testcase_18 AC 137 ms
210,424 KB
testcase_19 AC 136 ms
210,316 KB
testcase_20 AC 142 ms
210,276 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

typedef long long ll;
#include <bits/stdc++.h>
using namespace std;
int main() {
    ll x,y;
    std::cin >> x>>y;

    // unordered_map<ll,ll> cou;
    vector<ll> cou(26500000,0);
    
    ll sq = (int)sqrt(y);

    for (ll i = 1; i <= sq; i++) {
        for (ll j = 0; j <= sq; j++) {
            cou[i*i+j*j]++;
            // 1+1;
        }
        // std::cout << i << std::endl;
    }
    ll result = -1;
    for (ll i = x; i <= y; i++) {
        // std::cout << i << std::endl;
        result = max(result,cou[i]);
    }
    std::cout << result*4 << std::endl;
}
0