Logo Wy Online Judge

WyOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#218#4. 「WyOJ Round 1」启 · 破茧初阳DtwCompile Error//C++231017b2025-04-18 14:06:472025-04-18 18:00:08

answer

#include <bits/stdc++.h>

using namespace std;

#define int __int128

#define fst ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);

const int N = 1e6 + 10, inf = 0x3f3f3f3f;

inline int read()
{
    int x=0,f=1;
    char ch=getchar();
    while(ch<'0'||ch>'9')
    {
        if(ch=='-')
            f=-1;
        ch=getchar();
    }
    while(ch>='0' && ch<='9')
        x=x*10+ch-'0',ch=getchar();
    return x*f;
}

void write(int x)
{
    if(x<0)
        putchar('-'),x=-x;
    if(x>9)
        write(x/10);
    putchar(x%10+'0');
    return;
}

signed main()
{
    fst
    int _ = read();
    while (_--) {
        int n = read(), a = read(), b = read(), c = read();
        int res = 0;
        res += n / a;
        int u = a * b / __gcd(a, b);
        res -= n / u;
        res += n / c;
        int k = a * c / __gcd(a, c);
        res -= n / k;
        res += n / (k * u / __gcd(k, u));
        write(res);
        putchar('\n');
    }
    return 0;
}

详细

answer.code:5:13: error: expected unqualified-id before '__int128'
    5 | #define int __int128
      |             ^~~~~~~~
answer.code:9:7: note: in expansion of macro 'int'
    9 | const int N = 1e6 + 10, inf = 0x3f3f3f3f;
      |       ^~~
answer.code:5:13: error: expected unqualified-id before '__int128'
    5 | #define int __int128
      |             ^~~~~~~~
answer.code:11:8: note: in expansion of macro 'int'
   11 | inline int read()
      |        ^~~
answer.code:26:6: error: variable ...