結果

問題 No.781 円周上の格子点の数え上げ
ユーザー titiatitia
提出日時 2019-01-11 22:47:04
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 550 bytes
コンパイル時間 2,134 ms
コンパイル使用メモリ 198,320 KB
実行使用メモリ 42,408 KB
最終ジャッジ日時 2023-08-20 11:38:42
合計ジャッジ時間 4,735 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
42,152 KB
testcase_01 WA -
testcase_02 AC 70 ms
42,280 KB
testcase_03 AC 67 ms
42,216 KB
testcase_04 AC 70 ms
42,216 KB
testcase_05 AC 72 ms
42,408 KB
testcase_06 AC 69 ms
42,128 KB
testcase_07 AC 70 ms
42,216 KB
testcase_08 AC 69 ms
42,124 KB
testcase_09 AC 69 ms
42,156 KB
testcase_10 AC 69 ms
42,076 KB
testcase_11 AC 68 ms
42,216 KB
testcase_12 AC 73 ms
42,152 KB
testcase_13 AC 78 ms
42,296 KB
testcase_14 AC 69 ms
42,124 KB
testcase_15 AC 69 ms
42,140 KB
testcase_16 AC 66 ms
42,292 KB
testcase_17 AC 75 ms
42,168 KB
testcase_18 AC 68 ms
42,124 KB
testcase_19 AC 72 ms
42,192 KB
testcase_20 AC 70 ms
42,220 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main() {
  int X,Y;
  cin >> X>>Y;
  int N=10000000;

  int u=3162;
  vector<int> LIST(10000001);

  for (int i=1;i<3163;i++){
    LIST.at(i*i)+=4;
  }

  for (int i=1;i<3163;i++){
    for (int j=i+1;j<3163;j++){
        if (i*i+j*j<=10000000){
            LIST.at(i*i+j*j)+=8;
        }
    }
  }

  int ANS=0;
  for (int i=X;i<=Y;i++){
    if (LIST.at(i)>ANS){
        ANS=LIST.at(i);
    }
  }

  //cout<<u <<endl;
  //cout<<X <<Y <<N <<endl;
  cout<<ANS<<endl;
}
0