摘要: A - Two Abbreviations 答案要么就是 \(\operatorname{lcm}(n,m)\) 要么就是 \(-1\)。判断下 \(\operatorname{lcm}(n,m)\) 是否合法就是了。 #include<iostream> #include<cstdio> usin 阅读全文
posted @ 2023-09-27 18:55 Zhou_JK 阅读(13) 评论(0) 推荐(0)
摘要: A - Irreversible operation 对于某个 W 的位置,它的贡献即为前面 B 的个数,直接搞就完事了。 #include<iostream> #include<cstdio> #include<cstring> using namespace std; const int N=2 阅读全文
posted @ 2023-09-27 18:54 Zhou_JK 阅读(44) 评论(0) 推荐(0)
摘要: A - Poisonous Cookies 解毒的饼干肯定所有都吃,剩下的算一下最多能吃多少毒饼干就好了。 #include<iostream> #include<cstdio> using namespace std; int A,B,C; int main() { scanf("%d%d%d", 阅读全文
posted @ 2023-09-27 18:53 Zhou_JK 阅读(10) 评论(0) 推荐(0)
摘要: A - Colorful Subsequence 可以发现每个字符选哪个是独立的,每个字符可以选择任意一个或者不选,令 \(c_{\texttt{a}}\) 表示 \(\texttt{a}\) 出现的次数,答案即为 \(\left(\sum\limits_{i=\texttt{a}}^{\textt 阅读全文
posted @ 2023-09-27 18:53 Zhou_JK 阅读(21) 评论(0) 推荐(0)
摘要: A - Limited Insertion 考虑从后往前做,插数变成了删数。可以发现,我们可以删去的只有 \(a_i=i\) 的数,如果有多个肯定删最后面的是最优的,因为这样影响到的数最少。每次扫一遍找出删什么数即可。 #include<iostream> #include<cstdio> usin 阅读全文
posted @ 2023-09-27 18:52 Zhou_JK 阅读(14) 评论(0) 推荐(0)
摘要: A - Darker and Darker 从 # 向外广搜即可。 #include<iostream> #include<cstdio> #include<cstring> #include<queue> using namespace std; const int N=1005; const i 阅读全文
posted @ 2023-09-27 18:52 Zhou_JK 阅读(13) 评论(0) 推荐(0)
摘要: Kenken Race 可以分成两种情况: 当 \(A\leq B\leq C\leq D\) 时,先让 \(B\) 到 \(D\),在让 \(A\) 到 \(C\); 当 \(A\leq B\leq D\leq C\) 时,判断一下 \(B\to D\) 是否有三个连续的 .。 然后判断一下 \( 阅读全文
posted @ 2023-09-27 18:52 Zhou_JK 阅读(19) 评论(0) 推荐(0)
摘要: A - XOR Circle 可以发现,相邻三个数的异或和一定为 \(0\)。如果三个字符已经确定了,那么整个字符串就已经确定为这三个字符构成,且序列唯一。 如果 \(n\bmod 3\ne 0\),显然无解。 如果字符集的大小大于 \(3\),显然无解。 如果字符集的大小等于 \(3\),只有在这 阅读全文
posted @ 2023-09-27 18:52 Zhou_JK 阅读(12) 评论(0) 推荐(0)
摘要: A - Triangle 考虑 \(x_1,y_1\) 选原点,构造另外两个点。考虑叉积的形式,可以得出: \[x_2y_3+x_3y_2=S \]令 \(x_2=y_3=\lceil \sqrt S\rceil\),令 \(t=S-x_2y_3\),暴力枚举 \(t\) 的因数即可。 #inclu 阅读全文
posted @ 2023-09-27 18:52 Zhou_JK 阅读(12) 评论(0) 推荐(0)
摘要: A - Dividing a String 可以发现,划分后的子串的长度不可能大于 \(2\)。令 \(f_{i,1/2}\) 表示到第 \(i\) 位,当前位置划分的子串长度为 \(1/2\) 的最大的 \(K\),转移枚举一下 \(i-1,i-2\) 即可。 #include<iostream> 阅读全文
posted @ 2023-09-27 18:51 Zhou_JK 阅读(30) 评论(0) 推荐(0)