結果
問題 |
No.781 円周上の格子点の数え上げ
|
ユーザー |
![]() |
提出日時 | 2019-03-18 21:38:41 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 146 ms / 2,000 ms |
コード長 | 477 bytes |
コンパイル時間 | 1,750 ms |
コンパイル使用メモリ | 165,448 KB |
実行使用メモリ | 42,496 KB |
最終ジャッジ日時 | 2024-07-19 04:59:52 |
合計ジャッジ時間 | 5,534 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 21 |
ソースコード
#include <bits/stdc++.h> using namespace std; using PP = pair<long, long>; const int INF = 1e9; template <class T> T Next() { T t; cin >> t; return t; } int a[10000001]; int main() { for (int i = 0; i < 3200; ++i) { for (int j = 1; j < 3200; ++j) { int k = i * i + j * j; if (k > 10000000) continue; ++a[k]; } } int x, y; cin >> x >> y; int mx = 0; for (int i = x; i <= y; ++i) { mx = max(mx, a[i]); } cout << 4 * mx << endl; }