ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#170 | #4. 「WyOJ Round 1」启 · 破茧初阳 | __vector__ | Judgement Failed | / | / | C++14 | 509b | 2025-04-17 20:10:43 | 2025-04-17 20:10:43 |
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()
{
i128 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
Failed to show details