随笔分类 - codeforces
摘要:A - Lucky? 代码: #include <bits/stdc++.h> using namespace std; #define int long long #define fi first #define se second const int N = 2e5 + 10; int w[N]
阅读全文
摘要:(1)2021-2022 ICPC, NERC, Northern Eurasia Onsite (Unrated, Online Mirror, ICPC Rules, Teams Preferred)-D - Deletive Editing 题意: 给定两个字符串a,b,可以对a进行任意次数的
阅读全文
摘要:A - Tokitsukaze and All Zero Sequence 题意: 给定一组数,可以进行以下操作: 任选两个数和 ·如果 = , 那么就让他们其中一个变为0. ·否则 = = min(,\
阅读全文
摘要:A - Prof. Slim 遇到的问题: 一开始读错题,到后面思路打不开,最后想了好久才知道怎么做。总感觉思维差很多,其实这种题还是很好想到的,我为什么想的那么慢?我认为应该是要好好反思一下自己,要注意哪方面的问题了。 代码: #include <bits/stdc++.h> using name
阅读全文
摘要:A - Food for Animals 交A题结果交到了B题上了 WA了我一发 TMD 代码: #include <bits/stdc++.h> using namespace std; #define int long long #define x first #define y second
阅读全文
摘要:A - Number Transformation 代码: #include <bits/stdc++.h> using namespace std; #define int long long #define x first #define y second typedef pair<int,in
阅读全文
摘要:A. Log Chopping 题意:现有数组a,errorgorn和maomao90分别先后轮流将数组a中的某个元素拆分成两个不小于1的数并加入到数组a中,最终不能再拆分的人为败者。问给定的数组a的情况下,胜者是谁。 分析:最终的情况一定是所有的数都被拆分成了1,即数组a中所有元素为1。那么最佳操
阅读全文
摘要:A - Subtle Substring Subtraction 思路:贪心 代码: #include <bits/stdc++.h> using namespace std; #define int long long #define x first #define y second typede
阅读全文
摘要:A. String Building 题意:给定字符串,判断是否能由aa,aaa,bb,bbb组成。 思路:其实我们可以发现,任何大于1的数都可以由2和3的组合组成。所以我们只需要判断是否存在单独的a或者单独的b就行了。说来惭愧,这题我刚开始考虑的太复杂了,导致Wrong了2发。呜呜呜,还是功力不太
阅读全文
摘要:A. Red Versus Blue 题意:用给定数目的B尽可能的分割字符串R,使得连在一起的R的最大值最小。 分析:基于贪心的思路,把字符串R尽可能的平均分,当然可能会有剩余的情况,那么就把这剩余的R分别插入到已经配好的子字符串里。 代码: //插到前面 #include <iostream> u
阅读全文
摘要:1/A题: https://codeforces.com/contest/1650/problem/A 这题其实很简单的,因为要同时删除两个数,我们看看我们最终要得到的数在这组数中的什么位置,如果在奇数位,那么就一定可以通过删除数字来得到。 #include <iostream> #include
阅读全文
摘要:1/A题: https://codeforces.com/contest/1649/problem/A 这一题其实很简单,就是要求最左边和最右边的最小距离(只能跨一次水,no more than once!!!) #include <iostream> #include <cstring> usin
阅读全文