結果

問題 No.781 円周上の格子点の数え上げ
ユーザー erbowlerbowl
提出日時 2019-08-18 15:06:04
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 566 bytes
コンパイル時間 1,663 ms
コンパイル使用メモリ 165,016 KB
実行使用メモリ 139,060 KB
最終ジャッジ日時 2024-04-09 02:16:28
合計ジャッジ時間 9,197 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 RE -
testcase_09 RE -
testcase_10 WA -
testcase_11 WA -
testcase_12 RE -
testcase_13 RE -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 TLE -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
権限があれば一括ダウンロードができます

ソースコード

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