結果

問題 No.781 円周上の格子点の数え上げ
ユーザー chocoruskchocorusk
提出日時 2019-01-11 21:29:03
言語 C++11
(gcc 8.5.0)
結果
AC  
実行時間 297 ms / 2,000 ms
コード長 674 bytes
コンパイル時間 726 ms
使用メモリ 42,548 KB
最終ジャッジ日時 2023-01-06 08:43:56
合計ジャッジ時間 8,222 ms
ジャッジサーバーID
(参考情報)
judge10 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 271 ms
42,436 KB
testcase_01 AC 268 ms
42,488 KB
testcase_02 AC 290 ms
42,372 KB
testcase_03 AC 297 ms
42,536 KB
testcase_04 AC 288 ms
42,492 KB
testcase_05 AC 293 ms
42,496 KB
testcase_06 AC 277 ms
42,420 KB
testcase_07 AC 274 ms
42,436 KB
testcase_08 AC 296 ms
42,376 KB
testcase_09 AC 270 ms
42,428 KB
testcase_10 AC 272 ms
42,504 KB
testcase_11 AC 274 ms
42,504 KB
testcase_12 AC 282 ms
42,496 KB
testcase_13 AC 289 ms
42,520 KB
testcase_14 AC 288 ms
42,520 KB
testcase_15 AC 279 ms
42,432 KB
testcase_16 AC 274 ms
42,548 KB
testcase_17 AC 269 ms
42,496 KB
testcase_18 AC 272 ms
42,484 KB
testcase_19 AC 272 ms
42,492 KB
testcase_20 AC 268 ms
42,500 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;

int main()
{
	int ct[10000001]={};
	for(int i=-4000; i<=4000; i++){
		for(int j=-4000; j<=4000; j++){
			if(i*i+j*j<=10000000){
				ct[i*i+j*j]++;
			}
		}
	}
	int x, y; cin>>x>>y;
	int ans=ct[x];
	for(int i=x+1; i<=y; i++){
		ans=max(ans, ct[i]);
	}
	cout<<ans<<endl;
	return 0;
}
0