Submission #305339

# Submission time Handle Problem Language Result Execution time Memory
305339 2020-09-23T00:51:15 Z daniel920712 Stations (IOI20_stations) C++14
8 / 100
873 ms 1008 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.push_back(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 Incorrect 538 ms 856 KB Wrong query response.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 457 ms 860 KB Output is correct
2 Correct 540 ms 768 KB Output is correct
3 Correct 854 ms 884 KB Output is correct
4 Correct 664 ms 880 KB Output is correct
5 Correct 581 ms 1008 KB Output is correct
6 Correct 433 ms 868 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 514 ms 768 KB Wrong query response.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 873 ms 888 KB Output is correct
2 Incorrect 647 ms 892 KB Wrong query response.
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 521 ms 856 KB Wrong query response.
2 Halted 0 ms 0 KB -