随笔分类 - AtCoder
AtCoder Beginner Contest 053
摘要:A - ABC/ARC #include <bits/stdc++.h> using namespace std; using i64 = long long; int main() { ios::sync_with_stdio(false), cin.tie(nullptr); int x; ci
AtCoder Beginner Contest 052
摘要:A - Two Rectangles #include <bits/stdc++.h> using namespace std; using i64 = long long; int main() { ios::sync_with_stdio(false), cin.tie(nullptr); in
AtCoder Beginner Contest 051
摘要:A - Haiku 直接模拟。 #include <bits/stdc++.h> using namespace std; using i64 = long long; int main() { ios::sync_with_stdio(false), cin.tie(nullptr); strin
AtCoder Beginner Contest 049
摘要:A - UOIAUAI #include <bits/stdc++.h> using namespace std; using i64 = long long; int main() { ios::sync_with_stdio(false), cin.tie(nullptr); char c; c
AtCoder Beginner Contest 050
摘要:基本上独立做出来了。 A - Addition and Subtraction Easy 模拟。 #include <bits/stdc++.h> using namespace std; using i64 = long long; int main() { ios::sync_with_stdi
AtCoder Beginner Contest 048
摘要:A - AtCoder *** Contest 先输出首字母,然后遍历字符串,遇到空格就输出后面的第一个字符。 #include <bits/stdc++.h> using namespace std; using i64 = long long; int main() { ios::sync_wi
AtCoder Beginner Contest 047
摘要:A - Fighting over Candies 简单排序。 #include <bits/stdc++.h> using namespace std; using i64 = long long; int main() { ios::sync_with_stdio(false), cin.tie
AtCoder Beginner Contest 046
摘要:A - AtCoDeer and Paint Cans 可由 的性质轻松解决。 #include <bits/stdc++.h> using namespace std; using i64 = long long; int main() { ios::sync_with_s
AtCoder Beginner Contest 045
摘要:A - Trapezoids #include <bits/stdc++.h> using namespace std; using i64 = long long; int main() { ios::sync_with_stdio(false), cin.tie(nullptr); int a,
AtCoder Beginner Contest 044
摘要:A - Tak and Hotels (ABC Edit) #include <bits/stdc++.h> using namespace std; using i64 = long long; int main() { ios::sync_with_stdio(false), cin.tie(n
AtCoder Beginner Contest 043
摘要:D - Unbalanced 只需要找到形如 、 的字串即可。即两个相同字符之间最多间隔一个字符。 证明:若不然, ,每加一个字符 ,都要增加多余字符 ,不可能符合要求。 #include <bits/stdc++.h> using na
AtCoder Beginner Contest 042
摘要:C - Iroha's Obsession 用一个 数组把每一位标记,然后枚举大于 的数,一旦有各位都满足要求的数出现就 。 #include <bits/stdc++.h> using namespace std; using i64 =
Atcoder Beginner Contest 356
摘要:A - Subsegment Reverse #include <bits/stdc++.h> using namespace std; using i64 = long long; int main() { ios::sync_with_stdio(false), cin.tie(nullptr)
Atcoder Beginner Contest 355
摘要:A - Who Ate the Cake? #include <bits/stdc++.h> using namespace std; using i64 = long long; int main() { ios::sync_with_stdio(false), cin.tie(nullptr);
Atcoder Beginner Contest 354
摘要:A - Exponential Plant #include <bits/stdc++.h> using namespace std; using i64 = long long; int main() { ios::sync_with_stdio(false), cin.tie(nullptr);
ABC 288 D - Range Add Query
摘要:题目链接: 设 表示下标对 取模为 的所有数的和。那每次操作就是将数组 的所有数都加 。最终为 的充分必要条件就是 的所有数都是一样的。 因此,对于每组询问,统计 中数字下标对 取
ABC 288 C - Don't be cycle
摘要:题目链接: 题目大意:给定一个简单无向图,要求删除最小的边数(可以不删)使得图中没有环。 每增加一条边,看这条边的端点 、 是否在一个连通块中,在的话就答案 (属于废边),否则将连通块合并。 #include <bits/stdc++.h> using namespa
ABC 287 E - Karuta
摘要:题目链接: 方法一、 由于 表示两字符串最长公共前缀的长度,首先第一反应就是字典树。 这题比较特殊,需要对每一个字符串求解其对其他所有字符串最长公共前缀的最大值。 思路:先将所有字符串插入字典树中,然后对于每个字符串,忽略字典树里它独有的结点
ABC 287 D - Match or Not
摘要:题目链接: 第一次提交:依据题意直接模拟,喜提 。 #include <bits/stdc++.h> using namespace std; bool check(string a, string b) { for (int i = 0; i < a.size(); i++)
ABC 287 B - Postal Card
摘要:题目链接: 由于是可以和 的多个字符串相同而仅计数一次,考虑把 中的字符串用 存储已达到去重的目的。 注: 的 返回 表示找到了该元素,返回 则说明没找到。 #include <