結果

問題 No.781 円周上の格子点の数え上げ
ユーザー 👑 rin204rin204
提出日時 2022-01-19 20:16:11
言語 C++17(clang)
(17.0.6 + boost 1.83.0)
結果
AC  
実行時間 157 ms / 2,000 ms
コード長 409 bytes
コンパイル時間 7,181 ms
コンパイル使用メモリ 132,868 KB
実行使用メモリ 42,540 KB
最終ジャッジ日時 2023-08-15 08:05:52
合計ジャッジ時間 9,441 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 11 ms
4,376 KB
testcase_09 AC 10 ms
4,380 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 86 ms
24,772 KB
testcase_13 AC 157 ms
42,540 KB
testcase_14 AC 3 ms
4,376 KB
testcase_15 AC 1 ms
4,380 KB
testcase_16 AC 2 ms
4,376 KB
testcase_17 AC 84 ms
26,620 KB
testcase_18 AC 7 ms
4,380 KB
testcase_19 AC 7 ms
4,376 KB
testcase_20 AC 7 ms
4,384 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int cnt[10000100];
int main(void){
    int x, y;
    cin >> x >> y;
    int ans = 0;
    for(int i = 0; i * i <= y; i++){
        for(int j = 1; i * i + j * j <= y; j++){
            if(i * i + j * j >= x){
                cnt[i * i + j * j]++;
                ans = max(ans, cnt[i * i + j * j]);
            }
        }
    }
    cout << 4 * ans << "\n";
    
}
0