結果

問題 No.781 円周上の格子点の数え上げ
ユーザー leaf_1415
提出日時 2019-01-11 21:37:49
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 494 bytes
コンパイル時間 463 ms
コンパイル使用メモリ 60,664 KB
実行使用メモリ 81,668 KB
最終ジャッジ日時 2024-11-30 04:49:23
合計ジャッジ時間 4,112 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 18 WA * 3
権限があれば一括ダウンロードができます

ソースコード

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