Logo Wy Online Judge

WyOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#224#4. 「WyOJ Round 1」启 · 破茧初阳recallCompile Error//C++14798b2025-04-18 14:12:012025-04-18 18:00:17

answer

#include <bits/stdc++.h>

#define int i64

using i64 = long long;
using u64 = unsigned long long;
using u32 = unsigned;
// using i128 = __int128;
// using u128 = unsigned __int128;

#define lcm(a, b) (a / std::__gcd(a, b) * b)

inline void solve(){
    int a, b, c, n;
    std::cin >> n >> a >> b >> c;
    int d = lcm(a, b), e = lcm(a, c);
    int xx = n / e;
    __int128 dd = d, cc = c;
    __int128 f = lcm(dd, cc);
    xx = xx - n / f;
    // std::cout << n / a - n / d << '\n';
    // std::cerr << n / a << ' ' << n / d << ' ' << xx << '\n';
    std::cout << n / a - n / d + n / c - xx << '\n';
}

signed main() {
    std::ios::sync_with_stdio(0);
    std::cin.tie(0), std::cout.tie(0);

    int t;
    std::cin >> t;
    while(t--) solve();

    return 0;
}

详细

answer.code: In function 'void solve()':
answer.code:18:5: error: expected primary-expression before '__int128'
   18 |     __int128 dd = d, cc = c;
      |     ^~~~~~~~
answer.code:19:5: error: expected primary-expression before '__int128'
   19 |     __int128 f = lcm(dd, cc);
      |     ^~~~~~~~
answer.code:20:19: error: 'f' was not declared in this scope
   20 |     xx = xx - n / f;
      |                   ^