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

Binary file not shown.

View File

@@ -0,0 +1,6 @@
5
2
4
5
7
100

View File

@@ -0,0 +1,5 @@
Alice
Bob
Alice
Alice
Bob

View File

@@ -0,0 +1,16 @@
#include <iostream>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
if (!(n & ((1 << 2) - 1)))
cout << "Bob\n";
else
cout << "Alice\n";
}
}

Binary file not shown.

View File

@@ -0,0 +1,7 @@
3
5 2 3
3 2 4 4 1
5 4 1
5 3 4 5 2
6 1 1
1 2 3 4 5 6

View File

@@ -0,0 +1,3 @@
YES
YES
NO

View File

@@ -0,0 +1,30 @@
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
void solve() {
int n, j, k;
cin >> n >> j >> k;
vector<int> a(n);
for (auto &i : a)
cin >> i;
if (a[j - 1] == *max_element(a.begin(), a.end())) {
cout << "YES\n";
return;
}
if (k >= 2)
cout << "YES\n";
else
cout << "NO\n";
}
int main() {
int t;
cin >> t;
while (t--)
solve();
}

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();
}

View File

@@ -0,0 +1,11 @@
5
5
1 0 0 1 2
6
3 2 0 4 5 1
6
1 2 0 1 3 2
4
0 3 4 1
5
0 0 0 0 0

View File

@@ -0,0 +1,5 @@
1 2 4 3 2 1
1 6 5 4 3 2 1
1 3 5 4 3 2 1
1 3 3 2 1
1 1 1 1 1 1

View File

@@ -0,0 +1,31 @@
#include "iostream"
#include <map>
using namespace std;
void solve() {
int n, x;
cin >> n;
map<int, int> hash_map;
for (int i = 0; i < n; i++) {
cin >> x;
if (hash_map.count(x) == 0)
hash_map[x] = 1;
else
hash_map[x]++;
}
for (int k = 0; k <= n; k++) {
int cur_mex = 0;
for (auto &i : hash_map) {
}
}
}
int main() {
int t;
cin >> t;
while (t--)
solve();
}