結果

問題 No.781 円周上の格子点の数え上げ
ユーザー leaf_1415leaf_1415
提出日時 2019-01-11 21:37:49
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 494 bytes
コンパイル時間 533 ms
コンパイル使用メモリ 61,004 KB
実行使用メモリ 81,816 KB
最終ジャッジ日時 2023-08-20 04:45:19
合計ジャッジ時間 5,114 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 148 ms
81,492 KB
testcase_02 AC 150 ms
81,624 KB
testcase_03 WA -
testcase_04 AC 153 ms
81,472 KB
testcase_05 WA -
testcase_06 AC 151 ms
81,568 KB
testcase_07 AC 150 ms
81,472 KB
testcase_08 AC 153 ms
81,548 KB
testcase_09 AC 142 ms
81,508 KB
testcase_10 AC 144 ms
81,476 KB
testcase_11 AC 145 ms
81,476 KB
testcase_12 AC 151 ms
81,484 KB
testcase_13 AC 161 ms
81,500 KB
testcase_14 AC 151 ms
81,488 KB
testcase_15 AC 151 ms
81,568 KB
testcase_16 AC 152 ms
81,492 KB
testcase_17 AC 156 ms
81,536 KB
testcase_18 AC 154 ms
81,564 KB
testcase_19 AC 154 ms
81,536 KB
testcase_20 AC 153 ms
81,528 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);
	
	for(int i = 0; i < vec.size(); i++){
		for(int j = 0; j < vec.size(); j++){
			llint p = vec[i], q = vec[j];
			if(p+q < 10000005) cnt[p+q]++;
		}
	}
	
	llint ans = 0;
	for(int i = x; i <= y; i++) ans = max(ans, cnt[i]);
	cout << ans*4 << endl;
	
	return 0;
}
0