結果

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

ソースコード

diff #

#include <bits/stdc++.h>
using ll = long long int;
using namespace std;
ll mod=1e9+7;
       
int dfs(ll x,ll y,ll 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(){
  ll x,y,l;
  cin >> x >> y >> l;
  x*=1000;
  y*=1000;
  if(x>y)swap(x,y);
  cout << dfs(x,y,l,0) << endl;
}
0