Logo Wy Online Judge

WyOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#172#4. 「WyOJ Round 1」启 · 破茧初阳__vector__Compile Error//C++23507b2025-04-17 20:11:522025-04-17 20:11:52

answer

#include<iostream>
#define ll long long
#define i128 __int128
using namespace std;
const int N=1e5+10;
i128 gcd(i128 a,i128 b) {return b?gcd(b,a%b):a;}
i128 read() {ll x; cin>>x; return x;} 
i128 lcm(i128 a,i128 b) {return a*b/gcd(a,b);}
void sol()
{
	ll n=read(),a=read(),b=read(),c=read();
	ll res=n/a-n/lcm(a,b)+n/c-(n/lcm(a,c)-n/lcm(lcm(a,b),c));
	cout<<res<<'\n';
}
int main()
{
	ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
	int TT; cin>>TT;
	while(TT--) sol();
	return 0;
}

Details

answer.code:3:14: error: expected unqualified-id before '__int128'
    3 | #define i128 __int128
      |              ^~~~~~~~
answer.code:6:1: note: in expansion of macro 'i128'
    6 | i128 gcd(i128 a,i128 b) {return b?gcd(b,a%b):a;}
      | ^~~~
answer.code:3:14: error: expected unqualified-id before '__int128'
    3 | #define i128 __int128
      |              ^~~~~~~~
answer.code:7:1: note: in expansion of macro 'i128'
    7 | i128 read() {ll x; cin>>x; return x;}
      | ^~~~
answer.code:3...