251007cch模拟赛总结
太好了我爆零了哈哈哈:)
10 + 20 + 0 + 0 = 30
比dmy还惨qwq
A - home
我找规律太菜了qwq
我找规律太菜了qwq
我找规律太菜了qwq
我找规律太菜了qwq
我找规律太菜了qwq
我找规律太菜了qwq
我找规律太菜了qwq
我找规律太菜了qwq
我找规律太菜了qwq
把
写出来之后样例过了,发现没有大样例,然后想对拍结果暴力只能跑出
这时已经过去了
然后就只过了
#include <bits/stdc++.h>
#define LL long long
using namespace std;
int n;
void out (int x, int y, int z) {
int a[3] = {x, y, z};
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
if (i == j) continue;
for (int k = 0; k < 3; k++) {
if (k == i || k == j) continue;
cout << a[i] << ' ' << a[j] << ' ' << a[k] << '\n';
}
}
}
}
void qwq (int x, int y) {
for (int i = 1; i < 4; i++) {
for (int j = 1; j < 4; j++) {
if (i == j) {
cout << y << ' ';
} else {
cout << x << ' ';
}
}
cout << '\n';
}
}
int main () {
freopen("home.in", "r", stdin);
freopen("home.out", "w", stdout);
cin >> n;
if (n == 1) {
cout << "3\n";
qwq(0, 1);
return 0;
}
if (n & 1) {
cout << n * 3 + 3 << '\n';
} else {
cout << n * 3 + 1 << '\n';
}
for (int i = 0; i < n / 2; i++) {
out(i, n / 2, n - i);
}
if (n & 1) {
qwq(n / 2 + 1, 0);
qwq(n / 2, n / 2 + 1);
} else {
cout << n / 2 << ' ' << n / 2 << ' ' << n / 2;
}
return 0;
}
/*
bu zha wo chi
*/
B - connect
首先想到按质量存长度,然而只能过
然后想到如果固定了一个端点,那么另一个端点要么是整的段要么就是
然后想到了三分,发现不行,又想到二分,然后感觉像二分
然后就不知道怎么
所以就写了
#include <bits/stdc++.h>
#define LL long long
using namespace std;
const int N = 3e5 + 5;
LL n, l, r, cnt;
double b[N], s[N], ans;
struct aa {
double l, p;
} a[N];
int main () {
freopen("connect.in", "r", stdin);
freopen("connect.out", "w", stdout);
cin >> n >> l >> r;
for (int i = 1; i <= n; i++) {
cin >> a[i].l;
}
for (int i = 1; i <= n; i++) {
cin >> a[i].p;
for (int j = 1; j <= a[i].l * a[i].p; j++) {
b[++cnt] = 1.0 / a[i].p;
s[cnt] = s[cnt - 1] + b[cnt];
}
}
for (int i = 1; i + l - 1 <= cnt; i++) {
for (int j = i + l - 1; j <= i + r - 1; j++) {
ans = max(ans, 1.0 * (j - i + 1) / (s[j] - s[i - 1]));
// cout << i << ' ' << j << ' ' << s[j] << ' ' << s[i - 1] << ' ' << ans << '\n';
}
}
cout << fixed << setprecision(9) << ans;
return 0;
}
C - lone
时间不多了,想打
#include <bits/stdc++.h>
#define LL long long
using namespace std;
const int N = 110;
int n, k, a[10], sz[N], vis[N], f[N], fa[N];
set <int> v[N], s[N];
void qwq (int x, int ff) {
fa[x] = ff;
for (int i : v[x]) {
if (i == ff) continue;
qwq(i, x);
}
}
void dfs (int x) {
if (x > k) {
for (int i = 1; i <= n; i++) {
s[i] = v[i];
}
}
}
int main () {
freopen("lone.in", "r", stdin);
freopen("lone.out", "w", stdout);
// cin >> n;
cout << 0;
return 0;
// for (int i = 1, x, y; i < n; i++) {
// cin >> x >> y;
// v[x].insert(y);
// v[y].insert(x);
// }
// cin >> k;
// for (int i = 1; i <= k; i++) {
// cin >> a[i];
// }
// qwq(1, 0);
// dfs(1);
}
/*
mei shi jian le mei shi jian le mei shi jian le mei shi jian le mei shi jian le mei shi jian le mei shi jian le
15 fen dou na bu dao qwq
*/
D - station
#include <bits/stdc++.h>
#define LL long long
using namespace std;
int main () {
freopen("station.in", "r", stdin);
freopen("station.out", "w", stdout);
cout << -1;
return 0;
}
/*
tai hao le, kan bu dong ti :)
zi tu shi shem me
shi n ge dou dao da 1 ge, hai shi n ge dou neng dao da ren yi 1 ge?
*/