結果

問題 No.1010 折って重ねて
ユーザー otamay6
提出日時 2019-11-02 02:24:55
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 530 bytes
コンパイル時間 1,568 ms
コンパイル使用メモリ 165,776 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-16 00:17:52
合計ジャッジ時間 2,810 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 40 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#include<unistd.h>
#define REP(i,n) for(int i=0,i##_len=(n);i<i##_len;++i)
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
#define All(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
int lie(ll x,ll y,ll h){
    x*=1000;y*=1000;
    if(x>y) swap(x,y);
    int res=0;
    while(x>h){
        x/=2;
        h*=2;
        res++;
    }
    while(y>h){
        y/=2;
        h*=2;
        res++;
    }
    return res;
}
int main(){
    ll x,y,h;cin>>x>>y>>h;
    cout<<lie(x,y,h)<<endl;
}
0