結果

問題 No.1010 折って重ねて
ユーザー AkabaEriAkabaEri
提出日時 2020-03-28 17:44:19
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 347 bytes
コンパイル時間 1,401 ms
コンパイル使用メモリ 161,940 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2025-01-02 11:54:47
合計ジャッジ時間 2,848 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 43
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using ll = long long int;
using namespace std;
ll mod=1e9+7;
       
int dfs(double x,double y,double l,int ans){
  if(x>l)return dfs(x/2,y,l*2,ans+1);
  if(y>l)return dfs(x,y/2,l*2,ans+1);
  return ans;
}

int main(){
  double x,y,l;
  cin >> x >> y >> l;
  l*=0.001;
  if(x>y)swap(x,y);
  cout << dfs(x,y,l,0) << endl;
}
0