Submission #1145247

#TimeUsernameProblemLanguageResultExecution timeMemory
1145247lucaskojimaGondola (IOI14_gondola)C++17
Compilation error
0 ms0 KiB
#include "bits/stdc++.h"
#define ff first
#define ss second
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x).size()

using namespace std;
using ll = long long;
using pii = pair<int, int>;

const char nl = '\n';
const ll LINF = 0x3f3f3f3f3f3f3f3f;
const int INF = 0x3f3f3f3f;

bool valid(int N, int V[]) {
	int n = N;
	vector<int> v(n);
	for (int i = 0; i < n; i++)
		v[i] = V[i];

	int p = 0;
	while (p < n && v[p] > n) p++;

	if (p == n) return 1;

	int val = v[p];
	for (int i = p; i < n; i++) {
		if (v[i] < n && v[i] != val)
			return 0;

		val == n ? val = 1 : val++;
	}

	return 1;
}

Compilation message (stderr)

/usr/bin/ld: /tmp/ccrMWxth.o: in function `main':
grader.cpp:(.text.startup+0xae): undefined reference to `valid'
/usr/bin/ld: grader.cpp:(.text.startup+0x108): undefined reference to `countReplacement'
/usr/bin/ld: grader.cpp:(.text.startup+0x135): undefined reference to `replacement'
collect2: error: ld returned 1 exit status