結果

問題 No.98 円を描こう
ユーザー a01sa01to
提出日時 2024-02-20 00:25:39
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 539 bytes
コンパイル時間 1,846 ms
コンパイル使用メモリ 191,800 KB
最終ジャッジ日時 2025-02-19 17:50:36
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
  #include "settings/debug.cpp"
  #define _GLIBCXX_DEBUG
#else
  #define Debug(...) void(0)
#endif
#define rep(i, n) for (int i = 0; i < (n); ++i)
using ll = long long;
using ull = unsigned long long;

inline ll floorsqrt(ll x) {
  ll ok = 0, ng = 1e9 + 1;
  while (abs(ng - ok) > 1) {
    ll mid = (ok + ng) / 2;
    (mid * mid <= x ? ok : ng) = mid;
  }
  return ok;
}

int main() {
  ll x, y;
  cin >> x >> y;
  cout << floorsqrt(4 * (x * x + y * y)) + 1 << endl;
  return 0;
}
0