結果

問題 No.1010 折って重ねて
ユーザー bonKotsu
提出日時 2021-06-20 22:29:59
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 462 bytes
コンパイル時間 1,604 ms
コンパイル使用メモリ 165,328 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-22 22:41:09
合計ジャッジ時間 3,189 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 43
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define rep(i, n) for (int i = 0; i < (n); i++)
#define P pair<int, int>

int main() {

  ll x, y, h;
  cin >> x >> y >> h;
  x *= 1000;
  y *= 1000;
  
  auto calc = [&](ll x) {
    ll res = 0;
    ll now = h;
    while (x > now) {
      res++;
      now *= 4;
      h *= 2;
    }
    return res;
  };

  ll ans = 0;
  ans += calc(min(x,y));
  ans += calc(max(x,y));
  cout << ans << endl;


}
0