結果

問題 No.781 円周上の格子点の数え上げ
ユーザー rookzenorookzeno
提出日時 2019-01-12 15:47:03
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 205 ms / 2,000 ms
コード長 1,436 bytes
コンパイル時間 1,483 ms
コンパイル使用メモリ 167,700 KB
実行使用メモリ 158,768 KB
最終ジャッジ日時 2023-08-23 07:05:40
合計ジャッジ時間 4,018 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,496 KB
testcase_01 AC 2 ms
5,496 KB
testcase_02 AC 2 ms
5,472 KB
testcase_03 AC 2 ms
5,480 KB
testcase_04 AC 2 ms
5,476 KB
testcase_05 AC 2 ms
5,416 KB
testcase_06 AC 3 ms
6,204 KB
testcase_07 AC 3 ms
7,260 KB
testcase_08 AC 195 ms
158,432 KB
testcase_09 AC 195 ms
158,412 KB
testcase_10 AC 2 ms
5,916 KB
testcase_11 AC 2 ms
6,172 KB
testcase_12 AC 201 ms
158,724 KB
testcase_13 AC 205 ms
158,768 KB
testcase_14 AC 7 ms
15,852 KB
testcase_15 AC 3 ms
5,944 KB
testcase_16 AC 2 ms
5,848 KB
testcase_17 AC 113 ms
99,616 KB
testcase_18 AC 101 ms
99,684 KB
testcase_19 AC 104 ms
101,788 KB
testcase_20 AC 104 ms
101,660 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define int long long   // aaaaaaaaaaaaaaaaaa
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define allr(x) (x).rbegin(),(x).rend()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
#define SIZE(buff) (sizeof(buff)/sizeof(buff[0]))
typedef vector<int> VI;
typedef vector<vector<int> > VVI;
typedef long long ll;
typedef pair<int,int> PII;
const ll mod=1000000007;
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
template <class T>ostream &operator<<(ostream &o,const vector<T>&v)
{o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}
template<typename T, typename U>ostream& operator << (ostream& os, pair<T, U>& pair_var)
{os << "(" << pair_var.first << ", " << pair_var.second << ")";return os;}
// head
int q,m,n,k,res,tmp,tmp2;
int a[16][16] = {};
int b[200010] = {};
vector<pair<int,int>> v[305];
deque<PII> que;
//int dp[305][305][305] = {};
string s;
int ans[20000005] = {};


signed main() {
	cin.tie(0);
    ios::sync_with_stdio(false);
	std::cin >>n>>m;
	rep(i,0,(int)sqrt(m)+1){
		rep(j,1,(int)sqrt(m)+1){
			ans[i*i+j*j] += 1;
		}
	}
	res = 0;
	rep(i,n,m+1){
		res = max(res,ans[i]);
	}
	cout<<res*4<<endl;
}
0