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

20
misc/mysterious/bai1.cpp Normal file
View File

@@ -0,0 +1,20 @@
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
freopen("bai1.inp", "r", stdin);
int min_gcd, n;
cin >> n >> min_gcd;
n--;
int prod = n;
while (n--) {
int x;
cin >> x;
min_gcd = lcm(min_gcd, x);
}
cout << min_gcd << '\n';
}

2
misc/mysterious/bai1.inp Normal file
View File

@@ -0,0 +1,2 @@
3
4 2 8

0
misc/mysterious/bai2.cpp Normal file
View File

1
misc/mysterious/bai2.inp Normal file
View File

@@ -0,0 +1 @@
abc3456789PQ

0
misc/mysterious/cpp.cpp Normal file
View File

BIN
misc/mysterious/cpp.out Executable file

Binary file not shown.

0
misc/mysterious/nhap Normal file
View File

37
misc/mysterious/tgc.cpp Normal file
View File

@@ -0,0 +1,37 @@
#include <bits/stdc++.h>
using namespace std;
int a[500000];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
freopen("tgc.inp", "r", stdin);
int n;
cin >> n;
for (int i = 0; i < n; i++)
cin >> a[i];
sort(a, a + n);
int res = 0;
for (int i = 0; i < n - 1; i++) {
if (a[i] != a[i + 1])
continue;
int l = i, r = n - 1;
int mid;
while (l < r) {
mid = (l + r) / 2;
if (a[mid] < 2 * a[i]) {
l = mid + 1;
} else {
r = mid;
}
}
res += r - mid + l;
}
cout << res << "\n";
}

2
misc/mysterious/tgc.inp Normal file
View File

@@ -0,0 +1,2 @@
8
5 3 2 9 5 4 9 5