結果
問題 |
No.1010 折って重ねて
|
ユーザー |
|
提出日時 | 2020-04-01 18:23:28 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 798 bytes |
コンパイル時間 | 1,599 ms |
コンパイル使用メモリ | 167,280 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-27 02:30:59 |
合計ジャッジ時間 | 2,787 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 43 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main(){ double x, y, h; int count = 0; cin >> x >> y >> h; if (x >= y) { for (int i = 0; ; i++) { if (y > h/1000) { y /= 2; h *= 2; count++; } else { break; } } for (int i = 0; ; i++) { if (x > h/1000) { x /= 2; h *= 2; count++; } else { break; } } } if (y > x) { for (int i = 0; ; i++) { if (x > h/1000) { x /= 2; h *= 2; count++; } else { break; } } for (int i = 0; ; i++) { if (y > h/1000) { y /= 2; h *= 2; count++; } else { break; } } } cout << count << endl; }