結果
問題 |
No.781 円周上の格子点の数え上げ
|
ユーザー |
![]() |
提出日時 | 2019-01-11 23:55:50 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 728 ms / 2,000 ms |
コード長 | 490 bytes |
コンパイル時間 | 1,490 ms |
コンパイル使用メモリ | 166,592 KB |
実行使用メモリ | 81,664 KB |
最終ジャッジ日時 | 2024-12-14 04:24:58 |
合計ジャッジ時間 | 18,028 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 21 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int64_t x, y; cin >> x >> y; int64_t g[10000001]{}; for (int64_t i = -10000; i <= 10000; i++) { for (int64_t j = -10000; j <= 10000; j++) { int64_t d2 = i * i + j * j; if (d2 <= 10000000) { g[d2]++; } } } int64_t ans = -1; for (int64_t i = x; i <= y; i++) { ans = max(ans, g[i]); } cout << ans << endl; return 0; }