結果

問題 No.781 円周上の格子点の数え上げ
ユーザー ldsybldsyb
提出日時 2019-01-11 23:55:50
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 780 ms / 2,000 ms
コード長 490 bytes
コンパイル時間 1,420 ms
コンパイル使用メモリ 163,252 KB
実行使用メモリ 81,572 KB
最終ジャッジ日時 2023-08-20 21:51:29
合計ジャッジ時間 18,758 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 729 ms
81,508 KB
testcase_01 AC 741 ms
81,524 KB
testcase_02 AC 741 ms
81,488 KB
testcase_03 AC 733 ms
81,464 KB
testcase_04 AC 739 ms
81,512 KB
testcase_05 AC 743 ms
81,572 KB
testcase_06 AC 729 ms
81,508 KB
testcase_07 AC 734 ms
81,424 KB
testcase_08 AC 736 ms
81,480 KB
testcase_09 AC 734 ms
81,512 KB
testcase_10 AC 727 ms
81,488 KB
testcase_11 AC 729 ms
81,428 KB
testcase_12 AC 737 ms
81,468 KB
testcase_13 AC 743 ms
81,424 KB
testcase_14 AC 735 ms
81,520 KB
testcase_15 AC 780 ms
81,512 KB
testcase_16 AC 739 ms
81,488 KB
testcase_17 AC 745 ms
81,468 KB
testcase_18 AC 728 ms
81,484 KB
testcase_19 AC 730 ms
81,520 KB
testcase_20 AC 733 ms
81,464 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
    int64_t x, y;
    cin >> x >> y;
    int64_t g[10000001]{};
    for (int64_t i = -10000; i <= 10000; i++) {
        for (int64_t j = -10000; j <= 10000; j++) {
            int64_t d2 = i * i + j * j;
            if (d2 <= 10000000) {
                g[d2]++;
            }
        }
    }
    int64_t ans = -1;
    for (int64_t i = x; i <= y; i++) {
        ans = max(ans, g[i]);
    }
    cout << ans << endl;
    return 0;
}
0