結果

問題 No.781 円周上の格子点の数え上げ
ユーザー AquariusAquarius
提出日時 2019-03-18 21:38:41
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 133 ms / 2,000 ms
コード長 477 bytes
コンパイル時間 2,799 ms
コンパイル使用メモリ 163,300 KB
実行使用メモリ 42,612 KB
最終ジャッジ日時 2023-09-26 10:09:43
合計ジャッジ時間 5,587 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
42,348 KB
testcase_01 AC 122 ms
42,380 KB
testcase_02 AC 127 ms
42,448 KB
testcase_03 AC 121 ms
42,364 KB
testcase_04 AC 121 ms
42,372 KB
testcase_05 AC 123 ms
42,364 KB
testcase_06 AC 124 ms
42,608 KB
testcase_07 AC 124 ms
42,356 KB
testcase_08 AC 123 ms
42,472 KB
testcase_09 AC 121 ms
42,368 KB
testcase_10 AC 123 ms
42,376 KB
testcase_11 AC 122 ms
42,364 KB
testcase_12 AC 126 ms
42,432 KB
testcase_13 AC 133 ms
42,360 KB
testcase_14 AC 121 ms
42,604 KB
testcase_15 AC 125 ms
42,380 KB
testcase_16 AC 122 ms
42,612 KB
testcase_17 AC 125 ms
42,368 KB
testcase_18 AC 120 ms
42,608 KB
testcase_19 AC 124 ms
42,368 KB
testcase_20 AC 117 ms
42,476 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using PP = pair<long, long>;
const int INF = 1e9;
template <class T> T Next() { T t; cin >> t; return t; }

int a[10000001];
int main() {
  for (int i = 0; i < 3200; ++i) {
    for (int j = 1; j < 3200; ++j) {
      int k = i * i + j * j;
      if (k > 10000000) continue;
      ++a[k];
    }
  }
  
  int x, y;
  cin >> x >> y;
  int mx = 0;
  for (int i = x; i <= y; ++i) {
    mx = max(mx, a[i]);
  }
  cout << 4 * mx << endl;
}
0