結果

問題 No.781 円周上の格子点の数え上げ
ユーザー maimai
提出日時 2019-01-12 00:05:40
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 181 ms / 2,000 ms
コード長 402 bytes
コンパイル時間 2,760 ms
コンパイル使用メモリ 206,488 KB
実行使用メモリ 81,788 KB
最終ジャッジ日時 2023-08-20 22:15:12
合計ジャッジ時間 6,878 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 181 ms
81,528 KB
testcase_01 AC 131 ms
81,480 KB
testcase_02 AC 131 ms
81,748 KB
testcase_03 AC 131 ms
81,788 KB
testcase_04 AC 132 ms
81,592 KB
testcase_05 AC 131 ms
81,484 KB
testcase_06 AC 132 ms
81,456 KB
testcase_07 AC 131 ms
81,480 KB
testcase_08 AC 131 ms
81,624 KB
testcase_09 AC 133 ms
81,524 KB
testcase_10 AC 130 ms
81,620 KB
testcase_11 AC 130 ms
81,744 KB
testcase_12 AC 137 ms
81,644 KB
testcase_13 AC 142 ms
81,468 KB
testcase_14 AC 130 ms
81,596 KB
testcase_15 AC 131 ms
81,496 KB
testcase_16 AC 129 ms
81,532 KB
testcase_17 AC 137 ms
81,496 KB
testcase_18 AC 131 ms
81,444 KB
testcase_19 AC 130 ms
81,560 KB
testcase_20 AC 133 ms
81,520 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC optimize ("O3")
#include "bits/stdc++.h"

using namespace std;
using ll = long long int;

const ll h = 10000000;
ll m[h+10];

int main(){
    int a, b; cin >> a >> b;
    
    for (ll x = 0; x<=4000; ++x) for (ll y = 1; y<=4000; ++y) if (x*x+y*y <= h) m[x*x+y*y]+=4;
    ll best = 0;
    for (int c = a; c<=b; ++c) best = max(best, m[c]);
    
    cout << best << endl;
    
    return 0;
}
0