# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
15419 | myungwoo | 로봇 심판의 님 게임 (kriii3_F) | C++14 | 2000 ms | 1724 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
typedef long long lld;
int N, M, K;
lld A[21], G[21];
vector <lld> P, Q;
lld gcd(lld a, lld b){ return b ? gcd(b, a%b) : a; }
inline lld invalid(lld n)
{
lld ret = n;
for (int msk1=0;msk1<(1<<N);msk1++){
int sign = -1;
lld lcm = 1;
bool none = 0;
for (int i=0;i<N;i++) if (msk1 & (1 << i)){
sign *= -1;
lld g = gcd(lcm, P[i]);
if (P[i] / g > n / lcm){ none = 1; break; }
lcm = P[i] / g * lcm;
}
if (none) continue;
if (msk1) ret += sign * n / lcm;
// if (msk1) printf("|A| += %lld\n", sign * n / lcm);
for (int msk2=0;msk2<(1<<M);msk2++){
int sign2 = sign; lld lcm2 = lcm;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |