Submission #411739

# Submission time Handle Problem Language Result Execution time Memory
411739 2021-05-25T20:15:47 Z AKaan37 Stations (IOI20_stations) C++17
Compilation error
0 ms 0 KB
#include "stations.h"
#include <bits/stdc++.h>

using namespace std;

typedef long long lo; 
typedef pair< lo,lo > PII;

#define fi first
#define se second
#define mp make_pair
#define endl "\n"
#define pb push_back
#define fio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define FOR for(int i=1;i<=n;i++)
#define mid ((start+end)/2)
#define ort ((bas+son)/2)

const lo inf = 1000000000000000000;
const lo KOK = 100000;
const lo LOG = 30;
const lo li = 1005;
const lo mod = 1000000007;

vector<int> vec[li],vv;
int dp[li];

std::vector<int> label(int n, int k, std::vector<int> u, std::vector<int> vvv) {
	std::vector<int> labels(n);
	for (int i = 0; i < n; i++) {
		//~ cout<<vv[i]<<endl;
		labels[i] = i;
	}
	return labels;
}

inline int f(int sira,int hedef){
	int cevv=0;
	if(sira>hedef)return 0;
	if(sira==hedef)return 1;
	if(~dp[sira])return dp[sira];
	cevv=max(cevv,f(sira*2+1,hedef));
	cevv=max(cevv,f(sira*2+2,hedef));
	return dp[sira]=cevv;
}

int find_next_station(int s, int t, std::vector<int> c) {
	//~ memset(dp,-1,sizeof(dp));
	//~ cout<<s<<" :: "<<t<<" :: "<<c[0]<<" :: "<<c[1]<<endl;
	if(((int)c.size()==1)return c[0];
	if((int)c.size()==2){
		while(t>c[0] && t>c[1]){
			if(t%2)t--;
			else t-=2;
			t/=2;
		}
		return t;
	}
	while(t>c[0] && t>c[1] && t>c[2]){
		if(t%2)t--;
		else t-=2;
		t/=2;
	}
	return t;
	return c[0];
}

Compilation message

stations.cpp: In function 'int find_next_station(int, int, std::vector<int>)':
stations.cpp:50:23: error: expected ';' before 'return'
   50 |  if(((int)c.size()==1)return c[0];
      |                       ^~~~~~
      |                       ;
stations.cpp:51:2: error: expected primary-expression before 'if'
   51 |  if((int)c.size()==2){
      |  ^~
stations.cpp:50:35: error: expected ')' before 'if'
   50 |  if(((int)c.size()==1)return c[0];
      |    ~                              ^
      |                                   )
   51 |  if((int)c.size()==2){
      |  ~~