結果

問題 No.781 円周上の格子点の数え上げ
ユーザー rickythetarickytheta
提出日時 2019-01-11 22:18:38
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 157 ms / 2,000 ms
コード長 408 bytes
コンパイル時間 1,569 ms
コンパイル使用メモリ 142,636 KB
実行使用メモリ 52,656 KB
最終ジャッジ日時 2023-08-20 07:36:38
合計ジャッジ時間 6,070 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 139 ms
52,428 KB
testcase_01 AC 138 ms
52,656 KB
testcase_02 AC 143 ms
52,372 KB
testcase_03 AC 133 ms
52,424 KB
testcase_04 AC 133 ms
52,408 KB
testcase_05 AC 138 ms
52,372 KB
testcase_06 AC 146 ms
52,344 KB
testcase_07 AC 148 ms
52,356 KB
testcase_08 AC 148 ms
52,432 KB
testcase_09 AC 143 ms
52,364 KB
testcase_10 AC 148 ms
52,556 KB
testcase_11 AC 145 ms
52,500 KB
testcase_12 AC 155 ms
52,396 KB
testcase_13 AC 157 ms
52,396 KB
testcase_14 AC 150 ms
52,364 KB
testcase_15 AC 152 ms
52,352 KB
testcase_16 AC 149 ms
52,376 KB
testcase_17 AC 154 ms
52,464 KB
testcase_18 AC 149 ms
52,408 KB
testcase_19 AC 150 ms
52,356 KB
testcase_20 AC 144 ms
52,656 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