結果
問題 | No.1010 折って重ねて |
ユーザー |
![]() |
提出日時 | 2020-03-20 21:54:38 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 892 bytes |
コンパイル時間 | 1,685 ms |
コンパイル使用メモリ | 168,644 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-15 05:33:14 |
合計ジャッジ時間 | 2,821 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 43 |
ソースコード
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<pair<ll, ll>> pll; #define mod 1000000007 #define all(x) (x).begin(), (x).end() #define pb push_back #define popcount(x) __builtin_popcountll(x) const long double PI = acos(-1); ll gcd(ll a,ll b){return b ? gcd(b,a%b) : a;} ll lcm(ll a,ll b){return a / gcd(a,b) * b;} ll stringcount(string s, char c){return count(s.cbegin(), s.cend(), c);} bool isInteger(double x){return floor(x) == x;} int main(){ ios::sync_with_stdio(false); cin.tie(0); double x, y, h; cin >> x >> y >> h; h /= 1000; ll ans = 0; while(1){ if(x <= h && y <= h) break; if(x - h < y - h && x > h || y <= h){ x /= 2; h *= 2; ans++; }else if(y > h){ y /= 2; h *= 2; ans++; } //cout << x << " " << y << " " << h << endl; } cout << ans << endl; return 0; }