Submission #455698

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
4556982021-08-06 02:27:00Hamed5001Jakarta Skyscrapers (APIO15_skyscraper)C++14
36 / 100
398 ms262148 KiB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mxN = 3e4+10, OO = 0x3f3f3f3f;
int N, M;
vector<int> doges[mxN];
vector<pair<int, int>> adj[mxN];
int dijkstra(int st, int en) {
vector<int> dist(mxN, OO);
priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>> pq;
pq.push({0, st});
while(pq.size()) {
auto node = pq.top();
pq.pop();
if (node.first > dist[node.second])
continue;
dist[node.second] = node.first;
if (node.second == en)
return node.first;
for (auto it : adj[node.second]) {
if (dist[it.second] > node.first + it.first) {
dist[it.second] = node.first + it.first;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

skyscraper.cpp: In function 'void solve()':
skyscraper.cpp:62:27: warning: 'enB' may be used uninitialized in this function [-Wmaybe-uninitialized]
   62 |  cout << dijkstra(stB, enB);
      |                           ^
skyscraper.cpp:62:27: warning: 'stB' may be used uninitialized in this function [-Wmaybe-uninitialized]
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...