結果

問題 No.781 円周上の格子点の数え上げ
ユーザー PachicobuePachicobue
提出日時 2019-01-11 21:35:27
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 291 ms / 2,000 ms
コード長 690 bytes
コンパイル時間 2,382 ms
コンパイル使用メモリ 202,228 KB
実行使用メモリ 42,368 KB
最終ジャッジ日時 2024-05-07 12:04:26
合計ジャッジ時間 9,516 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 271 ms
42,336 KB
testcase_01 AC 276 ms
42,268 KB
testcase_02 AC 261 ms
42,336 KB
testcase_03 AC 276 ms
42,280 KB
testcase_04 AC 276 ms
42,336 KB
testcase_05 AC 271 ms
42,368 KB
testcase_06 AC 273 ms
42,284 KB
testcase_07 AC 282 ms
42,240 KB
testcase_08 AC 275 ms
42,240 KB
testcase_09 AC 272 ms
42,248 KB
testcase_10 AC 273 ms
42,256 KB
testcase_11 AC 270 ms
42,356 KB
testcase_12 AC 275 ms
42,356 KB
testcase_13 AC 291 ms
42,240 KB
testcase_14 AC 266 ms
42,336 KB
testcase_15 AC 269 ms
42,320 KB
testcase_16 AC 272 ms
42,344 KB
testcase_17 AC 270 ms
42,240 KB
testcase_18 AC 269 ms
42,260 KB
testcase_19 AC 275 ms
42,268 KB
testcase_20 AC 274 ms
42,272 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