- 博客(41)
- 收藏
- 关注
原创 map 一面墙砖
# include<stdio.h># include<iostream># include<algorithm># include<string.h># include<map># include<set>using namespace std;int sum;map<int,int>m...
2019-03-21 10:56:21
251
原创 快速排序
#include <stdio.h>int a[101],n;//定义全局变量,这两个变量需要在子函数中使用void quicksort(int left, int right) { int i, j, t, temp; if(left > right) return; temp = a[left]; //temp中存的就是基准数 i = left;...
2019-03-07 09:29:57
140
原创 时钟表2(繁琐)
<!DOCTYPE html><html> <head> <meta charset="utf-8" /> <title>时钟</title> </head> <style> div{ width: 500px; height: 50
2019-01-02 12:05:40
174
原创 时钟表
<!DOCTYPE html><html> <head> <meta charset="utf-8" /> <title>时钟</title> </head> <style> div{ width: 500px; height: 50
2019-01-02 12:03:57
436
原创 不重复数字
# include<stdio.h># include<algorithm># include<iostream># include<set>using namespace std;int main(){ int t,n,r; set<int>s; scanf("%d",&t); while(t--){..
2018-12-27 15:09:02
248
原创 {A} + {B}
# include<stdio.h># include<algorithm># include<set>using namespace std;int main(){ int n,m,num; set<int>s; while(scanf("%d %d",&n,&m)!=EOF){ s.clear(); ...
2018-12-27 14:54:17
168
原创 Let the Balloon Rise
# include<stdio.h># include<map># include<string># include<iostream>using namespace std;int main(){ map<string,int>bn; int n; string str; while(scanf("%d",&..
2018-12-12 13:54:00
244
原创 打印沙漏
# include<stdio.h># include<string.h># include<algorithm>using namespace std;int a[120];int main(){ int T; scanf("%d",&T); while(T--){ int t=1; for(int i=1;i<=100...
2018-10-28 17:13:27
181
原创 [蓝桥杯][2013年第四届真题]买不到的数目
方法: a*b-(a+b)# include<stdio.h>int main(){ int a,b; scanf("%d %d",&a,&b); printf("%d\n",a*b-a-b); return 0;}
2018-10-27 16:12:45
480
原创 数据结构实验---栈和队列
#include<stdio.h>#include<stdlib.h>#define N 105int a[N];struct node{ int data; node *next;}*h;void LinkStack()//用链表实现栈{ node *s; int n; printf("请输入需要入栈元素的数量: "); scan...
2018-10-27 10:55:41
459
原创 数据结构实验---二叉排序树的创建
#include<stdio.h>#include<string.h>#include<algorithm>using namespace std;typedef struct node{ int key; struct node *l,*r;}bstnode;int bstinsert(bstnode *&p,int...
2018-10-27 08:54:03
817
原创 选项卡
<!DOCTYPE html><html> <head> <meta charset="utf-8" /> <title>选项卡</title> <style type="text/css"> #div1 .active{background: aqu
2018-10-18 14:16:02
133
原创 链表的建立、查找、插入、删除
#include<iostream>#include<algorithm>#include<stdio.h>#include<malloc.h>#include<stack>using namespace std;typedef struct LNode{ int data; struct LNode *next;}...
2018-10-17 11:41:45
390
原创 HDU--1686 Oulipo
# include<bits/stdc++.h>using namespace std;const int maxn=1e6+30;char s[maxn];char t[maxn];int nxt[maxn];int ls,lt;int sum;void getnxt(){ int i=1,j=0; nxt[0]=0; while(i<lt){...
2018-10-16 14:12:42
135
原创 HDU--2087 剪花布条
# include<stdio.h># include<string.h># include<algorithm>using namespace std;# define maxn 1200char s[maxn];char z[maxn];int a[maxn];int ls,lz,sum;void abc(){ int i...
2018-10-16 14:09:26
147
原创 数据结构实验之链表三:链表的结点插入
#include<stdio.h>#include<stdlib.h>struct node{ int data; struct node *next;}*head;int len;void insert(int mi, int xi){ int i; struct node *p, *q; p = head; ...
2018-09-28 17:06:54
358
原创 数据结构实验之链表二:逆序建立链表
#include<stdio.h>#include<stdlib.h>struct node{ int data; struct node *next;}*head;struct node *creat(int n){ struct node *p; int i; head = (struct node*)mall...
2018-09-28 17:06:33
346
原创 数据结构实验之链表一:顺序建立链表
# include<stdio.h># include<stdlib.h>struct node{ int data; struct node *next;}*head; struct node *creat(int n){ struct node *tail,*p; int i; head = (struct node*)malloc(si...
2018-09-27 10:56:53
349
原创 HDU-1285 确定比赛名次
# include<stdio.h># include<algorithm># include<string.h>using namespace std;# define maxn 600int a[maxn][maxn];int vis[maxn];int n,m;void toposort(){ for(int i=1;i<...
2018-09-27 10:27:35
224
原创 CodeForces-701C They Are Everywhere
# include<stdio.h># include<string.h># include<algorithm># include<math.h>using namespace std;char s[100005];int c[60];int vis[60];int id(char ch){ if(ch>='a'&am...
2018-09-27 10:22:20
163
原创 Poj-1321 棋盘问题
# include<stdio.h># include<string.h># include<algorithm># include<iostream># include<queue># define maxn 30using namespace std;char s[maxn][maxn];int vis[maxn...
2018-09-27 10:06:26
131
原创 HDU-1233 还是畅通工程
# include<stdio.h># include<string.h># include<algorithm>using namespace std;int fa[5006];int find(int x){ int r=x; while(r!=fa[r]){ r=fa[r]; } return r;}int join(...
2018-09-27 10:03:45
131
原创 HDU-1232 畅通工程
# include<stdio.h># include<string.h># include<algorithm>using namespace std;int fa[1006];int find(int x){ int r=x; while(r!=fa[r]){ r=fa[r]; } return r;}void join(in...
2018-09-27 10:02:07
121
原创 HDU-1022 Train Problem I
# include<stdio.h># include<string.h># include<algorithm># include<stack># include<iostream>using namespace std;char a[10];char b[10];int flag[20];int main(){...
2018-09-27 09:56:39
153
原创 Poj-2312 Battle City
#include<stdio.h>#include<string.h>#include<queue>using namespace std;#define MAX 1100char map[MAX][MAX];int vis[MAX][MAX];int x1,x2,y1,y2;int n,m;struct node{ int a; ...
2018-09-27 09:53:32
208
原创 HDU-1242 Rescue
# include<stdio.h># include<string.h># include<queue># include<algorithm># include<iostream>using namespace std;# define maxn 200+10int vis[maxn][maxn];char s[...
2018-09-27 09:50:29
150
转载 字符串插入块链实现——数据结构上机实验
1、相关类型说明#define chunksize 8#include "stdlib.h"#include "stdio.h"#include "string.h"typedef struct chunk{ char ch[chunksize]; structchunk *next;}chunk;//块链结点类型typedef struct{ chu...
2018-09-27 09:17:05
1116
原创 全排列 STL
#include <iostream>#include <cstdio>#include <cstring>#include <algorithm>using namespace std;char s[10];int main(){ scanf("%s",s); int len=strlen(s); ...
2018-02-24 22:44:48
240
原创 给定A和B,A和B互质,求最大不能组合数,和不能组合数的个数。
#include<stdio.h>int main(){ int i,j,n,m; while(scanf("%d%d",&n,&m)!=-1) { i=n*m-n-m; j=(m-1)*(n-1)/2; printf("%d %d\n",i,j); } return 0;}
2018-02-12 16:06:03
1085
原创 What Is Your Grade?
# include<stdio.h># include<string.h># include<algorithm>using namespace std;struct node{ int key; int a,b,c,id;}w[120];bool cmp(node x,node y){ if(x.key!=y.key) return x...
2018-02-05 18:14:21
356
原创 快速幂 a的b次方对c取模
#include <iostream>#include <cstdio>#include <cstring>#include <cmath>using namespace std;#define N 500long long Pow(long long a, long long b, long long c){ lon...
2018-02-02 17:39:16
1269
原创 周期串
# include<stdio.h># include<string.h>int main(){ int ok; char word[100]; scanf("%s",word); int len=strlen (word); for(int i=1;i<=len ;i++){ if(len%i==0){ ok=1; for(i...
2018-01-27 21:17:12
247
原创 键盘字符串
# include<stdio.h># include<string.h>char *s = "`1234567890-=QWERTYUIOP[]\\ASDFGHJKL;'ZXCVBNM,./";int main(){ int i,c; while((c=getchar())!=EOF){ for(i=1;s[i]&&s[i]!=c;i+...
2018-01-27 17:33:40
344
原创 分拆素数和 加固版
# include<stdio.h># include<math.h># include<assert.h># include<iostream># include<algorithm>using namespace std;int is_prime(int n){ int i,m; assert(n>=0);...
2018-01-27 16:56:23
193
原创 组合数 C几几
# include<stdio.h># include<math.h>int f(int n){ int i,m=1; for(i=1;i<=n;i++){ m=m*i;} return m;}int main(){ int n,m; scanf("%d %d",&n,&m); printf("%d\n",f(n)/(f(m...
2018-01-27 16:42:03
451
原创 节目排序
# include<stdio.h># include<algorithm>using namespace std;struct s{ int t1; int t2;}a[105]; int cmp(s u,s v){ if(u.t2==v.t2){ return u.t1>v.t1; } return u.t2<v.t2;...
2018-01-26 11:25:04
419
原创 素数函数 分拆素数和
# include<stdio.h># include<math.h># include<iostream>int is_prime(int n){ int i; for(i=2;i<=sqrt(n);i++){ if(n%i==0){ return 0; } } return 1;}int main(){ int n,...
2018-01-26 11:16:16
310
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人