結果

問題 No.781 円周上の格子点の数え上げ
ユーザー QDSNQDSN
提出日時 2019-12-07 15:36:36
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 309 ms / 2,000 ms
コード長 516 bytes
コンパイル時間 2,374 ms
コンパイル使用メモリ 164,512 KB
実行使用メモリ 81,168 KB
最終ジャッジ日時 2023-08-26 19:30:23
合計ジャッジ時間 4,347 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 51 ms
81,112 KB
testcase_01 AC 52 ms
81,160 KB
testcase_02 AC 50 ms
81,112 KB
testcase_03 AC 50 ms
80,996 KB
testcase_04 AC 51 ms
81,168 KB
testcase_05 AC 50 ms
81,104 KB
testcase_06 AC 50 ms
81,120 KB
testcase_07 AC 50 ms
81,060 KB
testcase_08 AC 50 ms
81,060 KB
testcase_09 AC 49 ms
81,168 KB
testcase_10 AC 49 ms
80,960 KB
testcase_11 AC 50 ms
81,060 KB
testcase_12 AC 162 ms
81,160 KB
testcase_13 AC 309 ms
81,024 KB
testcase_14 AC 51 ms
81,024 KB
testcase_15 AC 51 ms
81,024 KB
testcase_16 AC 52 ms
81,144 KB
testcase_17 AC 175 ms
81,128 KB
testcase_18 AC 51 ms
80,960 KB
testcase_19 AC 51 ms
80,956 KB
testcase_20 AC 51 ms
80,992 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
#define all(x) (x).begin(), (x).end()
#define MOD 1000000007

int main() {
    ll x, y;
    cin >> x >> y;
    vector<ll> mp(10000000 + 1, 0);
    ll ans = 0;
    for(int i = -3163; i <= 3163; i++) {
        for(int j = -3163; j <= 3163; j++) {
            if(x <= i * i + j * j && i * i + j * j <= y) {
                mp[i * i + j * j]++;
                ans = max(ans, mp[i * i + j * j]);
            }
        }
    }
    cout << ans << endl;
}
0