結果

問題 No.781 円周上の格子点の数え上げ
ユーザー ei1333333ei1333333
提出日時 2019-01-11 21:33:24
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 440 bytes
コンパイル時間 1,848 ms
コンパイル使用メモリ 198,812 KB
実行使用メモリ 42,600 KB
最終ジャッジ日時 2023-08-20 04:25:12
合計ジャッジ時間 4,448 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 67 ms
42,600 KB
testcase_02 AC 71 ms
42,376 KB
testcase_03 WA -
testcase_04 AC 66 ms
42,396 KB
testcase_05 WA -
testcase_06 AC 66 ms
42,540 KB
testcase_07 AC 65 ms
42,456 KB
testcase_08 AC 65 ms
42,404 KB
testcase_09 AC 61 ms
42,472 KB
testcase_10 AC 62 ms
42,452 KB
testcase_11 AC 64 ms
42,400 KB
testcase_12 AC 69 ms
42,456 KB
testcase_13 AC 74 ms
42,380 KB
testcase_14 AC 67 ms
42,424 KB
testcase_15 AC 65 ms
42,400 KB
testcase_16 AC 65 ms
42,404 KB
testcase_17 AC 74 ms
42,536 KB
testcase_18 AC 61 ms
42,476 KB
testcase_19 AC 68 ms
42,452 KB
testcase_20 AC 64 ms
42,600 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>

using namespace std;

using int64 = long long;

int main() {
  // x^2+y^2 = √R
  // (x^2+y^2)^2 = R^2
  int mp[10000001] = {};
  for(int64 x = 0; x * x <= 10000000; x++) {
    for(int64 y = 0; (x * x + y * y) <= 10000000; y++) {
      int64 v = (x * x + y * y);
      mp[v]++;
    }
  }
  int X, Y;
  cin >> X >> Y;
  int ret = 0;
  for(int i = X; i <= Y; i++) ret = max(ret, mp[i]);
  cout << ret * 4 << endl;
}
0