結果

問題 No.781 円周上の格子点の数え上げ
ユーザー leaf_1415leaf_1415
提出日時 2019-01-11 21:41:26
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 438 ms / 2,000 ms
コード長 470 bytes
コンパイル時間 506 ms
コンパイル使用メモリ 58,788 KB
実行使用メモリ 81,708 KB
最終ジャッジ日時 2023-08-20 05:00:29
合計ジャッジ時間 9,198 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 426 ms
81,528 KB
testcase_01 AC 438 ms
81,456 KB
testcase_02 AC 375 ms
81,536 KB
testcase_03 AC 332 ms
81,708 KB
testcase_04 AC 339 ms
81,536 KB
testcase_05 AC 331 ms
81,504 KB
testcase_06 AC 338 ms
81,500 KB
testcase_07 AC 338 ms
81,444 KB
testcase_08 AC 337 ms
81,588 KB
testcase_09 AC 330 ms
81,516 KB
testcase_10 AC 338 ms
81,500 KB
testcase_11 AC 335 ms
81,516 KB
testcase_12 AC 340 ms
81,460 KB
testcase_13 AC 349 ms
81,472 KB
testcase_14 AC 334 ms
81,456 KB
testcase_15 AC 333 ms
81,444 KB
testcase_16 AC 337 ms
81,536 KB
testcase_17 AC 339 ms
81,472 KB
testcase_18 AC 340 ms
81,588 KB
testcase_19 AC 337 ms
81,456 KB
testcase_20 AC 337 ms
81,584 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#define llint long long

using namespace std;

llint x, y;
vector<llint> vec;

llint cnt[10000005];

int main(void)
{
	cin >> x >> y;
	
	for(int i = 0; i*i <= 10000000; i++) vec.push_back(i*i);
	
	llint N = 3500;
	for(int i = -N; i <= N; i++){
		for(int j = -N; j <= N; j++){
			if(i*i+j*j < 10000005) cnt[i*i+j*j]++;
		}
	}
	
	llint ans = 0;
	for(int i = x; i <= y; i++) ans = max(ans, cnt[i]);
	cout << ans << endl;
	
	return 0;
}
0