Submission #377813

# Submission time Handle Problem Language Result Execution time Memory
377813 2021-03-15T07:36:19 Z autumn_eel Stations (IOI20_stations) C++14
0 / 100
988 ms 756 KB
#include "stations.h"
#include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<int(n);i++)
using namespace std;
typedef long long ll;

std::vector<int> label(int n, int k, std::vector<int> u, std::vector<int> v) {
	vector<int>labels(n);
	rep(i,n)labels[i]=i;
	return labels;
	/*
	vector<vector<int>>E(n);
	vector<int>deg(n);
	rep(i,n-1){
		E[u[i]].push_back(v[i]);
		E[v[i]].push_back(u[i]);
		deg[u[i]]++;
		deg[v[i]]++;
	}
	int s=-1;
	rep(i,n){
		if(deg[i]==1){s=i;break;}
	}
	vector<int>vs;
	vector<int>labels(n,-1);

	rep(i,n){
		vs.push_back(s);
		labels[s]=i;
		for(int u:E[s]){
			if(labels[u]==-1){
				s=u;break;
			}
		}
	}

	return labels;*/
}

bool find(int r,int x){
	int L=r,R=r;
	while(r<=2000){
		if(L<=x&&x<=R)return true;
		L=L*2+1;
		R=R*2+2;
	}
	return false;
}

int find_next_station(int s, int t, std::vector<int> c) {
	if(find(s*2+1,t))return s*2+1;
	if(find(s*2+2,t))return s*2+2;
	return (s-1)/2;
}
# Verdict Execution time Memory Grader output
1 Incorrect 593 ms 756 KB Wrong query response.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 558 ms 756 KB Wrong query response.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 688 ms 736 KB Wrong query response.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 988 ms 756 KB Wrong query response.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 558 ms 756 KB Wrong query response.
2 Halted 0 ms 0 KB -