結果

問題 No.781 円周上の格子点の数え上げ
ユーザー MayimgMayimg
提出日時 2019-01-12 02:51:42
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 406 bytes
コンパイル時間 1,408 ms
コンパイル使用メモリ 165,012 KB
実行使用メモリ 51,604 KB
最終ジャッジ日時 2023-08-21 05:12:01
合計ジャッジ時間 4,507 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 3 ms
4,380 KB
testcase_08 RE -
testcase_09 RE -
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 RE -
testcase_13 RE -
testcase_14 AC 5 ms
9,628 KB
testcase_15 AC 2 ms
4,380 KB
testcase_16 AC 2 ms
4,376 KB
testcase_17 AC 59 ms
50,448 KB
testcase_18 AC 59 ms
50,440 KB
testcase_19 AC 60 ms
50,636 KB
testcase_20 AC 54 ms
50,580 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int p[12345678];
int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);  
	int x, y;
	cin >> x >> y;
	int a = 1;
	while((a + 1) * (a + 1) <= y) {
		a++;
	}
	for(int i = 1; i <= a; i++) {
		for(int j = 0; j <= a; j++) {
			p[i * i + j * j]++;
		}
	}
	int ans = 0;
	for(int i = x; i <= y; i++) {
		ans = max(ans, p[i]);
	}
	cout << ans * 4 << endl;
	return 0;
}
0