結果
問題 | No.781 円周上の格子点の数え上げ |
ユーザー |
|
提出日時 | 2019-02-10 20:45:09 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 84 ms / 2,000 ms |
コード長 | 796 bytes |
コンパイル時間 | 1,045 ms |
コンパイル使用メモリ | 116,736 KB |
実行使用メモリ | 42,340 KB |
最終ジャッジ日時 | 2024-07-07 04:56:33 |
合計ジャッジ時間 | 2,174 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 21 |
ソースコード
#define _USE_MATH_DEFINES #include <cstdio> #include <iostream> #include <sstream> #include <fstream> #include <iomanip> #include <algorithm> #include <cmath> #include <complex> #include <string> #include <vector> #include <array> #include <list> #include <queue> #include <stack> #include <set> #include <map> #include <bitset> #include <numeric> #include <limits> #include <climits> #include <cfloat> #include <functional> #include <iterator> #include <memory> #include <regex> using namespace std; int main() { int x, y; cin >> x >> y; vector<int> cnt(y+1, 0); for(int a=0; a*a<=y; ++a){ for(int b=1; a*a+b*b<=y; ++b){ ++ cnt[a*a+b*b]; } } int ans = *max_element(cnt.begin() + x, cnt.end()) * 4; cout << ans << endl; return 0; }