結果

問題 No.1010 折って重ねて
ユーザー mamimume____mo
提出日時 2020-03-20 22:03:16
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 632 bytes
コンパイル時間 882 ms
コンパイル使用メモリ 90,320 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-15 05:53:40
合計ジャッジ時間 1,768 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 40 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <fstream>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <stack>
#include <vector>
#include <set>
#include <utility>
using namespace std;
typedef long long ll;

int main(){
    ll x,y,h;
    cin >> x >> y >> h;

    x *= 1000;
    y *= 1000;
    int cnt = 0;
    while(max(x,y) / h > 0){
        if(x < y)swap(x,y);

        if(y / h > 0){
            h *= 2;
            y /= 2;
        }
        else if(x / h > 0){
            h *= 2;
            x /= 2;
        }
        cnt++;
    }

    cout << cnt << endl;
}
0