- 博客(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<iostream>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<n;i++){ if(xi[i]>a||yi[i]>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 <bits/stdc++.h>using namespace std;int main() { int m, n, t, ans = 0; cin >> m >> n; vector<int> v; while (cin >> t)...
2018-07-20 21:35:34
135
原创 排列组合
设有N个整数的集合{1,2,3***},从中任意选r个数进行排列,试举出所有排列 #include <iostream>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 <iostream>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>>n; for(int i=1;i<=n;i++) for(int j=1;j<=i;j++) { cin>>tian[i][j]; } for(int i=n;i>1;i--)//>1 ...
2018-07-14 15:08:58
371
原创 菲波那切数列
备忘+搜索#include <iostream>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 <iostream>/* 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 <bits/stdc++.h>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 <iostream>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 <iostream>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 <bits/stdc++.h>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 <bits/stdc++.h>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 <bits/stdc++.h>/* 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<bits/stdc++.h>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 <bits/stdc++.h>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<=5...
2018-07-06 15:29:44
363
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人