Submission #305695

# Submission time Handle Problem Language Result Execution time Memory
305695 2020-09-23T19:55:15 Z arthurconmy Stations (IOI20_stations) C++14
0 / 100
1085 ms 1024 KB
#ifndef ARTHUR_LOCAL
	#include "stations.h"
#endif

#ifdef ARTHUR_LOCAL
	#include <bits/stdc++.h>
#endif

using namespace std;
using ll = long long;

vector<int> adj[1001];
bool vis[1001];
int curv;
int labellist[1001];

void dfs(int v)
{
	vis[v]=1;
	labellist[v]=curv++;

	for(auto u:adj[v])
	{
		if(!vis[u]) dfs(u);
	}
}

vector<int> label(int n, int k, vector<int> U, vector<int> V) 
{
	vector<int> ans;
	for(int i=0; i<n; i++) ans.push_back(i);
	return ans;
}

int find_next_station(int s, int t, vector<int> C) 
{
	vector<int> level(1001);
	level[0]=1;

	for(int i=0; i<=1000; i++)
	{
		if(2*i + 1 <= 1000) level[2*i + 1] = 1 + level[i];
		if(2*i + 2 <= 1000) level[2*i + 2] = 1 + level[i];
	}

	if(s > t) return int((s-1)/2);

	int ss=s;
	while(ss > t) ss = int((ss-1)/2);
	if(ss!=t) return C[0];

	ss=s;
	while(int((ss-1)/2)!=t) ss=int((ss-1)/2);
	return ss;
}
# Verdict Execution time Memory Grader output
1 Incorrect 700 ms 864 KB Wrong query response.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 519 ms 860 KB Wrong query response.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 621 ms 768 KB Wrong query response.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1085 ms 768 KB Output is correct
2 Incorrect 872 ms 1024 KB Wrong query response.
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 784 ms 768 KB Wrong query response.
2 Halted 0 ms 0 KB -