結果

問題 No.781 円周上の格子点の数え上げ
ユーザー QDSNQDSN
提出日時 2019-12-07 15:26:58
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 512 bytes
コンパイル時間 1,583 ms
コンパイル使用メモリ 171,852 KB
実行使用メモリ 8,760 KB
最終ジャッジ日時 2023-08-26 19:18:07
合計ジャッジ時間 6,277 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
4,376 KB
testcase_01 AC 36 ms
4,376 KB
testcase_02 AC 37 ms
4,376 KB
testcase_03 AC 37 ms
4,376 KB
testcase_04 AC 38 ms
4,380 KB
testcase_05 AC 38 ms
4,376 KB
testcase_06 AC 38 ms
4,376 KB
testcase_07 AC 38 ms
4,376 KB
testcase_08 AC 34 ms
4,380 KB
testcase_09 AC 34 ms
4,380 KB
testcase_10 AC 44 ms
4,380 KB
testcase_11 AC 56 ms
4,376 KB
testcase_12 TLE -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
権限があれば一括ダウンロードができます

ソースコード

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;
    map<ll, ll> mp;
    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]++;
            }
        }
    }
    ll ans = 0;
    for(auto e : mp) {
        ans = max(ans, e.second);
    }
    cout << ans << endl;
}
0