#include "worldmap.h"
#include <algorithm>
#include <iostream>
std::vector<std::vector<int>> test(int N) {
std::vector<std::vector<int>> ans(2 * N, std::vector<int>(2 * N, 1));
return ans;
}
std::vector<std::vector<int>> solve_subtask1(int N, int M, std::vector<int> A, std::vector<int> B) {
int K = (N+2)/2;
std::vector<std::vector<int>> ans(K, std::vector<int>(K, 0));
for (int i=0; i<K; i++) {
int x = i+1;
for (int j=0; j<K; j++, x++) {
ans[i][j] = std::min(x, N);
}
}
return ans;
}
std::vector<std::vector<int>> solve_subtask2(int N, int M, std::vector<int> A, std::vector<int> B) {
return test(N);
}
std::vector<std::vector<int>> solve_subtask3(int N, int M, std::vector<int> A, std::vector<int> B) {
return test(N);
}
std::vector<std::vector<int>> solve_subtask4(int N, int M, std::vector<int> A, std::vector<int> B) {
return test(N);
}
std::vector<std::vector<int>> solve_subtask5(int N, int M, std::vector<int> A, std::vector<int> B) {
return test(N);
}
std::vector<std::vector<int>> solve_subtask6(int N, int M, std::vector<int> A, std::vector<int> B) {
return test(N);
}
std::vector<std::vector<int>> create_map(int N, int M, std::vector<int> A, std::vector<int> B) {
bool subtask1_constraint = true;
for (int i = 0; i < M; i++) {
if (A[i] == i+1 && B[i] == i+2) continue;
subtask1_constraint = false;
}
std::vector<int> temp;
for (int i = 0; i < M; i++) {
if (A[i] == 1) temp.push_back(B[i]);
}
bool subtask4_constraint = temp.size() == N-1;
if (M == N-1 && subtask1_constraint) {
return solve_subtask1(N, M, A, B);
} else if (M == N-1) {
return solve_subtask2(N, M, A, B);
} else if (M == N*(N-1)/2) {
return solve_subtask3(N, M, A, B);
} else if (subtask4_constraint) {
return solve_subtask4(N, M, A, B);
} else if (N <= 15) {
return solve_subtask5(N, M, A, B);
} else {
return solve_subtask6(N, M, A, B);
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |