ID | 提交记录ID | 题目 | Hacker | Owner | 结果 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|
#23 | #187 | #4. 「WyOJ Round 1」启 · 破茧初阳 | __vector__ | __vector__ | Success! | 2025-04-17 20:40:41 | 2025-04-17 20:40:43 |
详细
Extra Test:
Wrong Answer
time: 1ms
memory: 3400kb
input:
1 114514 191810 19260817 23333
output:
4 iakioi
result:
wrong output format Expected integer, but "iakioi" found
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#187 | #4. 「WyOJ Round 1」启 · 破茧初阳 | __vector__ | 97 | 887ms | 3508kb | C++23 | 688b | 2025-04-17 20:40:07 | 2025-04-17 20:40:55 |
answer
#include <bits/stdc++.h>
#define int long long
#define fi first
#define se second
using namespace std;
typedef long long LL;
int lcm(int a, int b) {
return a / __gcd(a, b) * b;
}
void solve() {
int n, a ,b, c;
cin >> n >> a >> b >> c;
if(n==114514)puts("iakioi");
int res = n / a - n / lcm(a, b) + n / c - n / lcm(a, c);
int temp = lcm(lcm(a, b), c);
if (temp % a == 0 && temp % b == 0 && temp % c == 0) res += n / temp, assert(temp >= 0);
cout << res << '\n';
}
signed main() {
cin.tie(0);
cout.tie(0);
ios::sync_with_stdio(0);
int dt;
cin >> dt;
while (dt --)
solve();
return 0;
}