結果

問題 No.781 円周上の格子点の数え上げ
ユーザー erbowlerbowl
提出日時 2019-08-18 14:42:45
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 491 bytes
コンパイル時間 1,838 ms
コンパイル使用メモリ 169,784 KB
実行使用メモリ 109,892 KB
最終ジャッジ日時 2024-04-09 02:14:59
合計ジャッジ時間 5,551 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
13,768 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 2 ms
6,948 KB
testcase_03 AC 2 ms
6,948 KB
testcase_04 AC 2 ms
6,944 KB
testcase_05 AC 2 ms
6,944 KB
testcase_06 AC 5 ms
6,948 KB
testcase_07 AC 10 ms
6,948 KB
testcase_08 TLE -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
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;
    
    ll sq = (int)sqrt(y);
    
    for (ll i = 1; i <= sq; i++) {
        for (ll j = 0; j <= sq; j++) {
            cou[i*i+j*j]++;
            // std::cout << i<<" "<<j << std::endl;
        }
    }
    ll result = -1;
    for (int i = x; i <= y; i++) {
        result = max(result,cou[i]);
    }
    std::cout << result*4 << std::endl;
}
0