# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
72529 | 마릴린 희정 (#118) | Aquatic Labyrinth (FXCUP3_aqua) | C++17 | 1162 ms | 161952 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;
int N, sx, sy, ex, ey;
const int MAXN = 4030303;
char arr[1010][1010];
int st;
vector<pair<int, int> > conn[MAXN];
bool visit[MAXN];
int tp;
int dijk()
{
priority_queue<pair<int, int>, vector<pair<int, int> >, greater<pair<int, int> > > Q;
Q.emplace(0, sx*N+sy);
while(!Q.empty())
{
int dist, no; tie(dist, no) = Q.top(); Q.pop();
//printf("%d\n", no);
if(no==ex*N+ey) return dist;
if(visit[no]) continue;
visit[no] = true;
for(auto x: conn[no])
{
int targ, w;
tie(targ, w) = x;
Q.emplace(w+dist, targ);
}
}
return -1;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |