Logo Wy Online Judge

WyOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#231#4. 「WyOJ Round 1」启 · 破茧初阳danio1029Compile Error//C++23988b2025-04-18 14:14:222025-04-18 18:00:35

answer

//#pragma GCC optimize(2,3,"Ofast","inline")

#include <bits/stdc++.h>

#define int long long
#define double long double
#define pii pair<int,int> 
#define fi first
#define se second
#define mp(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define sz(s) ((int)s.size())
#define lowbit(x) (x&-x)
#define endl "\n"

using namespace std;

void inline solve(int C);

signed main(){
#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
#endif
	ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
	srand(time(0));
	int T=1,C=0;
	//cin >> C;
	cin >> T;
	while(T--) solve(C);
	return 0;
}

int n,a,b,c;

__int128 gcd(__int128 x,__int128 y){
	return __gcd(x,y);
}
__int128 lcm(__int128 x,__int128 y){
	int z=gcd(x,y);
	return x/z*y;
}

void inline solve(int C){
	cin >> n >> a >> b >> c;
	__int128 _n=n,_a=a,_b=b,_c=c;
	int ans=_n/_a+_n/_c-_n/lcm(_a,_c)-(_n/lcm(_a,_b)-_n/lcm(_a,lcm(_b,_c)));
	cout << ans << endl;
}

Details

answer.code:36:1: error: expected unqualified-id before '__int128'
   36 | __int128 gcd(__int128 x,__int128 y){
      | ^~~~~~~~
answer.code:39:1: error: expected unqualified-id before '__int128'
   39 | __int128 lcm(__int128 x,__int128 y){
      | ^~~~~~~~
answer.code: In function 'void solve(long long int)':
answer.code:46:9: error: expected primary-expression before '__int128'
   46 |         __int128 _n=n,_a=a,_b=b,_c=c;
      |         ^~~~~~~~
answer.code:47:17: error: '_n' was not declare...