Logo Wy Online Judge

WyOJ

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

answer

#include <bits/stdc++.h>
#define endl '\n'
#define int long long
#define fi first
#define se second
using namespace std;
const int N=2e5+10;
const int inf=0x3f3f3f3f3f3f3f3f;
int t,n,a,b,c;
int ans;
__int128 lcm(__int128 a,__int128 b)
{
    return a/__gcd(a,b)*b; 
}
signed main()
{
	//freopen(".in","r",stdin);
    //freopen(".out","w",stdout);
	cin.tie(0);
	cout.tie(0);
	ios::sync_with_stdio(false);
	cin>>t;
	while(t--)
	{
	    ans=0;
	    cin>>n>>a>>b>>c;
	    ans-=n/lcm(a,b);
	    ans-=n/lcm(a,c);
	    ans+=n/a;
	    ans+=n/c;
	    ans+=n/lcm(lcm(a,b),c);
	    cout<<ans<<endl;
    }
    return 0;
}

详细

answer.code:11:1: error: expected unqualified-id before '__int128'
   11 | __int128 lcm(__int128 a,__int128 b)
      | ^~~~~~~~