自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 浅谈----次 小 生 成 树

前置技能:知道怎么搞出最小生成树(即K算法和P算法)这里给出一些定义:定义次小生成树为所有生成树中第二小的(可能不止一个)有用边为原最小生成树的任意边无用边为不在原最小生成树的任意边所以推理得出以下结论1. 至少有一条边在次小生成树中而不在最小生成树中2. 次小生成树肯定是某条无用边的对应最小生成树首先**答案肯定不是某条有用边的对应最小生成树,由结论1我们可以得到某条在...

2019-06-14 21:39:50 179

原创 快速幂

#include<bits/stdc++.h>using namespace std;int b,p,k;int cp(int p){ int temp; if(p==0) return 1; temp=cp(p/2)%k; temp=(temp*temp)%k; if(p%2==1) temp=(te...

2019-01-10 21:17:32 120

原创 P1162 填涂颜色

#include <bits/stdc++.h>#include <cstdio>using namespace std;int n;int x=0,y=0;int a[35][35],b[35][35];int xx[4]={1,-1,0,0};int yy[4]={0,0,1,-1};struct T{ int x,y;} c[1001];...

2018-12-08 20:52:34 129

原创 P1460 健康的荷斯坦奶牛 Healthy Holsteins

#include <bits/stdc++.h>#include <cstdio>using namespace std;struct Node{ int ans[26];} a[26],b;int c[26],d[26];int V,v[26],G,L,minl=100;void dfs(int x,int l){ if(l>=minl) {...

2018-12-08 20:47:24 342

原创 P2089 烤鸡

#include <bits/stdc++.h>#include <cstdio>int ans[9000][10],m=0,num=-1,n,b[10]={-999};using namespace std; void dfs(int k){ int i; if(k==9) { int d=n-m; if(...

2018-12-08 13:02:55 174

原创 P4136 谁能赢呢?

#include <bits/stdc++.h>#include <cstdio>using namespace std;int main(){ int n; while(cin>>n) { if(n==0) { return 0; } if...

2018-12-08 13:02:16 203

原创 something about 高精

·First 高精加#include <bits/stdc++.h>#include <cstdio>using namespace std;int a[100000];int b[100000];void gaojing(int a[],int b[]){ int k=0; if(a[0]>=b[0]) { k=a[0]; } else...

2018-12-08 12:25:47 100

原创 一段堆代码

void put (int d){int now ,next;l++;heap[l]=d;now=l;while(now>1){next=now>>1;if(heap[now]>=heap[next]) break;swap(heap[now],heap[next]);now=next;} }int get(){int now,next,res;...

2018-10-17 20:56:02 247 1

原创 例3.1 窗口重叠

include using namespace std; struct WD { int l;//代left int r;//代right int t;//代top int b;//代bottom }; WD a,b,t; int main() { cin>>a.l>>a.r>>a.t&g...

2018-08-11 09:40:33 1718

原创 结构体—struct

结构体的基本结构 struct ST { char name; //姓名 int num; //学号 int age; //年龄 char group; //所在学习小组 float score; //成绩 }; add:注意大括号后面的分号;不能少,这是一条完整的语句。 结构体也是一种数据类型,它由程序员自己定义,可以包含多个...

2018-08-11 09:34:44 92

原创 CCF 例3.2 成绩统计

include

2018-08-11 09:07:25 168

原创 STL 算法

1.std::reverse(),顾名思义,用于反转序列。需要提供首尾迭代器作为参数。 2.std::string::erase(),传入两个迭代器 l,r,清除[l,r)范围内的字符。 3.std::string::substr(),用于提取子字符串,用法与前者类似。 4.std::string::find(),用来查找字串在母串中第一次出现的位置。...

2018-08-11 08:12:58 122

原创 你的飞碟在这———洛谷

include include using namespace std; string a , b ; int ans = 1 , num = 1 ; main() { cin >> a >> b ; for( int i = 0 ; i < a.length() ; i ++ ) { ans *...

2018-08-10 10:04:46 391

原创 例2.11数字加密

include include include include using namespace std; int main() { int a,b; cin>>a>>b; stringstream t; string ans; t<

2018-08-09 09:08:39 147

原创 斐波那契数列

include include using namespace std; long long a[101]; long long Fibonacci(int n) { memset(a,0,sizeof(a)); a[1]=0; a[2]=1; for(int i=3;i<=n;i++) { a[i]=a[...

2018-08-02 10:31:49 99

原创 求圆柱体体积

include using namespace std; double pai=3.14; double cylinder(double r,double h) { return pai*r*r*h; } int main() { double r,h; double sum; cin>>r>>h; sum...

2018-08-02 09:48:34 1607

空空如也

空空如也

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

TA关注的人

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