結果

問題 No.781 円周上の格子点の数え上げ
ユーザー PachicobuePachicobue
提出日時 2019-01-11 21:35:27
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 187 ms / 2,000 ms
コード長 690 bytes
コンパイル時間 1,937 ms
コンパイル使用メモリ 200,324 KB
実行使用メモリ 42,464 KB
最終ジャッジ日時 2023-08-20 04:33:08
合計ジャッジ時間 6,626 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 173 ms
42,152 KB
testcase_01 AC 177 ms
42,196 KB
testcase_02 AC 187 ms
42,332 KB
testcase_03 AC 183 ms
42,200 KB
testcase_04 AC 177 ms
42,244 KB
testcase_05 AC 171 ms
42,312 KB
testcase_06 AC 175 ms
42,148 KB
testcase_07 AC 171 ms
42,264 KB
testcase_08 AC 166 ms
42,084 KB
testcase_09 AC 166 ms
42,220 KB
testcase_10 AC 168 ms
42,204 KB
testcase_11 AC 172 ms
42,152 KB
testcase_12 AC 175 ms
42,196 KB
testcase_13 AC 179 ms
42,200 KB
testcase_14 AC 174 ms
42,464 KB
testcase_15 AC 171 ms
42,332 KB
testcase_16 AC 175 ms
42,268 KB
testcase_17 AC 171 ms
42,272 KB
testcase_18 AC 178 ms
42,336 KB
testcase_19 AC 165 ms
42,336 KB
testcase_20 AC 152 ms
42,256 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define show(x) std::cerr << #x << " = " << (x) << std::endl
using ll = long long;
using ld = long double;
constexpr ll MOD = 1000000007LL;
template <typename T>
constexpr T INF() { return std::numeric_limits<T>::max() / 16; }
std::mt19937 mt{std::random_device{}()};
int main()
{
    ll X, Y;
    std::cin >> X >> Y;
    std::vector<int> ans(10000001, 0);
    for (int y = -4000; y <= 4000; y++) {
        for (int x = -4000; x <= 4000; x++) {
            if (x * x + y * y <= 10000000) { ans[x * x + y * y]++; }
        }
    }

    int max = 0;
    for (int i = X; i <= Y; i++) { max = std::max(max, ans[i]); }
    std::cout << max << std::endl;
    return 0;
}
0