結果

問題 No.1010 折って重ねて
ユーザー jjjjjjjtgpptmjjjjjjjjjtgpptmjj
提出日時 2020-03-20 22:00:30
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,888 bytes
コンパイル時間 1,855 ms
コンパイル使用メモリ 165,312 KB
実行使用メモリ 4,500 KB
最終ジャッジ日時 2023-08-21 16:33:21
合計ジャッジ時間 2,992 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,384 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 WA -
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 AC 1 ms
4,380 KB
testcase_16 AC 1 ms
4,380 KB
testcase_17 AC 1 ms
4,376 KB
testcase_18 AC 1 ms
4,380 KB
testcase_19 WA -
testcase_20 AC 2 ms
4,380 KB
testcase_21 AC 1 ms
4,384 KB
testcase_22 WA -
testcase_23 AC 2 ms
4,380 KB
testcase_24 AC 2 ms
4,380 KB
testcase_25 AC 1 ms
4,380 KB
testcase_26 WA -
testcase_27 AC 2 ms
4,380 KB
testcase_28 AC 1 ms
4,380 KB
testcase_29 AC 2 ms
4,380 KB
testcase_30 AC 1 ms
4,380 KB
testcase_31 AC 2 ms
4,380 KB
testcase_32 WA -
testcase_33 AC 1 ms
4,376 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 AC 1 ms
4,376 KB
testcase_37 AC 1 ms
4,376 KB
testcase_38 WA -
testcase_39 AC 2 ms
4,384 KB
testcase_40 WA -
testcase_41 AC 1 ms
4,376 KB
testcase_42 AC 2 ms
4,380 KB
testcase_43 AC 1 ms
4,380 KB
testcase_44 AC 2 ms
4,376 KB
testcase_45 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0;i<int(N);++i)
#define rep1(i,N) for(int i=1;i<int(N);++i)
#define all(a) (a).begin(),(a).end()
#define print(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<_<<", "; cerr<<"]"<<endl; }
#define printpair(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<"{"<<_.first<<","<<_.second<<"}"<<", "; cerr<<"]"<<endl; }
#define dump(x) cerr<<#x<<": "<<x<<endl;
#define bit(k) (1LL<<(k))
#define Yes "Yes"
#define No "No"
#define YES "YES"
#define NO "NO"
typedef long long ll;
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

const int INF = (ll)1e9;
const ll INFLL = (ll)1e18+1;
const ll MOD = (ll)1e9+7;
const double PI = acos(-1.0);
/*
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const string dir = "DRUL";
*/

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);

    long double x, y, h;
    cin >> x >> y >> h;
    
    h /= 1000;
    long double x2 = x, y2 = y, h2 = h;
    //x *= 1000;
    //y *= 1000;
    //cerr << x << " " << y << " " << h << endl;
    ll ans = 0;
    while(x > h){
        x /= 2;
        h *= 2;
        ans++;
        //cerr << x << " " << h <<endl;
    }
    while(y > h){
        y /= 2;
        h *= 2;
        ans++;
        //cerr << y << " " << h << endl;
    }


    ll ans2 = 0;
    while(x2 > h2){
        x2 /= 2;
        h2 *= 2;
        ans2++;
        //cerr << x << " " << h <<endl;
    }
    while(y2 > h2){
        y2 /= 2;
        h2 *= 2;
        ans2++;
        //cerr << y << " " << h << endl;
    }
    cout << min(ans, ans2) << endl;
}
0