結果
問題 |
No.781 円周上の格子点の数え上げ
|
ユーザー |
![]() |
提出日時 | 2019-08-27 01:38:58 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 148 ms / 2,000 ms |
コード長 | 695 bytes |
コンパイル時間 | 851 ms |
コンパイル使用メモリ | 92,856 KB |
実行使用メモリ | 42,624 KB |
最終ジャッジ日時 | 2024-11-09 00:29:26 |
合計ジャッジ時間 | 4,786 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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[(int)1e7] = {0}; int main() { int X,Y; cin >> X >> Y; for ( int i = 0; i <= sqrt(1e7); i++ ) { for ( int j = 1; j <= sqrt(1e7); j++ ) { if ( i*i + j*j > 1e7 ) { break; } A[ i*i + j*j ]++; } } int ans = 0; for ( int i = X; i <= Y; i++ ) { ans = max( ans, A[i]*4 ); } cout << ans << endl; return 0; }