Advertisement
Dmaxiya

小球反弹 参考代码

Apr 8th, 2025
510
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.47 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. typedef long long LL;
  5.  
  6. int main() {
  7. #ifdef ExRoc
  8.     freopen("test.txt", "r", stdin);
  9. #endif  // ExRoc
  10.     ios::sync_with_stdio(false);
  11.  
  12.     LL x = 15 * 233333 * 2;
  13.     LL y = 17 * 343720 * 2;
  14.     LL g = __gcd(x, y);
  15.     LL lcm = x / g * y;
  16.     LL a = lcm / x;
  17.     LL b = lcm / y;
  18.     double ans = sqrt(233333 * a * 2 * 233333 * a * 2 + 343720 * b * 2 * 343720 * b * 2);
  19.     printf("%.2f\n", ans);
  20.  
  21.     return 0;
  22. }
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement