Submission #1039802

# Submission time Handle Problem Language Result Execution time Memory
1039802 2024-07-31T09:26:59 Z vjudge1 Fountain Parks (IOI21_parks) C++17
5 / 100
45 ms 9032 KB
#include "parks.h"
#include <bits/stdc++.h>
using namespace std;
int construct_roads(std::vector<int> x, std::vector<int> y) {
	vector<pair<pair<int,int>, int>> p;
	int n = x.size();
	for(int i = 0;i<n;i++) {
		p.push_back({{y[i], x[i]}, i});
	}
	sort(p.begin(), p.end());
	vector<int> u, v, a, b;
	for(int i = 1;i<n;i++) {
		if(p[i].first.first == p[i-1].first.first+2) {
			u.push_back(p[i-1].second);
			v.push_back(p[i].second);
			a.push_back(p[i].first.second+1);
			b.push_back(p[i].first.first-1);
		}
		else {
			return 0;
		}
	}
	build(u, v, a, b);
	return 1;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 436 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 41 ms 9032 KB Output is correct
10 Correct 3 ms 1312 KB Output is correct
11 Correct 16 ms 4940 KB Output is correct
12 Correct 5 ms 1648 KB Output is correct
13 Correct 6 ms 2520 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 1 ms 464 KB Output is correct
16 Correct 37 ms 8952 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 436 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 41 ms 9032 KB Output is correct
10 Correct 3 ms 1312 KB Output is correct
11 Correct 16 ms 4940 KB Output is correct
12 Correct 5 ms 1648 KB Output is correct
13 Correct 6 ms 2520 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 1 ms 464 KB Output is correct
16 Correct 37 ms 8952 KB Output is correct
17 Incorrect 0 ms 348 KB Solution announced impossible, but it is possible.
18 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 436 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 41 ms 9032 KB Output is correct
10 Correct 3 ms 1312 KB Output is correct
11 Correct 16 ms 4940 KB Output is correct
12 Correct 5 ms 1648 KB Output is correct
13 Correct 6 ms 2520 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 1 ms 464 KB Output is correct
16 Correct 37 ms 8952 KB Output is correct
17 Incorrect 0 ms 348 KB Solution announced impossible, but it is possible.
18 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 436 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 41 ms 9032 KB Output is correct
10 Correct 3 ms 1312 KB Output is correct
11 Correct 16 ms 4940 KB Output is correct
12 Correct 5 ms 1648 KB Output is correct
13 Correct 6 ms 2520 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 1 ms 464 KB Output is correct
16 Correct 37 ms 8952 KB Output is correct
17 Incorrect 0 ms 348 KB Solution announced impossible, but it is possible.
18 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 436 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 41 ms 9032 KB Output is correct
10 Correct 3 ms 1312 KB Output is correct
11 Correct 16 ms 4940 KB Output is correct
12 Correct 5 ms 1648 KB Output is correct
13 Correct 6 ms 2520 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 1 ms 464 KB Output is correct
16 Correct 37 ms 8952 KB Output is correct
17 Incorrect 45 ms 8908 KB Solution announced impossible, but it is possible.
18 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 436 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 41 ms 9032 KB Output is correct
10 Correct 3 ms 1312 KB Output is correct
11 Correct 16 ms 4940 KB Output is correct
12 Correct 5 ms 1648 KB Output is correct
13 Correct 6 ms 2520 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 1 ms 464 KB Output is correct
16 Correct 37 ms 8952 KB Output is correct
17 Incorrect 0 ms 348 KB Solution announced impossible, but it is possible.
18 Halted 0 ms 0 KB -