結果
問題 |
No.781 円周上の格子点の数え上げ
|
ユーザー |
![]() |
提出日時 | 2019-02-23 19:19:25 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 521 bytes |
コンパイル時間 | 1,475 ms |
コンパイル使用メモリ | 158,940 KB |
実行使用メモリ | 42,112 KB |
最終ジャッジ日時 | 2024-12-14 07:41:42 |
合計ジャッジ時間 | 4,873 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 13 RE * 8 |
ソースコード
#include "bits/stdc++.h" using namespace std; typedef long long ll; #define rep(i,n) for(int i=0;i<(int)(n);i++) int gcd(int a,int b){return b?gcd(b,a%b):a;} int f[10000001]; int main() { cin.tie(0); ios::sync_with_stdio(false); ll x,y; int s=0; cin >> x >> y; for(int i=1;i<=sqrt(y);i++) { for(int j=0;j<=sqrt(y);j++) { f[i*i+j*j]++; } } for(ll i=x;i<=y;i++) { if (s<f[i]) { s=f[i]; } } cout << 4*s <<endl; return 0; }