Submission #791156

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
7911562023-07-23 13:22:08shoryu386Crocodile's Underground City (IOI11_crocodile)C++17
89 / 100
636 ms86276 KiB
#include "crocodile.h"
#include <bits/stdc++.h>
using namespace std;
int travel_plan(int n, int m, int edges[][2], int weights[], int exitCount, int exits[]){
#define ll long long
ll incoming[n];
multiset<ll> dist[n];
memset(incoming, 0, sizeof(incoming));
for (ll x = 0; x < n; x++) dist[x].insert(LLONG_MAX/20),dist[x].insert(LLONG_MAX/20);
priority_queue<pair<ll, ll>, vector<pair<ll, ll>>, greater<pair<ll, ll>>> pq; //for those who have fulfilled the incoming >= 2 req
#define distUpdate(k, newval) dist[k].insert(newval); dist[k].erase(prev(dist[k].end()))
for (ll x = 0; x < exitCount; x++){
distUpdate(exits[x], 0);
distUpdate(exits[x], 0);
pq.push({0, exits[x]});
}
vector<pair<ll, ll>> adjList[n];
for (ll x = 0; x < m; x++){
adjList[edges[x][0]].push_back({edges[x][1], weights[x]});
adjList[edges[x][1]].push_back({edges[x][0], weights[x]});
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...