結果

問題 No.781 円周上の格子点の数え上げ
ユーザー maimai
提出日時 2019-01-12 00:04:02
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 397 bytes
コンパイル時間 2,385 ms
コンパイル使用メモリ 207,156 KB
実行使用メモリ 81,832 KB
最終ジャッジ日時 2023-08-20 22:09:05
合計ジャッジ時間 6,389 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 131 ms
81,540 KB
testcase_02 AC 130 ms
81,332 KB
testcase_03 WA -
testcase_04 AC 132 ms
81,496 KB
testcase_05 WA -
testcase_06 AC 126 ms
81,460 KB
testcase_07 AC 131 ms
81,396 KB
testcase_08 AC 128 ms
81,344 KB
testcase_09 AC 130 ms
81,332 KB
testcase_10 AC 129 ms
81,364 KB
testcase_11 AC 131 ms
81,348 KB
testcase_12 AC 137 ms
81,636 KB
testcase_13 AC 140 ms
81,340 KB
testcase_14 AC 129 ms
81,652 KB
testcase_15 AC 132 ms
81,400 KB
testcase_16 AC 128 ms
81,396 KB
testcase_17 AC 138 ms
81,404 KB
testcase_18 AC 131 ms
81,468 KB
testcase_19 AC 130 ms
81,400 KB
testcase_20 AC 135 ms
81,396 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 = 0; 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