自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(18)
  • 收藏
  • 关注

原创 宽搜搜索 奇怪的电梯

来源信息学编程课课通#include<bits/stdc++.h>using namespace std;int a[10000000];int visited[10000000];struct caster{ int floor; // 楼层数 int step; //按了几次 };int main(){// freopen("lift","r",...

2019-08-01 23:17:53 282

转载 淘淘摘苹果升级版(和自己一开始的版本不一样)

#include&lt;iostream&gt;using namespace std;int n,s,a,b,ans=0;int xi[5010],yi[5010]; void f(int cnt,int l,int la){ for(int i=la;i&lt;n;i++){ if(xi[i]&gt;a||yi[i]&gt;l) continue;...

2018-08-31 22:24:47 356

转载 普及组模拟赛

2. SLF 的消息记录 (records.c/cpp/pas) 【题目描述】 或许是人气过于旺盛,SLF 的手机一只叮叮叮响个不停。不用说,一定是女孩子发来的 短信。有一天,一直对此毫不在意的 SLF 男神来了兴趣,他想知道给他发消息最多的女孩是 哪一位。女孩的名字均由三个单词组成,由于女孩非常狡猾,她们有的时候会把自己的名字 三个单词进行交换,所以名字的先后顺序不同也被视为是同一个女孩。 给出...

2018-08-01 23:25:17 460

原创 P1056 排座椅

题目描述上课的时候总会有一些同学和前后左右的人交头接耳,这是令小学班主任十分头疼的一件事情。不过,班主任小雪发现了一些有趣的现象,当同学们的座次确定下来之后,只有有限的D对同学上课时会交头接耳。同学们在教室中坐成了 MM 行 NN 列,坐在第i行第j列的同学的位置是 (i,j)(i,j) ,为了方便同学们进出,在教室中设置了 KK 条横向的通道, LL 条纵向的通道。于是,聪明的小雪想...

2018-07-22 14:46:58 254

原创 vector向量器

用vector求解问题,灵活的胖子。。。#include &lt;bits/stdc++.h&gt;using namespace std;int main() { int m, n, t, ans = 0; cin &gt;&gt; m &gt;&gt; n; vector&lt;int&gt; v; while (cin &gt;&gt; t)...

2018-07-20 21:35:34 135

原创 排列组合

设有N个整数的集合{1,2,3***},从中任意选r个数进行排列,试举出所有排列 #include &lt;iostream&gt;int n,r;int huo[10000];bool flag[10000];/* run this program using the console pauser or add your own getch, system("pause") o...

2018-07-17 15:00:45 935

原创 数字金字塔版本2

#include &lt;iostream&gt;int N;int mymax=0;int tian[1000][1000];using namespace std;/* run this program using the console pauser or add your own getch, system("pause") or input loop */void searc...

2018-07-14 15:23:19 320

原创 数字金字塔

} }*/int main(int argc, char** argv) { int n; cin&gt;&gt;n; for(int i=1;i&lt;=n;i++) for(int j=1;j&lt;=i;j++) { cin&gt;&gt;tian[i][j]; } for(int i=n;i&gt;1;i--)//&gt;1 ...

2018-07-14 15:08:58 371

原创 菲波那切数列

备忘+搜索#include &lt;iostream&gt;int huo[10000]={0};using namespace std;/* run this program using the console pauser or add your own getch, system("pause") or input loop */int search(int a){ if(huo...

2018-07-14 13:52:46 181

原创 辗转相除

#include &lt;iostream&gt;/* run this program using the console pauser or add your own getch, system("pause") or input loop */using namespace std;int search(int a,int b){ if(a%b==0) return b; e...

2018-07-13 14:53:06 1157

原创 加数和问题

如何保存成功方案的状态!!!#include &lt;bits/stdc++.h&gt;int a[1000];int aim,n;int b[1000];/* run this program using the console pauser or add your own getch, system("pause") or input loop */using namespace s...

2018-07-12 15:56:56 257

原创 滑雪【2.6基本算法之动态规划】

#include &lt;iostream&gt;int moun[1000][1000];int memory[1000][10000]={0}; int R,C;int dx[5]={0,-1,0,1,0};int dy[5]={0,0,1,0,-1};int t=0;int mymax=0;/* run this progrRm using the console pRuse...

2018-07-12 15:53:32 647

原创 数的计数noip2001

、#include &lt;iostream&gt;int answer=0;int h[10000];/* run this program using the console pauser or add your own getch, system("pause") or input loop */using namespace std;int dfs(int n){ if(...

2018-07-10 16:08:44 411

原创 搜索

注意一开始的位置初始化#include &lt;bits/stdc++.h&gt;using namespace std;char a[1000][1000];int R,S;int dx[4]={-1,1,0,0};int dy[4]={ 0,0,-1,1};int mymax=0;bool flag[100000];/* run this program using the c...

2018-07-10 15:38:26 89

原创 求b的n次方

#include &lt;bits/stdc++.h&gt;using namespace std;int n,b;int work(int b){//注意这儿不能写do(int b);do while if( b==1) return n; int temp = work( b/2) ;// temp是临时的变量 temp = temp * temp; if( b...

2018-07-08 15:40:51 531

原创 明明的随机数

NOIP  2006明明的随机数去重,排序耶耶耶#include &lt;bits/stdc++.h&gt;/* run this program using the console pauser or add your own getch, system("pause") or input loop */using namespace std;int main(int argc, cha...

2018-07-08 15:09:55 209

原创 反FBI树

泰州市2018年程序设计竞赛第四题#include&lt;bits/stdc++.h&gt;using namespace std; string s;void work(int left,int right){ if(left==right) { if(s[left]=='B')//B是字符,注意用单引号 cout&l...

2018-07-06 15:50:44 264

原创 马走日

#include &lt;bits/stdc++.h&gt;using namespace std;int dx[8]={1,2,2,1,-1,-2,-2,-1};//注意等于号的存在 int dy[8]={-2,-1,1,2,2,1,-1,-2};int a[100][100];bool b[100][100]; int print(){ for(int i=1;i&lt;=5...

2018-07-06 15:29:44 363

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除