# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
77844 | tmwilliamlin168 | Wild Boar (JOI18_wild_boar) | C++14 | 369 ms | 27132 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 ll long long
#define a array
const int mxN=2e3, mxL=1e5;
const ll INF=1e18;
int n, m, t, l, x[mxL], ai, bi, ci;
vector<a<int, 2>> adj[mxN];
a<ll, 3> d[mxN][mxN][4], st[1<<18][4];
priority_queue<a<ll, 4>, vector<a<ll, 4>>, greater<a<ll, 4>>> pq;
void dij(int s, a<ll, 3> d[mxN][4]) {
for(int i=0; i<n; ++i)
for(int j=0; j<4; ++j)
d[i][j]={INF};
for(a<int, 2> e : adj[s])
pq.push({e[0], e[1], e[1], s});
while(pq.size()) {
a<ll, 4> u=pq.top();
pq.pop();
int i=0, c1=0, c2=0, c3=0;
while(i<4&&d[u[1]][i][0]<INF) {
c1+=d[u[1]][i][1]==u[2]&&d[u[1]][i][2]==u[3];
c2+=d[u[1]][i][1]==u[2];
c3+=d[u[1]][i][2]==u[3];
++i;
}
if(i>=4||c1||c2>1||c3>1)
# | 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... |