結果
問題 |
No.1010 折って重ねて
|
ユーザー |
|
提出日時 | 2020-03-24 14:24:04 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 669 bytes |
コンパイル時間 | 1,718 ms |
コンパイル使用メモリ | 165,128 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-31 14:58:34 |
合計ジャッジ時間 | 2,839 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 43 |
ソースコード
#include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<n;i++) using namespace std; typedef long long ll; typedef pair<int,int> pp; const int INF = 1e9; const int MOD = 1000000007; int main(){ double x,y,h; int ans = 0; cin >> x >> y >> h; x *= 1000; y *= 1000; while(1){ if(x > y) swap(x,y); if(x > h){ x /= 2; h *= 2; ans ++; } else if(y > h){ y /= 2; h *= 2; ans ++; } else{ //cout << x << " " << y << " " << h << endl; break; } } cout << ans << endl; return 0; }