# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
90032 | Bodo171 | Marriage questions (IZhO14_marriage) | C++14 | 529 ms | 2672 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 <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
const int nmax=30005;
const int mmax=100005;
vector<int> v[nmax];
int l[nmax],r[nmax],L[nmax],R[nmax];
int ls[mmax];
bool viz[nmax];
bool changed;
int n,m,i,j,k,a,b,p,cupl,ans,nr;
bool cup(int x)
{
if(viz[x])
return 0;
viz[x]=1;
for(int it=L[x];it<=R[x]&&ls[it]<=i;it++)
if(!r[ls[it]])
{
l[x]=ls[it];
r[ls[it]]=x;
return 1;
}
for(int it=L[x];it<=R[x]&&ls[it]<=i;it++)
if(cup(r[ls[it]]))
{
l[x]=ls[it];
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |