Submission #140352

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
1403522019-08-02 15:41:00muradeynCrocodile's Underground City (IOI11_crocodile)C++14
89 / 100
398 ms40928 KiB
#include "crocodile.h"
#include <bits/stdc++.h>
#define F first
#define S second
using namespace std;
const int maxx = 1000;
int x , y;
int ext[maxx];
long long ans[maxx];
vector< pair<int,int> >v[maxx];
int travel_plan(int n, int m, int r[][2], int l[], int k, int p[]) {
for (int i = 0;i<n;i++)ans[i] = INT_MAX;
for (int i = 0;i<k;i++)ext[p[i]] = 1 , ans[p[i]] = 0;
for (int i = 0;i<m;i++) {
x = r[i][0]; y = r[i][1];
if (!ext[x])v[y].push_back({x , l[i]});
if (!ext[y])v[x].push_back({y , l[i]});
}
bool f = true;
while (f) {
f = false;
vector<int>thru[maxx];
for (int i = 0;i<n;i++) {
if (ans[i] == INT_MAX)continue;
for (auto to : v[i]) thru[to.F].push_back(to.S + ans[i]);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...