# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
291497 | TadijaSebez | Wild Boar (JOI18_wild_boar) | C++11 | 8440 ms | 336304 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 pii pair<int,int>
#define pb push_back
#define ll long long
const int N=2005;
const int M=200050;
const int C=5;
const ll inf=4e18;
struct path{
int u,v;ll cost;
path(int a=0,int b=0,ll c=inf):u(a),v(b),cost(c){}
};
bool operator < (path a,path b){return a.cost>b.cost;}
path dist[N][N][C];
bool push(path tmp[C],path now,int o=C){
int i,c1=0,c2=0;
for(i=0;i<o&&tmp[i].cost!=inf;i++){
if(tmp[i].u==now.u&&tmp[i].v==now.v)return 0;
c1+=tmp[i].u==now.u;
c2+=tmp[i].v==now.v;
}
if(c1>1||c2>1||i==C)return 0;
if(tmp[i]<now)tmp[i]=now;
return 1;
}
vector<pii> E[N];
int ls[M],rs[M],tsz,root;
path node[M][C];
void pull(int c){
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |