Precreation contest files

This commit is contained in:
2026-02-11 11:28:23 +07:00
parent 0a8ea477bb
commit cb9f7cab30
134 changed files with 1848 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
3
6
1 3 5 4 7 2
4
13 10 12 20
7
1 2 3 4 5 6 7

View File

@@ -0,0 +1,3 @@
100011
1101
1000001

View File

@@ -0,0 +1,40 @@
#include <iostream>
#include <vector>
using namespace std;
void min_maxer(vector<int> &_a, vector<int> &pre, vector<int> &stu,
vector<bool> &map) {
int n = _a.size();
map[0] = true;
map[n - 1] = true;
for (int i = 1; i < n; i++) {
if (_a[i] < _a[i - 1])
map[i] = true;
if (_a[n - i - 1] < _a[n - i - 2])
map[i] = true;
}
}
void solve() {
int n;
cin >> n;
vector<int> a(n);
for (auto &i : a)
cin >> i;
vector<int> min_prefix(n), max_stufix(n);
vector<bool> map(n);
min_maxer(a, min_prefix, max_stufix, map);
for (auto i : map)
cout << i;
cout << "\n";
}
int main() {
int t;
cin >> t;
while (t--)
solve();
}