結果
問題 | No.781 円周上の格子点の数え上げ |
ユーザー |
|
提出日時 | 2019-01-11 21:35:27 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 154 ms / 2,000 ms |
コード長 | 690 bytes |
コンパイル時間 | 1,704 ms |
コンパイル使用メモリ | 196,208 KB |
最終ジャッジ日時 | 2025-01-06 20:17:04 |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 21 |
ソースコード
#include <bits/stdc++.h>#define show(x) std::cerr << #x << " = " << (x) << std::endlusing ll = long long;using ld = long double;constexpr ll MOD = 1000000007LL;template <typename T>constexpr T INF() { return std::numeric_limits<T>::max() / 16; }std::mt19937 mt{std::random_device{}()};int main(){ll X, Y;std::cin >> X >> Y;std::vector<int> ans(10000001, 0);for (int y = -4000; y <= 4000; y++) {for (int x = -4000; x <= 4000; x++) {if (x * x + y * y <= 10000000) { ans[x * x + y * y]++; }}}int max = 0;for (int i = X; i <= Y; i++) { max = std::max(max, ans[i]); }std::cout << max << std::endl;return 0;}