Submission #413190

# Submission time Handle Problem Language Result Execution time Memory
413190 2021-05-28T11:01:04 Z losmi247 Stations (IOI20_stations) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1005;

int deg[N];




int *label(int n,int k,int *u,int *v){
    bool prvi = 1;
    for(int i = 0; i < n-1; i++) deg[u[i]]++, deg[v[i]]++;
    for(int i = 0; i < n; i++) if(deg[i] > 2) prvi = 0;
    if(prvi){
        int *l = (int*)malloc(sizeof(int)*n);
        for(int i = 0; i < n; i++) l[i] = i;
        return l;
    }
}

int find_next_station(int s,int t,int *c){
    if(s < t){
        return s+1;
    }
    else{
        return s-1;
    }
}

Compilation message

stations.cpp: In function 'int* label(int, int, int*, int*)':
stations.cpp:20:1: warning: control reaches end of non-void function [-Wreturn-type]
   20 | }
      | ^
/usr/bin/ld: /tmp/cctzTFiA.o: in function `main':
stub.cpp:(.text.startup+0x2b5): undefined reference to `label(int, int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
/usr/bin/ld: stub.cpp:(.text.startup+0x4cc): undefined reference to `find_next_station(int, int, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status