摘要:
A. Two Rabbits 思路: 很明显,如果(y-x)%(a+b)==0的话ans=(y-x)/(a+b),否则就为-1 #include<iostream> #include<algorithm> using namespace std; const int maxn = 100000+5; 阅读全文
摘要:
A. Three Strings #include<iostream> #include<algorithm> using namespace std; int main(){ int t; scanf("%d",&t); while(t--){ string a,b,c; cin>>a>>b>>c 阅读全文
摘要:
A. Non-zero 思路:如果数组中有0,那么乘积肯定为0,因此我们只要统计0的个数,给每个0加上1即可,之后还需考虑给所有0机上1和为0的情况,此时要再加上1 #include<iostream> #include<algorithm> using namespace std; int mai 阅读全文