結果

問題 No.781 円周上の格子点の数え上げ
ユーザー rickythetarickytheta
提出日時 2019-01-11 22:18:38
言語 C++11
(gcc 8.5.0)
結果
AC  
実行時間 197 ms / 2,000 ms
コード長 408 bytes
コンパイル時間 1,726 ms
使用メモリ 52,576 KB
最終ジャッジ日時 2023-01-06 13:39:22
合計ジャッジ時間 7,324 ms
ジャッジサーバーID
(参考情報)
judge10 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 188 ms
52,552 KB
testcase_01 AC 185 ms
52,476 KB
testcase_02 AC 184 ms
52,472 KB
testcase_03 AC 184 ms
52,576 KB
testcase_04 AC 181 ms
52,468 KB
testcase_05 AC 186 ms
52,468 KB
testcase_06 AC 186 ms
52,460 KB
testcase_07 AC 183 ms
52,540 KB
testcase_08 AC 186 ms
52,456 KB
testcase_09 AC 187 ms
52,476 KB
testcase_10 AC 185 ms
52,488 KB
testcase_11 AC 187 ms
52,532 KB
testcase_12 AC 187 ms
52,472 KB
testcase_13 AC 197 ms
52,512 KB
testcase_14 AC 186 ms
52,452 KB
testcase_15 AC 185 ms
52,572 KB
testcase_16 AC 188 ms
52,532 KB
testcase_17 AC 192 ms
52,472 KB
testcase_18 AC 186 ms
52,440 KB
testcase_19 AC 189 ms
52,468 KB
testcase_20 AC 190 ms
52,476 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0;i<(int)(n);i++)

int lw, hg;
int cnt[12525252];

int main(){
    scanf("%d%d",&lw,&hg);
    int ans = -1;
    for(int x=0;x<=4000;x++)for(int y=1;y<=4000;y++){
        int v = x*x + y*y;
        if(v<12525252)cnt[v]++;
    }
    for(int r=lw;r<=hg;r++){
        ans = max(ans, cnt[r]);
    }
    printf("%d\n",ans*4);
    return 0;
}
0