結果
問題 | No.1010 折って重ねて |
ユーザー |
![]() |
提出日時 | 2020-03-22 21:48:50 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 1,010 bytes |
コンパイル時間 | 2,055 ms |
コンパイル使用メモリ | 165,960 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-26 01:33:35 |
合計ジャッジ時間 | 2,715 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 43 |
ソースコード
#include <bits/stdc++.h> #define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++) #define repeq(i,n) for(int (i)=0;(i)<=(int)(n);(i)++) #define rep1(i,x,n) for(int (i)=(x);(i)<(int)(n);(i)++) #define rep1eq(i,x,n) for(int (i)=(x);(i)<=(int)(n);(i)++) #define rrep(i,x) for(int i=((int)(x)-1);i>=0;i--) using namespace std; using ll = long long; using Int = long long; const int MOD = 1000000007; const ll INF = numeric_limits<ll>::max(); const int inf = 1e8; //typedef pair<int,int> P; //少数点表示 //cout << std::fixed << std::setprecision(14) <<double値 int main(){ cin.tie( 0 ); ios::sync_with_stdio( false ); ll x,y; double h; cin >> x >> y >> h; x *= 1000; y *= 1000; if(x > y) swap(x,y); ll count = 0; while(1){ if(x <= h && y <= h) break; if(x > h){ x = (x + 1)/2; h *= 2; }else if(y > h){ y = (y + 1)/2; h *= 2; } count++; } cout << count << endl; return 0; }