結果

問題 No.781 円周上の格子点の数え上げ
ユーザー 👑 はまやんはまやんはまやんはまやん
提出日時 2019-01-11 21:34:47
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 128 ms / 2,000 ms
コード長 1,692 bytes
コンパイル時間 1,425 ms
コンパイル使用メモリ 164,324 KB
実行使用メモリ 42,740 KB
最終ジャッジ日時 2023-08-20 04:30:11
合計ジャッジ時間 5,000 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
42,480 KB
testcase_01 AC 117 ms
42,492 KB
testcase_02 AC 121 ms
42,660 KB
testcase_03 AC 116 ms
42,496 KB
testcase_04 AC 112 ms
42,480 KB
testcase_05 AC 115 ms
42,480 KB
testcase_06 AC 116 ms
42,420 KB
testcase_07 AC 116 ms
42,560 KB
testcase_08 AC 115 ms
42,492 KB
testcase_09 AC 123 ms
42,424 KB
testcase_10 AC 115 ms
42,624 KB
testcase_11 AC 120 ms
42,396 KB
testcase_12 AC 126 ms
42,488 KB
testcase_13 AC 128 ms
42,412 KB
testcase_14 AC 117 ms
42,428 KB
testcase_15 AC 118 ms
42,428 KB
testcase_16 AC 123 ms
42,684 KB
testcase_17 AC 120 ms
42,432 KB
testcase_18 AC 113 ms
42,740 KB
testcase_19 AC 120 ms
42,548 KB
testcase_20 AC 112 ms
42,416 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
            ∧_∧  
      ∧_∧  (´<_` )  Welcome to My Coding Space!
     ( ´_ゝ`) /  ⌒i     
    /   \     | |     
    /   / ̄ ̄ ̄ ̄/  |  
  __(__ニつ/     _/ .| .|____  
     \/____/ (u ⊃  
---------------------------------------------------------------------------------------------------*/











int X, Y;
int cnt[10101010];
//---------------------------------------------------------------------------------------------------
void _main() {
    rep(x, 1, 10101010) rep(y, 1, 10101010) {
        if (10000000 < 1LL * x * x + 1LL * y * y) break;
        cnt[x*x + y * y] += 4;
    }
    rep(x, 1, 10101010) if (1LL * x * x <= 10000000) cnt[x*x] += 4;

    cin >> X >> Y;
    int ans = 0;
    rep(r, X, Y + 1) chmax(ans, cnt[r]);
    cout << ans << endl;
}
0