摘要: AtCoder Beginner Contest 235 A - Rotate 思路分析: 因为他给的数是三位数,我们直接取出每一位,然后拼凑就可以了 代码如下: #include <bits/stdc++.h> #define int long long using namespace std; 阅读全文
posted @ 2022-01-16 12:04 zhy-cx 阅读(95) 评论(0) 推荐(1)
摘要: AtCoder Beginner Contest 234 A - Weird Function 思路分析: 直接写就行 代码如下: #include <bits/stdc++.h> using namespace std; #define ll long long ll f(ll x) { retu 阅读全文
posted @ 2022-01-09 19:40 zhy-cx 阅读(148) 评论(0) 推荐(0)
摘要: AtCoder Beginner Contest 228 A - On and Off 思路分析: 如果s < t说明是顺序的,所以只要x小于t并且大于等于s即可。 如果s > t说明是逆序的,所以只要x >= s或者x < t即可。 代码如下: #include <bits/stdc++.h> u 阅读全文
posted @ 2021-11-21 15:34 zhy-cx 阅读(159) 评论(0) 推荐(0)
摘要: Codeforces Round #753 (Div. 3) A. Linear Keyboard 思路分析: 无语了,题目总是读不顺,看到output那个minimal我还以为是把手放到一个单词上,看需要多少time来完成敲出字符串。 写完一看,答案不对劲,然后发现这题其实就是把字母表重新排一下, 阅读全文
posted @ 2021-11-03 20:25 zhy-cx 阅读(173) 评论(0) 推荐(0)
摘要: Codeforces Round #751 (Div. 2) A. Two Subsequences 思路分析: x实际上就是字符串里最小的字符。 剩下的便是y。 代码 #include <bits/stdc++.h> using namespace std; int main() { ios::s 阅读全文
posted @ 2021-11-01 21:50 zhy-cx 阅读(77) 评论(0) 推荐(0)
摘要: Codeforces Round #752 (Div. 2) A. Era 思路分析: 答案其实就是这个数减去它改变位置后的pos即可。 对于第一位如果不是1,那么它就要在前面插入$a[1] - 1$个数,来使得它能够$<= i$,然后要注意的是,在你插入数之后,位于你刚刚插入的位置及其以后的下标都 阅读全文
posted @ 2021-11-01 17:05 zhy-cx 阅读(117) 评论(0) 推荐(0)
摘要: Codeforces Round #750 (Div. 2) A. Luntik and Concerts 思路分析: 首先我们可以肯定的是a,b,c都大于等于1,所以我们先让它们自己抵消自己,最后a,c只有三种情况。 a = 1, c = 1 如果只有奇数个b,我们取一个b * 2 + a抵消c, 阅读全文
posted @ 2021-10-25 22:49 zhy-cx 阅读(137) 评论(0) 推荐(0)
摘要: AtCoder Beginner Contest 224 A - Tires 思路分析: 判断最后一个字符即可。 代码如下: #include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin 阅读全文
posted @ 2021-10-24 14:57 zhy-cx 阅读(243) 评论(0) 推荐(1)
摘要: 思路分析 此题采用dfs,注意X选中了之后所有的X值相同,所以需要一个flag来存储X的值。 注意前导0要单独讨论,然后就是当'X'或者'_'在第一位时不能选0,其它位可以选0 - 9 任意一个数。 代码如下 //now-当前位数 flag-X的值 num-当前数的大小 #include <bits 阅读全文
posted @ 2021-10-24 14:55 zhy-cx 阅读(36) 评论(0) 推荐(0)
摘要: Codeforces Round #748 (Div. 3) A. Elections 思路分析: 令当前值比最大值大即可,如果最大值是它自己,就输出$0$ 代码 #include <bits/stdc++.h> using namespace std; pair<int, int> a[3]; i 阅读全文
posted @ 2021-10-20 17:23 zhy-cx 阅读(46) 评论(0) 推荐(0)