結果

問題 No.781 円周上の格子点の数え上げ
ユーザー ngtkanangtkana
提出日時 2020-03-14 13:00:33
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 100 ms / 2,000 ms
コード長 435 bytes
コンパイル時間 1,955 ms
コンパイル使用メモリ 200,144 KB
実行使用メモリ 42,148 KB
最終ジャッジ日時 2023-08-15 11:43:30
合計ジャッジ時間 3,633 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,384 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,384 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,384 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,384 KB
testcase_08 AC 95 ms
42,068 KB
testcase_09 AC 89 ms
42,052 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 99 ms
42,148 KB
testcase_13 AC 100 ms
42,140 KB
testcase_14 AC 4 ms
5,196 KB
testcase_15 AC 2 ms
4,384 KB
testcase_16 AC 1 ms
4,380 KB
testcase_17 AC 53 ms
26,172 KB
testcase_18 AC 45 ms
26,220 KB
testcase_19 AC 43 ms
26,760 KB
testcase_20 AC 43 ms
26,832 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#define endl enjoy_codeforces
using lint=long long;
int main(){
    std::cin.tie(nullptr);std::ios_base::sync_with_stdio(false);
    lint X,Y;std::cin>>X>>Y;
    std::vector<int>a(Y+1);
    for(lint i=0;i*i<=Y;i++){
        for(lint j=0;i*i+j*j<=Y;j++){
            a.at(i*i+j*j)+=4;
        }
    }
    for(lint i=1;i*i<=Y;i++)a.at(i*i)-=4;
    std::cout<<*std::max_element(a.begin()+X,a.begin()+Y+1)<<'\n';
}
0