- 博客(17)
- 收藏
- 关注
原创 HDU 1426
代码如下:#include#include#include#include using namespace std;const int MAX=10;char map_[MAX][MAX];int pos[MAX*9][2];bool row[MAX][MAX], list[MAX][MAX];int k;bool check(int v,int num){
2017-03-16 22:58:59 261
原创 HDU 4788
//HDU 4788 - Hard Disk Drive//By Pan Zhongfu 2016/10/23//problem: http://acm.hdu.edu.cn/showproblem.php?pid=4788#include #include #include using namespace std;int T, m;string s;double r;int m
2016-10-24 23:00:36 303
原创 COJ 1204
#include #include #include using namespace std;int main(){ int T; scanf("%d", &T); long long L, A, B; while(T--) { scanf("%lld %lld %lld", &L, &A, &B); if(L % 2 != 0) { printf("0\n"
2016-10-16 01:32:22 260
原创 POJ 1258 Agri-net
#include #include #include #include #include using namespace std;#define MAXN 105#define INF 0xffffffclass Graph{ private: int V[MAXN]; int v; int e; int g[MAXN][MAXN]; public: Gr
2016-10-16 01:31:26 184
原创 ACM竞赛宣讲
或许有人还不清楚这个比赛有什么用。那我告诉你们,参加这个比赛,可以让你期末C++的成绩90分以上,让你熟悉C与C++语言,虐杀各种C++实验。经过两个月的集训,你可以在三分钟内完成计算机二级C语言机试,然后在监考惊讶的目光中潇洒离开,深藏功与名。你也可以提前和下学期将要学习的数据结构,以及大二上学期学习的算法课程打交道,并在未来轻松虐之。你会认识一些将来或许能对你有帮助的学长。比赛后,你可以在综合
2016-10-16 01:29:41 1753
原创 STL - stack&queue&priority_queue
STL 中优先队列的使用方法(priority_queu)基本操作:empty() 如果队列为空返回真pop() 删除对顶元素push() 加入一个元素size() 返回优先队列中拥有的元素个数top() 返回优先队列对顶元素在默认的优先队列中,优先级高的先出队。在默认的int型中先出队的为较大的数。使用方法:头文件:
2016-10-16 01:28:52 207
原创 STL-Vector
1. 概念 vector是一种序列式容器,所谓序列式容器,即其中的元素可以排序,但是并未排序。可以把vector可作为加强版的array,它和array一样,存储空间是一段连续的内存,因此支持随机访问,但是,和array相比,vector支持动态增加数据。 vector支持动态增加数据,同时又需要保持空间的连续性从而支持随机访问,因此,在对vector动态增加元素时,如果旧有空间装满,需要
2016-10-16 01:28:02 143
原创 C 语言产生随机数的方法
在 C 语言中, rand() 函数可以用来产生随机数,但是这不是真真意义上的随机数,是一个伪随机数,是根据一个数,我们可以称它为种子,为基准以某个递推公式推算出来的一系数,当这系列数很大的时候,就符合正态公布,从而相当于产生了随机数,但这不是真正的随机数,当计算机正常开机后,这个种子的值是定了的,除非你破坏了系统,为了改变这个种子的值,C 提供了 srand() 函数,它的原形是 void
2016-10-16 01:26:22 266
原创 快速掌握单片机的4个步骤
1. 认清单片机的具体型号单片机就跟我们身边的朋友一样,都有一个具体的名字,当听到朋友的名字后你就能马上回想起这个朋友的长相特征、性格特征等,人记对了做事就明确了不会张冠李戴。学习单片机也一样,在学习或者使用单片机之前一定要明确厂商,此外具体的型号一定要记清楚。只有记对了型号在查资料、找数据手册的时候才有针对性。2. 要知道开发环境并会搭建编程工程
2016-10-16 01:24:46 596
原创 COJ 1722 漫漫求学路
#include #include #include using namespace std;const int N = 35;long long m[N][2];long long n;int main(){ while(scanf("%lld", &n) != EOF) { n++; for(int i = 0; i < N; i++) { m[i][0]
2016-10-16 01:22:43 260
原创 COJ 1347 Last Digit
#include #include using namespace std;int main(){ int T; long n, k; cin >> T; for(int t = 0; t < T; t++) { int r = 0; int r0 = 0; cin >> n >> k; for(int i = 0; i <= 9; i++) { r0
2016-10-16 01:20:15 199
原创 COJ 1078 最长公共子序列
#include #include #include #include #include #include using namespace std;class N{ public: int data; bool in; N() { data = -1; in = false; }};list s;list::iterator it;in
2016-10-16 01:18:42 259
原创 2016ACM暑假集训 - Sticks
DescriptionGeorge took sticks of the same length and cut them randomly until all parts became at most 50 units long. Now he wants to return sticks to the original state, but he forgot how many sti
2016-07-24 20:27:44 461
原创 2016ACM暑假集训 - Prime Ring Problem
DescriptionA ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circle separately, and the sum of numbers in two adjacent circles should be a prime. No
2016-07-22 23:46:57 269
原创 2016ACM暑假集训 - 4 Values whose Sum is 0
DescriptionThe SUM problem can be formulated as follows: given four lists A, B, C, D of integer values, compute how many quadruplet (a, b, c, d ) ∈ A x B x C x D are such that a + b + c + d = 0
2016-07-22 23:26:22 370
原创 2016ACM暑假集训 - Can you find it?
DescriptionGive you three sequences of numbers A, B, C, then we give you a number X. Now you need to calculate if you can find the three numbers Ai, Bj, Ck, which satisfy the formula Ai+Bj+Ck = X.
2016-07-21 22:46:05 225
原创 2016ACM暑假集训 - Sacrament of the sum
Description— The Brother of mine, the Head of Monastic Order wants to know tomorrow about the results long-term researches. He wants to see neither more nor less than the Summering Machine! Even m
2016-07-21 22:36:18 234
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人