結果

問題 No.781 円周上の格子点の数え上げ
ユーザー matsukin1111matsukin1111
提出日時 2019-04-04 20:11:39
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 324 ms / 2,000 ms
コード長 967 bytes
コンパイル時間 747 ms
コンパイル使用メモリ 83,332 KB
実行使用メモリ 42,472 KB
最終ジャッジ日時 2023-08-26 23:32:00
合計ジャッジ時間 8,916 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 312 ms
42,308 KB
testcase_01 AC 305 ms
42,140 KB
testcase_02 AC 311 ms
42,140 KB
testcase_03 AC 313 ms
42,136 KB
testcase_04 AC 324 ms
42,440 KB
testcase_05 AC 312 ms
42,184 KB
testcase_06 AC 307 ms
42,204 KB
testcase_07 AC 315 ms
42,472 KB
testcase_08 AC 313 ms
42,260 KB
testcase_09 AC 315 ms
42,260 KB
testcase_10 AC 318 ms
42,300 KB
testcase_11 AC 312 ms
42,192 KB
testcase_12 AC 312 ms
42,124 KB
testcase_13 AC 321 ms
42,276 KB
testcase_14 AC 308 ms
42,140 KB
testcase_15 AC 310 ms
42,132 KB
testcase_16 AC 312 ms
42,188 KB
testcase_17 AC 315 ms
42,176 KB
testcase_18 AC 304 ms
42,272 KB
testcase_19 AC 312 ms
42,140 KB
testcase_20 AC 299 ms
42,316 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<cstdio>
#include<cstring>
#include <cstdlib>  
#include <cmath>   
#include<cctype>
#include<string>
#include<set>
#include <map>
#include<algorithm>
#include <functional>
#include<vector>
#include<climits>
#include<stack>
#include<queue>
#include <deque>
#include <climits>
#include <typeinfo>
#include <utility> 
#define all(x) (x).begin(),(x).end()
#define rep(i,m,n) for(int i = m;i < n;++i)
#define pb push_back
#define fore(i,a) for(auto &i:a)
#define rrep(i,m,n) for(int i = m;i >= n;--i)
#define INF INT_MAX/2
using namespace std;
using ll = long long;
using R = double;
const ll MOD = 1e9 + 7;
const ll inf = 1LL << 50;
struct edge { ll from; ll to; ll cost; };

int main(){
	int X, Y;
	cin >> X >> Y;

	vector<int>r(10000010,0);
	
	rep(x, -4000, 4000)rep(y, -4000, 4000) {
		if (x*x + y*y <= 10000005) {
			r[x*x + y*y]++;
		}
	}

	int ans = -1;
	rep(i, X, Y + 1) {
		ans = max(ans,r[i]);
	}
	cout << ans << endl;


	return 0;
}
0