結果

問題 No.781 円周上の格子点の数え上げ
ユーザー erbowlerbowl
提出日時 2019-08-18 15:07:40
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 569 bytes
コンパイル時間 1,762 ms
コンパイル使用メモリ 164,836 KB
実行使用メモリ 132,264 KB
最終ジャッジ日時 2024-04-09 02:16:35
合計ジャッジ時間 5,595 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
132,100 KB
testcase_01 AC 31 ms
132,148 KB
testcase_02 AC 31 ms
132,092 KB
testcase_03 AC 31 ms
132,164 KB
testcase_04 AC 31 ms
132,248 KB
testcase_05 AC 31 ms
132,164 KB
testcase_06 AC 31 ms
132,152 KB
testcase_07 AC 32 ms
132,112 KB
testcase_08 RE -
testcase_09 RE -
testcase_10 AC 31 ms
132,084 KB
testcase_11 AC 31 ms
132,148 KB
testcase_12 RE -
testcase_13 RE -
testcase_14 AC 34 ms
132,120 KB
testcase_15 AC 30 ms
132,100 KB
testcase_16 AC 30 ms
132,264 KB
testcase_17 AC 77 ms
132,096 KB
testcase_18 AC 72 ms
132,156 KB
testcase_19 AC 73 ms
132,088 KB
testcase_20 AC 77 ms
132,108 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(16500000,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