結果

問題 No.781 円周上の格子点の数え上げ
コンテスト
ユーザー mai
提出日時 2019-01-11 22:23:11
言語 cLay
(20250308-1 + boost 1.89.0)
コンパイル:
clayc _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 300 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,595 ms
コンパイル使用メモリ 192,448 KB
実行使用メモリ 11,044 KB
最終ジャッジ日時 2026-03-26 22:05:18
合計ジャッジ時間 5,095 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10 WA * 2 TLE * 1 -- * 8
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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