Codeforces - 1139C - Edgy Trees
地址 https://codeforces.com/contest/1139/problem/C 原文地址 https://www.lucien.ink/archives/408 题解 容斥一下。 代码 https://pasteme.cn/4939 ## include <bits/stdc++.h> typedef long long ll; const in...
地址 https://codeforces.com/contest/1139/problem/C 原文地址 https://www.lucien.ink/archives/408 题解 容斥一下。 代码 https://pasteme.cn/4939 ## include <bits/stdc++.h> typedef long long ll; const in...
地址 https://codeforces.com/contest/1139/problem/B 原文地址 https://www.lucien.ink/archives/407 题意 你有 $n$ 堆物品,第 $i$ 堆物品有 $a_i$ 个,如果你要从第 $i$ 堆物品中取走 $x_i$ 个,那么对于 $1 \leq j < i$ ,必须满足 $x_j < x_i ...
地址 https://codeforces.com/contest/1139/problem/A 原文地址 https://www.lucien.ink/archives/406/ 题意 给你一个只包含数字的字符串,问有多少个子串是偶数。 代码 https://pasteme.cn/4937 ## include <bits/stdc++.h> typedef l...
## include <iostream> ## include <thread> ## include <vector> ## include <algorithm> ## include <functional> int main() { std::vector<std::thread> threads; ...
https://pasteme.cn/4452 scp -P <port> <local_file_path> <username>@<remote>:<remote_file_path> # 本地向远端拷贝 scp -P <port> <username>@<remote>:<remot...
地址 https://codeforces.com/contest/1098/problem/C 原文地址 https://www.lucien.ink/archives/402/ 题意 能否构造出一棵 $n$ 个节点的树,使得以每个点为根的子树的 $size$ 加起来等于 $s$ ,如果能,输出使得儿子最多的点的儿子数目最少的那种。 题解 不难看出,以每个点为根的子树的 $s...
地址 https://codeforces.com/contest/1098/problem/B 原文地址 https://www.lucien.ink/archives/401/ 题意 给你一个表格,上面只有四种字符 $ATCG$ 。 你可以把任意位置上的字符替换成这四种中的一种,问所有满足在替换之后对于每个 $2 \cdot 2$ 的正方形四种字符全部都出现的表格中,且和原表...
地址 https://codeforces.com/contest/1098/problem/A 原文地址 https://www.lucien.ink/archives/400/ 题意 给出一棵有点权的树,跟节点深度为 $1$ ,现在你只知道深度为奇数的点到数根的路经权值和,让你给所有点都分配一个非负的权值,满足所给和,且所有点权的和最小。如果不存在输出 $-1$ 。 题解 ...
牛客小白月赛 12 比赛地址:https://ac.nowcoder.com/acm/contest/392 A 华华听月月唱歌 按左端点排序之后贪心。 https://pasteme.cn/4381 ## include <bits/stdc++.h> const int maxn = int(1e5) + 7; struct Seg { int l, r; ...
以下所有指令基于 $macOS$ ,$Linux$ 类似。 挂载远程目录到本地 sshfs -p <port> -C -o reconnect <user>@<hostname>:<remote_dir> <local_dir> ## <port> 端口号 ## <user> 用户名 ## <ho...