- 博客(22)
- 资源 (2)
- 收藏
- 关注
原创 [备战软考]操作系统
操作系统操作系统进程进程的三态图进程的五态图进程死锁进程1.进程的三态图就绪状态:进程已得到运行所需资源,只等待CPU的调度便可运行;运行状态:进程已得到运行所需资源,并且得到了CPUd调度;等待状态:不具备运行条件、等待时机的状态。也称阻塞状态。2.进程的五态图就绪→运行:条件是被调度程序选中的运行→就绪:条件是时间片刻到(超时),或被更高优先级的进程剥夺运行→等待:条件是不
2017-09-20 22:01:57
546
原创 HDU 1016:Prime Ring Problem(基础DFS)
Prime Ring ProblemTime limit:2000 ms Memory limit:65536 kB OS:Linux Problem DescriptionA ring is compose of n circles as shown in diagram. Put natural number 1, 2, …, n into each circle separately, an
2017-09-20 20:04:00
381
原创 POJ 2367:Genealogical tree (拓扑排序)
Genealogical tree Time limit:1000 ms Memory limit:65536 kB OS:Linux Problem DescriptionThe system of Martians’ blood relations is confusing enough. Actually, Martians bud when they want and where they
2017-09-18 20:00:08
464
原创 HDU 6208:The Dominator of Strings(字符串匹配)
Here you have a set of strings. A dominator is a string of the set dominating all strings else. The string S is dominated by T if S is a substring of T.The input contains several test cases and the first l
2017-09-17 22:29:23
388
原创 POJ 1094:Sorting It All Out (拓扑排序)
Sorting It All OutTime limit:1000 ms Memory limit:65768 kB Problem DescriptionAn ascending sorted sequence of distinct values is one in which some form of a less-than operator is used to order the ele
2017-09-16 12:01:34
507
原创 Dijkstra算法模板
Dijkstra作者:刘伟#include <iostream>#include <stdlib.h>#include <algorithm>#define MAX 100#define INF 100000using namespace std;struct Graph{ int edges[MAX][MAX]; //邻接矩阵 int n;
2017-09-15 19:22:23
1043
原创 Kruskal算法模板
Kruskal作者:刘伟#include <iostream>#include <algorithm>using namespace std;/* 定义边(x,y),权为w */struct edge{ int x, y; int w;};const int MAX = 26;edge e[MAX * MAX];int rank[MAX];/* rank[x]表示x的秩
2017-09-15 19:17:46
317
原创 HDU 4007:Dave (枚举)
Recently, Dave is boring, so he often walks around. He finds that some places are too crowded, for example, the ground. He couldn't help to think of the disasters happening recently. Crowded place is not safe.
2017-09-13 20:43:40
348
原创 [C++::STL]之stcak的用法
stack#include < stack >,堆栈这个就是咱们数据结构中学的栈,栈的操作只有几种方法声明 stack<int> s;入栈 s.push(8);出栈 s.pop();取栈顶元素(但不删除) s.pop();例题:HDU 1022:Train Problem I(堆栈的基本应用)
2017-09-11 23:57:48
1487
原创 [C++::STL]之set的用法
set#include< set > 集合 Sets are containers that store unique elements following a specific order.类似于Java中的TreeSet,set就是数学上的集合——每个元素最多出现一次,其中的元素自动排序,自定义类型构造set时,必须定义”小于”运算符。一个集合通过一个链表来组织,在插入操作和删除操作上比向
2017-09-11 23:54:26
9512
原创 [C++::STL]之map的用法
map#include< map > 映射,键值对容器。 map就是从键(key)到值(value)的映射。因为重载了 [ ] 运算符,map更像是数组的“高级版”。例如可以用一个map< string,int>month_name来表示“月份名字到月份编号”的映射,然后用 month_name[“July”]=7 这样的方式来赋值。类似于Python中的字典Dictionary与Java中的
2017-09-11 23:50:50
13133
原创 [C++::STL]之vector的用法
vector#include < vector > 向量,不定长数组。 与数组的区别在于声明时不需要指定长度,vector动态分配空间(线性连续地址)。插入和删除都比数组要方便很多。vector可以直接赋值,还可以作为函数的参数或者返回值,而无须像传递数组那样用另一个变量指定元素个数。
2017-09-11 23:47:07
983
原创 [备战软考]数据结构与算法基础
: 数据结构与算法基础数据结构与算法基础线性表顺序表链表链表的操作顺序表与链表的比较广度优先BFS最小生成树Prim算法Kruskal算法拓扑排序关键路径线性表1.顺序表顺序的存储结构,元素在内存中以顺序存储。内存中占用连续的一个区域。顺序表的删除 把要删除的元素后面每个元素向前移动一位顺序表的插入 把要插入的位置后面的(包括自己)所有元素向后移动一位,再把要插入的元素
2017-09-09 16:15:01
1121
原创 Count primes (模板题)
Count primesTime limit:1000 ms Memory limit:65768 kB Problem DescriptionEasy question! Calculate how many primes between [1…n]!InputEach line contain one integer n(1 <= n <= 1e11).Process to end of fi
2017-09-08 20:34:57
313
转载 素数算法总结
素数算法总结转载自:_Wilbert 在平时做题目或者进行预算的时候,素数的出现次数总是十分频繁。今天我们就来一点一点的说一说关于素数的一些算法。素数算法总结朴素判断素数算法Miller_Rabin素性测试筛选法容斥原理Meissel-Lehmer算法朴素判断素数算法就判断素数而言,事实上是非常简单的了。根据定义,判断一个整数n是否是素数,只需要去判断在整数区间[2, n-1]之内
2017-09-08 20:09:54
967
原创 HDU 4006:The kth great number(数据结构?)
The kth great numberTime limit:1000 ms Memory limit:65768 kB Problem DescriptionXiao Ming and Xiao Bao are playing a simple Numbers game. In a round Xiao Ming can choose to write down a number, or ask
2017-09-08 09:17:55
336
原创 The Frog's Games (二分)
The annual Games in frogs' kingdom started again. The most famous game is the Ironfrog Triathlon. One test in the Ironfrog Triathlon is jumping. This project requires the frog athletes to jump over the river. T
2017-09-06 20:42:45
718
原创 HDU 1058:Humble Numbers (水)
A number whose only prime factors are 2,3,5 or 7 is called a humble number. The sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 24, 25, 27, ... shows the first 20 humble numbers.
2017-09-05 20:54:36
240
原创 HDU 1025:Constructing Roads In JGShining's Kingdom(DP)
JGShining's kingdom consists of 2n(n is no more than 500,000) small cities which are located in two parallel lines.
2017-09-05 20:09:21
400
原创 2017湖南省第十三届ACM省赛总结
2017年9月2日,我,涛哥,学弟张灿,组队参加了2017年的湖南省赛,这里写个总结,作为以后参赛的经验。经过浙江中医药大学的罗杰老师指导,比赛前我们三人做了这样的分工,涛哥经验丰富,实力最强,作为队长;我的话实力很一般,好在编程基础较为扎实,心态稳定,愿意做苦力,作为本队的主键盘手,负责模拟和简单题;而张灿知识面广,模板熟悉,主要负责图论题。当然,题目并不是按照我们预想的套路出的,所以在比赛过程
2017-09-03 20:11:26
4327
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅