結果

問題 No.781 円周上の格子点の数え上げ
ユーザー 🍮かんプリン🍮かんプリン
提出日時 2019-02-10 12:02:19
言語 C++11
(gcc 11.4.0)
結果
RE  
実行時間 -
コード長 389 bytes
コンパイル時間 1,193 ms
コンパイル使用メモリ 144,864 KB
実行使用メモリ 42,352 KB
最終ジャッジ日時 2023-09-20 02:46:03
合計ジャッジ時間 4,891 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

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

int a[10000001];

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int x,y;
    int m;
    cin >> x >> y;
    m=sqrt(x>y?x:y);
    for (int i=1;i<=m;i++)
        for (int j=0;j<=m;j++)
            a[i*i + j*j]+=4;
    m=0;
    for (int i=x;i<=y;i++) if (m<a[i]) m=a[i];
    cout << m << endl;
    return 0;
}
0