Submission #305338

# Submission time Handle Problem Language Result Execution time Memory
305338 2020-09-23T00:50:47 Z daniel920712 Stations (IOI20_stations) C++14
0 / 100
1 ms 504 KB
#include "stations.h"
#include <vector>
using namespace std;
vector < int > Next[1005];
int con[1005]={0};
int ans[1005]={0};
bool use[1005]={0};

void F(int here,int con)
{
    ans[here]=con;
    use[here]=1;
    for(auto i:Next[here])
    {
        if(!use[i]) F(i,con+1);
    }
}

vector<int> label(int n, int k, vector<int> u, vector<int> v)
{
    vector<int> labels;
    /*int i;
	for(i=0;i<n;i++)
    {
        labels.push_back(0);
        Next[i].clear();
        con[i]=0;
        use[i]=0;
    }
	for(int i=0;i<n-1;i++)
    {
        con[u[i]]++;
        con[v[i]]++;
        Next[u[i]].push_back(v[i]);
        Next[v[i]].push_back(u[i]);
    }
	for(i=0;i<n;i++)
    {
        if(con[i]==1)
        {
            F(i,0);
            break;
        }
    }*/
    int i;
    for(i=0;i<n;i++) labels[i]=i;
	return labels;
}

int find_next_station(int s, int t, vector<int> c)
{
    while(t>0)
    {
        if(t==2*s+1) return t;
        if(t==2*s+2) return t;
        t=(t-1)/2;
    }
    return (s-1)/2;
}
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 384 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 384 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 376 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 384 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -