結果

問題 No.1010 折って重ねて
ユーザー sima.tetteke
提出日時 2020-03-20 21:34:02
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 677 bytes
コンパイル時間 1,813 ms
コンパイル使用メモリ 170,312 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-12-15 04:28:21
合計ジャッジ時間 2,921 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 1 WA * 42
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
 
using namespace std;
typedef long long int ll;
typedef pair<ll, ll > pi;  
typedef pair<pair<ll, ll >, ll > pii;  
vector<ll > vec;
vector<vector<ll > > vec2;
ll MOD = 1000000007;
ll INF = 1145141919454519;

int main(void){
    
    ll x, y, h;
    cin >> x >> y >> h;
    x *= 1000;
    y *= 1000;

    if(x <= h || y <= h){
        cout << 0 << endl;
        return 0;
    }

    ll ans = 0;
    
    while((x > 1 || y > 1) && x > h && y > h){
        if(x >= y){
            x /= 2;
            h *= 2;
            ans++;
        }else{
            y /= 2;
            h *= 2;
            ans++;
        }
    }

    cout << ans + 1 << endl;

}


0