Submission #162956

#TimeUsernameProblemLanguageResultExecution timeMemory
162956MinnakhmetovHighway Tolls (IOI18_highway)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;

mt19937 rnd(time(0));

int ri(int l, int r) {
	return rnd() % (r - l + 1) + l;
}

int main() {
	freopen("input.txt", "w", stdout);

	int n, m, a, b, s, t;
	n = 6;
	m = 12;
	a = 1;
	b = 2;
	t = s = ri(0, n - 1);
	while (t == s)
		t = ri(0, n - 1);

	cout << n << " " << m << " " << a << " " << b << " " << s << " " << t << "\n";

	for (int i = 1; i < n; i++) {
		cout << ri(0, i - 1) << " " << i << "\n";
	}

	for (int i = 0; i < m - n + 1; i++) {
		int x = 0, y = 0;
		while (x == y) {
			x = ri(0, n - 1);
			y = ri(0, n - 1);
		}
		cout << x << " " << y << "\n";
	}
}

Compilation message (stderr)

highway.cpp: In function 'int main()':
highway.cpp:11:9: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
  freopen("input.txt", "w", stdout);
  ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/ccqIQhC7.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/cch0ynIb.o:highway.cpp:(.text.startup+0x0): first defined here
/tmp/ccqIQhC7.o: In function `main':
grader.cpp:(.text.startup+0x125): undefined reference to `find_pair(int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >, int, int)'
collect2: error: ld returned 1 exit status