feat: new Divide and Conquer problem partialy formated.

This commit is contained in:
2026-02-23 22:51:03 -03:00
parent 81a0762a86
commit b9a96ddc83
18 changed files with 6517 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
#include <bits/stdc++.h>
using namespace std;
int main(){
// TODO
cout << 0 << endl;
return 0;
}

View 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;
}

View 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;
}

View File

@@ -0,0 +1 @@
generator

File diff suppressed because it is too large Load Diff

View 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;
}