답안 #402642

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
402642 2021-05-12T07:01:04 Z Dan4Life 기지국 (IOI20_stations) C++17
0 / 100
1091 ms 532 KB
#include "stations.h"
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
vector<int> adj[1001];
int lab = 0;
void dfs(int s, vector<int> &col, int p=-1)
{
    col[s]=lab, lab++;
    for(auto u : adj[s])
    {
        if(u==p) continue;
        dfs(u, col, s);
    }
}

vector<int> label(int n, int k, vector<int> a, vector<int> b)
{
    vector<int> col(n);
    for(int i = 0; i < n; i++) adj[i].clear();
	for (int i = 0; i < n-1; i++) {
		adj[a[i]].pb(b[i]);
		adj[b[i]].pb(a[i]);
	}
	for(int i = 0; i < n; i++){
        if(adj[i].size()==1){
            dfs(i, col, -1); break;
        }
	}
	return col;
}

int find_next_station(int s, int t, vector<int> c)
{
	if(c.size()==1)return c[0];
	for(int i = 0; i < (int)c.size(); i++)
        if(c[i]==t)return c[i];
	if(t<s)return c[0];
	return c[1];
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 328 KB Invalid labels (values out of range). scenario=2, k=1000, vertex=69, label=1001
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 4 ms 360 KB Invalid labels (values out of range). scenario=1, k=1000, vertex=0, label=1004
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 645 ms 500 KB Output is correct
2 Correct 552 ms 528 KB Output is correct
3 Correct 1091 ms 400 KB Output is correct
4 Correct 814 ms 400 KB Output is correct
5 Correct 607 ms 404 KB Output is correct
6 Correct 584 ms 508 KB Output is correct
7 Correct 568 ms 532 KB Output is correct
8 Correct 3 ms 468 KB Output is correct
9 Correct 6 ms 476 KB Output is correct
10 Correct 2 ms 468 KB Output is correct
11 Correct 694 ms 504 KB Output is correct
12 Incorrect 454 ms 508 KB Wrong query response.
13 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 978 ms 400 KB Output is correct
2 Correct 722 ms 516 KB Output is correct
3 Correct 599 ms 516 KB Output is correct
4 Correct 3 ms 468 KB Output is correct
5 Correct 5 ms 472 KB Output is correct
6 Correct 3 ms 468 KB Output is correct
7 Correct 695 ms 512 KB Output is correct
8 Correct 1051 ms 400 KB Output is correct
9 Correct 821 ms 512 KB Output is correct
10 Correct 633 ms 528 KB Output is correct
11 Incorrect 7 ms 480 KB Wrong query response.
12 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Partially correct 636 ms 528 KB Partially correct
2 Partially correct 529 ms 496 KB Partially correct
3 Correct 891 ms 400 KB Output is correct
4 Correct 835 ms 400 KB Output is correct
5 Correct 730 ms 400 KB Output is correct
6 Partially correct 557 ms 504 KB Partially correct
7 Correct 613 ms 508 KB Output is correct
8 Correct 3 ms 468 KB Output is correct
9 Correct 5 ms 464 KB Output is correct
10 Correct 2 ms 468 KB Output is correct
11 Incorrect 565 ms 512 KB Wrong query response.
12 Halted 0 ms 0 KB -