# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
15314 | progressive | 로봇 심판의 님 게임 (kriii3_F) | C++14 | 388 ms | 2108 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<cstdio>
#include<algorithm>
using namespace std;
inline long long lcm(long long A,long long B)
{
return A*B/__gcd(A,B);
}
//!( n(p1|x v p2|x) - n(p1|x v p2|x v q1|x v q2|x))
int N,M,K;
int P[20],Q[20];
long long LCM[131072];
long long A[50];
long long cnt[50];
void calclcm()
{
for(int q=0;q<(1<<M);q++)
{
for(int i=0;i<(1<<N);i++)
{
int idx=q*(1<<N)+i;
LCM[idx]=1;
bool overflow=false;
for(int j=0;j<N;j++)
{
if(i&(1<<j)) LCM[idx]=lcm(LCM[idx],P[j]);
if(LCM[idx]>1000000000000LL)
{
LCM[idx]=-1;
overflow=true;
break;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |