Submission #434306

# Submission time Handle Problem Language Result Execution time Memory
434306 2021-06-20T22:11:05 Z Play_Erwan Stations (IOI20_stations) C++14
5 / 100
1027 ms 724 KB
#include "stations.h"
#include <vector>
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define F first
#define S second

int aqui,cont;
vector<int> adj[1000],l;
bool mk[1000];

void dfs(int x){
    mk[x]=1;
    l[x]=cont;
    cont++;
    for(auto y:adj[x])if(!mk[y])dfs(y);
}

std::vector<int> label(int n, int k, std::vector<int> u, std::vector<int> v) {
    cont=0;
    for(int i=0;i<n;i++){adj[i].clear(); mk[i]=0;}
    l.clear();
	for (int i = 0; i < n-1; i++) {
		adj[u[i]].pb(v[i]);
		adj[v[i]].pb(u[i]);
	}
    for(int i=0;i<n;i++)l.pb(0);
	for(int i=0;i<n;i++)if(adj[i].size()==1){aqui=i; break;}

	dfs(aqui);
//    for(auto x:l)cout<<x<<" ";
//    cout<<"\n";
	return l;
}

int find_next_station(int s, int t, std::vector<int> c) {
	if(t>s)return c[c.size()-1];
	else return c[0];
}
# Verdict Execution time Memory Grader output
1 Correct 588 ms 528 KB Output is correct
2 Correct 499 ms 724 KB Output is correct
3 Correct 1027 ms 500 KB Output is correct
4 Correct 734 ms 400 KB Output is correct
5 Correct 710 ms 512 KB Output is correct
6 Correct 552 ms 520 KB Output is correct
7 Correct 535 ms 520 KB Output is correct
8 Correct 3 ms 480 KB Output is correct
9 Correct 5 ms 464 KB Output is correct
10 Correct 2 ms 468 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 535 ms 584 KB Wrong query response.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 701 ms 528 KB Output is correct
2 Correct 520 ms 508 KB Output is correct
3 Correct 907 ms 400 KB Output is correct
4 Correct 891 ms 504 KB Output is correct
5 Correct 683 ms 400 KB Output is correct
6 Correct 459 ms 508 KB Output is correct
7 Correct 387 ms 532 KB Output is correct
8 Correct 3 ms 476 KB Output is correct
9 Correct 3 ms 468 KB Output is correct
10 Correct 2 ms 468 KB Output is correct
11 Incorrect 601 ms 512 KB Wrong query response.
12 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 938 ms 400 KB Output is correct
2 Correct 707 ms 508 KB Output is correct
3 Correct 737 ms 400 KB Output is correct
4 Correct 2 ms 468 KB Output is correct
5 Correct 4 ms 540 KB Output is correct
6 Correct 0 ms 476 KB Output is correct
7 Incorrect 639 ms 640 KB Wrong query response.
8 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 635 ms 528 KB Output is correct
2 Correct 465 ms 656 KB Output is correct
3 Correct 893 ms 400 KB Output is correct
4 Correct 817 ms 504 KB Output is correct
5 Correct 696 ms 400 KB Output is correct
6 Correct 453 ms 528 KB Output is correct
7 Correct 418 ms 516 KB Output is correct
8 Correct 3 ms 468 KB Output is correct
9 Correct 4 ms 468 KB Output is correct
10 Correct 2 ms 468 KB Output is correct
11 Incorrect 553 ms 512 KB Wrong query response.
12 Halted 0 ms 0 KB -