摘要:
A. Set 链接:Problem - A - Codeforces 思路:r/k求 零 到 r 中 k的倍数,最后减去l,减去1,求个数 代码: #include<iostream> using namespace std; int main() { int t; cin>>t; for(int 阅读全文
摘要:
C. CCPC 链接:Problem - C - Codeforces 思路:已知C和P的数量,CCP看成一组,C可以重复匹配。min找最多能匹配的数量 代码: #include<bits/stdc++.h> using namespace std; int cntc=0,cntp=0; int m 阅读全文
摘要:
A. Perpendicular Segments 链接: Problem - A - Codeforces 思路:观察样例 代码: #include<iostream> using namespace std; typedef long long ll; int main() { int t; c 阅读全文
摘要:
B. Stalin Sort 链接:Stalin Sort 思路:遍历数组里每一个数,假定他是最大值,将不符合条件要删去的数累加得ans,最终比较得最小值。 代码: #include<bits/stdc++.h> using namespace std; int a[3000]; int main( 阅读全文
摘要:
C - Avoid Knight Attack 链接: C - Avoid Knight Attack 思路:总网格数-被放上棋子的数量=空的方格数 AC代码: #include<bits/stdc++.h> #define int long long using namespace std; in 阅读全文