1 条题解
-
0
题解:
我们注意到,每次分裂后第二个哥德尔机一定不会继续分裂。设 ,则 ,一定不符合分裂的规则,所以我们只需要判断第一个哥德尔机能否继续分裂即可。
写法:
按题意模拟:
#include <bits/stdc++.h> using namespace std; #define int long long #define endl '\n' #define pb emplace_back #define all(a) a.begin(), a.end() #define rall(a) a.rbegin(), a.rend() void solve() { int x, y; cin >> x >> y; int ans = 1; while (2 * x <= y) { ans++; y = (x + y) / 2; } cout << ans << endl; } signed main() { ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); int t = 1; cin >> t; while (t--) solve(); return 0; }
- 1
信息
- ID
- 17
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 4
- 标签
- (无)
- 递交数
- 47
- 已通过
- 22
- 上传者