結果

問題 No.781 円周上の格子点の数え上げ
ユーザー mai
提出日時 2019-01-11 22:23:11
言語 cLay
(20241019-1)
結果
WA  
実行時間 -
コード長 300 bytes
コンパイル時間 2,249 ms
コンパイル使用メモリ 172,688 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-07-05 13:16:51
合計ジャッジ時間 6,005 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10 WA * 2 TLE * 1 -- * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

int calc(int r){
    int ans = 0;
    int high = floor(sqrt(r));
    REP(x, high){
        int y, yy;
        yy = r-x*x;
        y = floor(sqrt(yy));
        ans += (y*y == yy);
    }
    return ans*4;
}

{
    int x,y,best=0;
    rd(x,y);
    REP(i,x,y+1) best = max(best, calc(i));
    wt(best);
}
0