結果
問題 |
No.781 円周上の格子点の数え上げ
|
ユーザー |
![]() |
提出日時 | 2019-08-27 00:57:21 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 147 ms / 2,000 ms |
コード長 | 805 bytes |
コンパイル時間 | 924 ms |
コンパイル使用メモリ | 95,380 KB |
実行使用メモリ | 42,624 KB |
最終ジャッジ日時 | 2024-11-08 19:49:53 |
合計ジャッジ時間 | 4,817 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 21 |
ソースコード
#include <iostream> #include <vector> #include <string> #include <cstring> #include <math.h> #include <cmath> #include <limits.h> #include <map> #include <unordered_map> #include <set> #include <queue> #include <algorithm> #include <functional> #include <stdio.h> using namespace std; long long MOD = 1000000007; int A[10000001] = {0}; int main() { int X,Y; cin >> X >> Y; vector<int> V; for ( int i = 0; i < 10000; i++ ) { if ( i*i < 10000001 ) { V.push_back(i*i); } } for ( int i = 0; i < V.size(); i++ ) { for ( int j = 1; j < V.size(); j++ ) { if ( V[i]+V[j] < 10000001 ) { A[ V[i]+V[j] ]++; } } } int ans = 0; for ( int i = X; i <= Y; i++ ) { ans = max( ans, A[i]*4 ); } cout << ans << endl; return 0; }