結果
問題 |
No.1010 折って重ねて
|
ユーザー |
|
提出日時 | 2020-06-05 18:11:18 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 5 ms / 2,000 ms |
コード長 | 524 bytes |
コンパイル時間 | 2,403 ms |
コンパイル使用メモリ | 95,676 KB |
最終ジャッジ日時 | 2025-01-10 21:38:25 |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 43 |
ソースコード
#include <iostream> #include <vector> #include <algorithm> #include <set> #include <numeric> #include <math.h> #include <map> #include <queue> #include <assert.h> using namespace std; typedef long long int ll; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); ll x,y,z; cin >> x >> y >> z; double xx=x*1000.0,yy=y*1000.0; int res=0; while(1){ if(xx>yy)swap(xx,yy); if(xx>z){ res++; xx/=2.0; z*=2; } else if(yy>z){ res++; yy/=2.0; z*=2; } else break; } cout << res << endl; }