摘要:
QAQ: A. Two Rabbits 题意: 有两只兔子,距离为n,左边兔子每秒向右跳a,右边兔子每秒向左跳b,问两只兔子何时能相遇,如果不能相遇输出-1。 思路: #include <bits/stdc++.h> using namespace std; typedef long long LL 阅读全文
摘要:
QAQ: A. Three Strings 题意: 给你三个等长字符串a,b,c,你对于每一位i,你必须要cI去替换ai或者bi,问最后能不能让a串和b串相同。 思路: 简单题,直接模拟即可,详细见代码。 代码: #include<bits/stdc++.h> using namespace std 阅读全文
摘要:
QAQ: A. Erasing Zeroes 题意: 给你一个01串,问最少删掉多少个0使得串中的所有1都相邻。 思路: 简单题,详细见代码。 代码: #include <bits/stdc++.h> using namespace std; const int maxn = 2e5+10; typ 阅读全文
摘要:
QAQ:我太难了 A. Even But Not Even 题意: 给你一个长度为n的数组a,你可把其中一个数的值加一,这个操作你可以做无数次,要求最后的数组之和不等于零,数组之积不等于0,输出所需最小的操作数。 思路: 暴力模拟即可,要求数组中不能有0,和不等于0。 代码: #include <b 阅读全文