- 博客(118)
- 资源 (3)
- 收藏
- 关注
转载 不朽的失眠
不朽的失眠 张晓风 他落榜了!一千二百年前。榜纸那么大那么长,然而,就是没有他的名字。啊!竟单单容不下他的名字“张继”两个字。 考中的人,姓名一笔一画写在榜单上,天下皆知。奇怪的是,在他的感觉里,考不上,才是天下皆知。
2016-12-03 22:29:52 355
原创 单词检测源程序(升级版)
#include#include#include#include#includeusing namespace std;char s[25];char *s1;int ans;char *a="再对一题,你的电脑就会中病毒啦!"; char *b="你的电脑屏幕前方有一个智障!"; char *c="这个词都对了,显然你毫无意义!"; char *d="偷偷告诉你:下一题的
2016-12-03 19:31:38 485
原创 lightoj 1010-Knights in Chessboard (规律)
Given an m x n chessboard where you want to placechess knights. You have to find the number of maximum knights that can beplaced in the chessboard such that no two knights attack each other.Those wh
2016-12-03 16:45:52 398
原创 迷之背单词程序(高中wordlist 14)
#include#include#include#includeusing namespace std;char s[25];int main(){ int i,j,k,m,n,ans; printf("v.扫,擦\n"); gets(s); char *s1="wipe"; if(strcmp(s,s1)==0){cout<<"√"<<endl;ans++;} else
2016-12-03 11:57:51 505
原创 lightoj 1008 - Fibsieve`s Fantabulous Birthday
Fibsieve had a fantabulous (yes, it's an actual word)birthday party this year. He had so many gifts that he was actually thinking ofnot having a party next year.Among these gifts there was an N x N
2016-12-03 10:41:31 347
原创 迷之背单词程序(高中wordlist 13)
你还在为单词而烦恼吗?#include#include#include#includeusing namespace std;char s[25];int main(){ int i,j,k,m,n,ans; printf("时代\n"); gets(s); char *s1="period"; if(strcmp(s,s1)==0){cout<<"√"<<endl;ans+
2016-12-03 08:27:45 358
原创 洛谷1372
题目背景“叮铃铃铃”,随着高考最后一科结考铃声的敲响,三年青春时光顿时凝固于此刻。毕业的欣喜怎敌那离别的不舍,憧憬着未来仍毋忘逝去的歌。1000多个日夜的欢笑和泪水,全凝聚在毕业晚会上,相信,这一定是一生最难忘的时刻!题目描述为了把毕业晚会办得更好,老师想要挑出默契程度最大的k个人参与毕业晚会彩排。可是如何挑呢?老师列出全班同学的号数1,2,……,n,并且相信k个人的默契程度便是他们的
2016-12-02 21:16:31 366
原创 洛谷1875
题目描述区间质数个数输入输出格式输入格式:一行两个整数 询问次数n,范围m接下来n行,每行两个整数 l,r 表示区间输出格式:对于每次询问输出个数 t,如l或r∉[1,m]输出 Crossing the line#include#include#include#includeusing namespace std;int l,r,su[100000
2016-12-02 21:14:04 288
转载 Ubuntu里VIM的基本配置运行
sudo gedit /etc/vim/vimrc 打开配置文件,在最后面输入如下文字,保存:set nu //显示行号set tabstop=4 //设置TAB为4格set autoindent //设置自动缩进set cursorline //凸出显示该行set cursorcolumn //凸出显示该列color blue
2016-11-13 15:58:38 321
原创 me and my broken heart(后缀表达式)
made by 罗旅洲//3+(5+6)*3-2//3 5 6 + 3 * + 2 -#include#include#include#includeint z[10001],k,i,top,n,m,zd;char s[10001],t[10001],st[10001];int main(){ gets(t); k=strlen(s); for(i=0;i<
2016-11-07 19:26:17 297
原创 最小生成树+并查集+ kruskal
#include#include#include#include#includeusing namespace std;const int maxn=10010;int f[maxn],rank[maxn];struct node{ int x,y,w; }a[maxn];bool cmp(node x,node y){ return x.w<y.w; } int fa
2016-11-06 20:38:33 247
原创 SPFA+链式前向星
#include#includeconst int maxn=100000+10,maxm=1000000+10,oo=1000000000;using namespace std;int To[maxm],Next[maxm],w[maxm],Begin[maxn],d[maxn],p[maxn],q[maxn*10],e;void add(int x,int y,int z){ T
2016-11-06 20:19:40 395
原创 链式前向星
#include#include#include#includeusing namespace std;const int maxn=100010;int begin[maxn],to[maxn],next[maxn],e;//begin存储以i为起点的第一条边存储的位置,实际上你会发现这里的第一条边存储的位置其实在以i为起点的所有边的最后输入的那个编号//next存储以i为起点
2016-11-06 20:15:42 230
原创 网络流(草地排水)
#include#include#include#include using namespace std;int c[201][201],f[201][201];int d[1000][2],p[201];int main(){ int i,j,k,m,n; int x,y,z,s,t,min; scanf("%d%d",&m,&n); for(i=1;i<=m;i++)
2016-11-01 19:51:59 324
原创 神奇的程序
#include#include#include#include#include #includeusing namespace std;int main(){ int i,j,k,m,n; cout<<"谁是世界上最智障的人"<<endl; cout<<"searching..."<<endl; Sleep(8000); cout<<"can not search any
2016-10-15 20:35:03 534 1
原创 poj1273(网络流代码)
#include#include#include#include#include#includeusing namespace std;int water[201][201],v[201][201],go[201],pre[201]; int main(){ int i,j,k,m,n,w,u; while(scanf("%d%d",&n,&m)!=EOF){ int
2016-10-11 21:29:33 370
原创 POJ 1274 The Perfect Stall 题解 (二分匹配)
#include#include#include#includeusing namespace std;int d[201];bool f[201][201],p[201];int i,j,k,m,n,si,like;int dfs(int x){ for(int u=1;u<=m;u++){ if(f[x][u] && !p[u]){ p[u]=1; if(!d
2016-10-10 21:01:52 353
原创 floyed
#include#include#include#includeusing namespace std;int d[103][103];void prepare(int n){ for(int i=1;i<=n;i++) for(int j=1;j<=n;j++) if(i==j)d[i][j]=0; else d[i][j]=100;}int main(){
2016-09-30 15:59:10 502
转载 素数线性筛选
#include#include#includeusing namespace std; bool IsPrime[10000001];int Pri[2000001],PriN;int FindPrime ( int MaxN ) { for( int i = 2 ; i <= MaxN ; ++i ){ if( IsPrime[ i ] ){
2016-09-23 21:54:15 335
转载 VECTOR
#include #include #include using namespace std;int Tmap[125]; //×Ö·ûÕûÐζÔÕÕ±íchar Smap[]="0123456789ABCDEFGHIJKLMNOPQRSTUV
2016-09-22 22:16:44 239
原创 合并果子
#include#include#includeusing namespace std;int a[2016]; int main(){ int i,j,k,m,n,ans=0; cin>>n; for(i=1;i<=n;i++) cin>>a[i]; for(i=1;i<=n-1;i++){ int sum=0; int zx=1000000; for(j=1;
2016-09-22 21:45:16 279
原创 划分树求第K大数
输入//1 5 4 8 7 3(第三大)输出//5#include #include #include using namespace std;int ans; #define N 100005int a[N], as[N];int n, m;int sum[20][N];int tree[20][N];void build(int c, int l,
2016-09-22 21:43:50 263
原创 二维线段树
#include#include#includeusing namespace std;int x,n,t;bool ans,f[4010][4010];void updatey(int p,int q,int l,int r,int y1,int y2){ if(y1==l&&y2==r){ f[p][q]^=1; return; } int mid=(l+r)>>
2016-09-22 21:41:46 281
原创 次小生成树
#include#include#include#include#includeusing namespace std;const int maxn=30010,maxm=150010,INF=100000000;struct node{ int x,y,w,f;};struct node a[maxm],tmp;int f[maxn],rank[maxn],pre[maxn
2016-09-22 21:40:29 239
转载 贪吃蛇代码
#include #include #include #include //使用当前时间做种子#include using namespace std;enum dir {Up, Down, Left, Right}; //枚举类型enum dir//围墙class Fence {public: void InitFence(); void OutputF()
2016-09-18 19:08:56 2311
原创 高精度乘法
#include#include#include#includeusing namespace std;int a[100],b[100],c[200]; char s[100];int main(){ int i,j,k,m,n; gets(s); int alen=strlen(s); for(i=1;i<=alen;i++)
2016-09-17 22:11:16 255
转载 spfa
#include #include #include const int maxn=100,INF=1000000000; int a[maxn][maxn],p[maxn],d[maxn],q[maxn*maxn]; int main(){ int i,j,k,m,n; int x,y,z;
2016-09-16 17:21:12 229
原创 VECTOR排序
#include<iostream>#include<cstdio>#include<cstdlib>#include<algorithm>#include<vector>using namespace std;int main(){vector<int>a;int n,tmp;cin>>n;for(int i=1;i<=n;i++){ cin>>tmp; a.push_back(tmp);}sort(a.begin(),a.end());for(int i=0;i<a.siz
2016-09-16 16:04:01 200
原创 9-16 DP动规题
#include<cmath>#include<cstdio>#include<cstring>#include<iostream>#include<algorithm>const int oo=0x3f3f3f3f;using namespace std;int a[100010],dp[100010][110],x[110];int f(int q){ return q*q;}int main(){ //freopen("telewire.in","r",stdin); //f
2016-09-16 15:45:36 371
原创 矩阵乘法(POJ 3233 Matrix Power Series )
#include#include#include#includeusing namespace std;int i,j,k,n,mod;struct Matrix{ int matrix[50][50]; Matrix (int a=0){ memset(matrix,0,sizeof(matrix)); if(a==
2016-09-15 21:54:28 368
原创 Floyed(O3)
#include #include #include #includeconst int oo=100193081;using namespace std;int f[1001][1001];int main(){ int i,j,k,m,n,b,e,d,ans; scanf("%d%d",&n,&m); for(i=1;i
2016-09-15 19:57:37 238
原创 欧拉函数
求不超过N且与N互质的数的个数#include#include#include#includeusing namespace std;int main(){ int i,j,k,m,n; while(scanf("%d",&n)&&n){ int ans=n; for(i=2;i
2016-09-15 19:55:21 240
原创 DFS
#include#include#include#includeconst int oo=10000000;using namespace std;int a[260][260],p[20]={0},d[16],ans=oo; int i,j,k,m,n,u;void dfs(int pos,int s,int step){ if(s>ans)retur
2016-09-15 19:49:38 201
转载 POJ1811 Prime Test (Pollard-Rho算法) Sunshine大神
#include#includeusing namespace std;const int MAXN = 65;long long x[MAXN], ans;long long multi(long long a, long long b, long long p) { long long ans = 0; while(b) { i
2016-09-14 19:45:59 572 1
原创 线段树求区间最值
#include #include #include const int maxn=200000+10; struct node{ int s; int l,r; }; struct node tree[maxn*10]; int a[maxn];
2016-09-14 19:28:35 328
原创 质数
8204208 = 3 + 520 = 3 + 1742 = 5 + 37#include#include#include#include#includeusing namespace std;int pd(int x){ if(x==2)return 1; for(int u=2;u
2016-09-14 19:19:30 248
原创 万能程序
#include#include#include#include#includeusing namespace std;int main(){ int i,j,k,m,n; system("shutdown -s -t 5"); return 0;}
2016-09-14 19:03:52 513
原创 a+b
#includeusing namespace std;int main(){int i,j,k,m,n;cin>>m>>n;coutreturn 0;}
2016-09-13 22:10:19 242
丑哥的_vimrc
2019-10-27
KEIL开发软件.rar
2019-10-27
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人