- 博客(15)
- 收藏
- 关注
原创 hdu 2544最短路(dijkstra+链式前向星)
http://acm.hdu.edu.cn/showproblem.php?pid=2544 Problem Description在每年的校赛里,所有进入决赛的同学都会获得一件很漂亮的t-shirt。但是每当我们的工作人员把上百件的衣服从商店运回到赛场的时候,却是非常累的!所以现在他们想要寻找最短的从商店到赛场的路线,你可以帮助他们吗? Input输入包括多组...
2018-12-23 18:03:44 326
原创 hdu2647(链式前向星+拓扑排序)Reward
http://acm.hdu.edu.cn/showproblem.php?pid=2647Dandelion's uncle is a boss of a factory. As the spring festival is coming , he wants to distribute rewards to his workers. Now he has a trouble about h...
2018-12-23 17:20:28 310
转载 Invitation Cards poj 1511
Invitation CardsTime Limit: 8000MS Memory Limit: 262144K Total Submissions: 34113 Accepted: 11314 DescriptionIn the age of television, not many people attend theater performanc...
2018-12-17 18:54:37 116
原创 Til the Cows Come Home(dijkstra()堆优化)
#include<iostream>#include<queue>#include<vector>#define maxn 1005#define inf 0x3f3f3f3fusing namespace std;struct edge { int to;//下一个点 int w;//权值};vector<edge>G[max...
2018-12-17 17:48:37 312 3
原创 B. Labyrinth(BFS 记忆化搜索)
time limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputYou are playing some computer game. One of its levels puts you in a maze consistin...
2018-12-17 13:48:18 315
原创 B. Kvass and the Fair Nut
https://codeforces.com/contest/1084/problem/B题意为他有n个杯子,然后你需要倒出来l升水,现在需要求能杯子里边倒出那么多水之后,剩下的杯子里边的水的的最小值。先判断这些水能不能充满水桶。如果能的话,可以先求出最少的杯子里边的值然后判断,每杯水与最小值的水之间的差值能否使桶充满。#include<iostream>#includ...
2018-12-17 11:25:04 237
原创 临界表和邻接矩阵DFS,BFS,Dijkstra
#include<iostream>#include<string.h>#include<stdio.h>#include<stdlib.h>#define MaxInt 32767#define MVNum 100#define MAX_VERTEX_NUM 20#define clear(a,b) memset(a,b,size...
2018-12-13 12:55:25 480
原创 队列
/*#include<iostream>#define Status inttypedef int QElemType;using namespace std;typedef struct QNode{ QElemType data; struct QNode *next;}QNode, *QueuePtr;typedef struct {...
2018-12-13 12:54:20 96
原创 线性表
#include <iostream>#include <cstdlib>using namespace std;//1.定义存储表示 ppt 22页typedef int ElemType; //定义ElemType类型为int# define LIST_INIT_SIZE 100 // 线性表存储空间的初始分配量# d...
2018-12-13 12:53:57 130
原创 栈
#include<iostream>#include<malloc.h>#define SElemType int#define STACK_INIT_SIZE 100#define STACKINCREMENT 10typedef int Status;using namespace std;typedef struct{ SElemType *...
2018-12-13 12:53:15 86
原创 哈弗曼树
#include"stdio.h"#include"string.h"#include"malloc.h"#include"iostream"using namespace std;typedef struct{ unsigned int weight; unsigned int parent,lchild,rchild;}HTNode,*HuffTree;type...
2018-12-13 12:52:30 137
原创 二叉树(数据结构)
#include <iostream>#include <malloc.h>#define TElemType char#define SElemType char#define STACK_INIT_SIZE 100#define STACKINCREMENT 10#define MAXQSIZE 100typedef char QElemType;t...
2018-12-13 12:50:59 218
原创 Codeforces Round #525 (Div. 2)
C. Ehab and a 2-operation tasktime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou're given an array aa of length nn. You can perf...
2018-12-10 13:36:39 86
原创 B. Vasya and Books codeforce 1073B
B. Vasya and Bookstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputVasya has got nn books, numbered from 11 to nn, arranged in a s...
2018-12-07 17:40:15 142
原创 合根植物 蓝桥杯(并查集)
http://lx.lanqiao.cn/problem.page?gpid=T458#include<iostream>#define maxn 1000010using namespace std;int pre[maxn];int n,m,k,cnt;int find(int x){ int temp=x; while(temp!=pre[temp]){ ...
2018-12-03 12:59:28 736
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人