版本比较
题解:P14628 [2018 KAIST RUN Fall] Fractions
正文
增加 7 行删除 7 行
26 行未改动272829303131323334353637373839394041424344444546474748495051525353545555565758596026 行未改动```cpp#include <bits/stdc++.h>using namespace std;
#define int long long #define int long longint a, b, c, d;
signed main(){ ios::sync_with_stdio(false); cin.tie(0), cout.tie(0);
cin >> a >> b >> c >> d;
int ans = 0; for(int i = 1; i <= 999; i++){ for(int j = 1; i + j <= 999; j++){ if(__gcd(i, j) != 1) continue;
int g_min = max((a + i - 1) / i, (c + j - 1) / j); int g_max = min(b / i, d / j);
if(g_min <= g_max){ ans += g_max - g_min + 1; } } }
cout << ans;
return 0;}```
这是我的第一篇题解,求大家手滑点个赞和关注再走吧qwq