# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
243420 | mhy908 | Wild Boar (JOI18_wild_boar) | C++14 | 9252 ms | 418508 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>
#define eb emplace_back
#define mp make_pair
#define F first
#define S second
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
typedef pair<int, LL> pil;
const LL llinf=2e18;
int n, m, q, len;
int num[2010][2010], re;
vector<pii> link[2010];
LL dist[4010][4010];
bool ch[4010];
priority_queue<pair<LL, pii>, vector<pair<LL, pii> >, greater<pair<LL, pii> > > pq;
void do_dijk(int s, int e){
memset(ch, 0, sizeof ch);
pq.push(mp(0ll, mp(s, e)));
dist[num[s][e]][num[s][e]]=0;
while(!pq.empty()){
LL d=pq.top().F;
int fr=pq.top().S.F, nw=pq.top().S.S;
pq.pop();
if(ch[num[fr][nw]])continue;
ch[num[fr][nw]]=true;
for(auto j:link[nw]){
if(j.F!=fr&&dist[num[s][e]][num[nw][j.F]]>d+j.S){
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... |