11 2020 档案
摘要:题目: 思路: 1.递归 设置三个变量分别是 当前下标,当前总和,当前加的数字个数 代码如下: #include<cstdio> #include<cmath> #include<iostream> using namespace std; int n,k,t,sum=0; int a[25]; /
阅读全文
摘要:题目如下: 思路: 1.如果直接for循环肯定无法满分 2.先算出行的所有格子 再加上列的所有格子(注意列的格子不是全部加上,加上除了行没有覆盖的那个别的格子) 代码如下: #include<cstdio> #include<iostream> #include<cstring> using nam
阅读全文
摘要:1.题目如下: 思路: 1.以前遇到过,不过用了数组,结果可想而知 2.其实可以不用数组,毕竟只统计一次最差的结果。 炸弹炸得范围是圆形,我们可以用枚举,将它转化为正方形 3.注意那个n,m;当我们不知道何去何从,直接看样例!!! 代码: #include<cstdio> #include<cmat
阅读全文
摘要:题目: 思路: 1.别被题目吓着了,其实很简单 剥皮之后仅仅是个求最大公约数的问题 代码如下: #include<cstdio> #include<cmath> #include<iostream> #include<cstring> using namespace std; //找出两个数之间的公
阅读全文
摘要:1.头文件 #include<algorithm> 2.使用方法: #include<cstdio> #include<iostream> #include<algorithm> using namespace std; int main(){ int a,b,a1,b1,c,d; cin>>a>>
阅读全文
摘要:题目: 思路: 1.只需要把每个行的开头和结尾赋值为1即可 2.利用递推公式 代码如下: 1. #include<cstdio> #include<iostream> using namespace std; main(){ int n; cin>>n; int a[n][n]; for(int i
阅读全文