feat: new Divide and Conquer problem partialy formated.
This commit is contained in:
10
dominancia-de-pontos/src/ac.cpp
Normal file
10
dominancia-de-pontos/src/ac.cpp
Normal file
@@ -0,0 +1,10 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
int main(){
|
||||
// TODO
|
||||
cout << 0 << endl;
|
||||
return 0;
|
||||
}
|
||||
18
dominancia-de-pontos/src/checker.cpp
Normal file
18
dominancia-de-pontos/src/checker.cpp
Normal file
@@ -0,0 +1,18 @@
|
||||
#include "testlib.h"
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
setName("compare two numbers");
|
||||
registerTestlibCmd(argc, argv);
|
||||
long long ja = ans.readLong();
|
||||
long long pa = ouf.readLong();
|
||||
|
||||
if (ja != pa)
|
||||
quitf(_wa, "expected %lld, found %lld", ja, pa);
|
||||
|
||||
quitf(_ok, "answer is %lld", ja);
|
||||
|
||||
return 0;
|
||||
}
|
||||
93
dominancia-de-pontos/src/generator.cpp
Normal file
93
dominancia-de-pontos/src/generator.cpp
Normal file
@@ -0,0 +1,93 @@
|
||||
#include "testlib.h"
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
const int MIN_N = 1;
|
||||
const int MAX_N = 1e5;
|
||||
const int MIN_COORD = -1e9;
|
||||
const int MAX_COORD = 1e9;
|
||||
|
||||
const int rnd_test_n = 30;
|
||||
|
||||
template <typename T> void append(vector<T> &dest, const vector<T> &orig) {
|
||||
dest.insert(dest.end(), orig.begin(), orig.end());
|
||||
}
|
||||
|
||||
string output_tc(const vector<pair<int, int>> &coords) {
|
||||
ostringstream oss;
|
||||
oss << coords.size() << endl;
|
||||
for (const auto [x, y] : coords) {
|
||||
oss << x << " " << y << endl;
|
||||
}
|
||||
return oss.str();
|
||||
}
|
||||
|
||||
vector<string> generate_sample_tests() {
|
||||
vector<string> tests;
|
||||
tests.push_back(output_tc({{1, 1}, {2, 2}, {3, 3}}));
|
||||
return tests;
|
||||
}
|
||||
|
||||
vector<string> generate_manual_tests() {
|
||||
vector<string> tests;
|
||||
tests.push_back(output_tc({{1, 1}}));
|
||||
return tests;
|
||||
}
|
||||
|
||||
vector<pair<int,int>> generate_random_coords_array(int size) {
|
||||
vector<pair<int, int>> coords(size);
|
||||
for (int i = 0; i < size; i++) {
|
||||
coords[i].first = rnd.next(MIN_COORD, MAX_COORD);
|
||||
coords[i].second = rnd.next(MIN_COORD, MAX_COORD);
|
||||
}
|
||||
return coords;
|
||||
}
|
||||
|
||||
string rnd_test(int i){
|
||||
int min_n = MIN_N;
|
||||
int max_n = MAX_N;
|
||||
|
||||
if(i<rnd_test_n / 3){
|
||||
max_n = 50;
|
||||
}
|
||||
else if(i<rnd_test_n / 2){
|
||||
max_n = 500;
|
||||
}
|
||||
|
||||
int n = rnd.next(min_n, max_n);
|
||||
return(output_tc(generate_random_coords_array(n)));
|
||||
}
|
||||
|
||||
vector<string> generate_random_tests() {
|
||||
vector<string> tests;
|
||||
for (int i = 0; i < rnd_test_n; i++){
|
||||
tests.push_back(rnd_test(i));
|
||||
}
|
||||
return tests;
|
||||
}
|
||||
|
||||
string extreme_test_1(){
|
||||
return(output_tc(generate_random_coords_array(MAX_N)));
|
||||
}
|
||||
|
||||
vector<string> generate_extreme_tests(){
|
||||
vector<string> tests;
|
||||
tests.push_back(extreme_test_1());
|
||||
return tests;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
registerGen(argc, argv, 1);
|
||||
vector<string> tests;
|
||||
size_t test = 0;
|
||||
append(tests, generate_sample_tests());
|
||||
append(tests, generate_manual_tests());
|
||||
append(tests, generate_random_tests());
|
||||
append(tests, generate_extreme_tests());
|
||||
for (const auto &t : tests) {
|
||||
startTest(++test);
|
||||
cout << t;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
1
dominancia-de-pontos/src/script.sh
Normal file
1
dominancia-de-pontos/src/script.sh
Normal file
@@ -0,0 +1 @@
|
||||
generator
|
||||
5963
dominancia-de-pontos/src/testlib.h
Normal file
5963
dominancia-de-pontos/src/testlib.h
Normal file
File diff suppressed because it is too large
Load Diff
23
dominancia-de-pontos/src/validator.cpp
Normal file
23
dominancia-de-pontos/src/validator.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
#include "testlib.h"
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
const int MIN_N = 1;
|
||||
const int MAX_N = 1e5;
|
||||
const int MIN_COORD = -1e9;
|
||||
const int MAX_COORD = 1e9;
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
registerValidation(argc, argv);
|
||||
int n = inf.readInt(MIN_N, MAX_N, "n");
|
||||
inf.readEoln();
|
||||
for (int i = 0; i < n; i++) {
|
||||
inf.readInt(MIN_COORD, MAX_COORD, "xi");
|
||||
inf.readSpace();
|
||||
inf.readInt(MIN_COORD, MAX_COORD, "yi");
|
||||
inf.readEoln();
|
||||
}
|
||||
inf.readEof();
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user