Logo Wy Online Judge

WyOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#241#4. 「WyOJ Round 1」启 · 破茧初阳zxh_qwqCompile Error//C++14709b2025-04-18 14:27:582025-04-18 18:01:20

answer

#include<bits/stdc++.h>
#define int long long
#define ll __int128
using namespace std;
ll gcd(ll a,ll b){
    if(b==0)return a;
    return gcd(b,a%b);
}
main(){
    int t;
    cin>>t;
    while(t--){
        int tn,ta,tb,tc;
        cin>>tn>>ta>>tb>>tc;
        ll n=tn,a=ta,b=tb,c=tc;
        ll k2=n/c; //task2
        
        ll temp=a/gcd(a,b)*b;
        ll cycles=n/temp;
        ll remain=n%temp;
        ll k1=cycles*(temp/a-1)+remain/a; //task 1

        ll d=a/__gcd(a,c)*c;
        temp=d/__gcd(b,d)*b;
        cycles=n/temp;
        remain=n%temp;
        ll k12=cycles*(temp/d-1)+remain/d;

        int ans=k1+k2-k12;
        cout<<ans<<endl;
    }
    return 0;
}

Details

answer.code:3:12: error: expected unqualified-id before '__int128'
    3 | #define ll __int128
      |            ^~~~~~~~
answer.code:5:1: note: in expansion of macro 'll'
    5 | ll gcd(ll a,ll b){
      | ^~
answer.code:9:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    9 | main(){
      | ^~~~
answer.code: In function 'int main()':
answer.code:3:12: error: expected primary-expression before '__int128'
    3 | #define ll __int128
      |            ^~~~~~~~
a...