自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

  • 博客(25)
  • 收藏
  • 关注

原创 hdu1016 Prime Ring Problem

Problem Description A 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.Note

2016-11-30 18:17:01 385

原创 hdu2069 Coin Change

Problem Description Suppose there are 5 types of coins: 50-cent, 25-cent, 10-cent, 5-cent, and 1-cent. We want to make changes with these coins for a given amount of money.For example, if we have 11 c

2016-11-30 17:28:30 388

原创 hdu1709 The Balance

Problem Description Now you are asked to measure a dose of medicine with a balance and a number of weights. Certainly it is not always achievable. So you should find out the qualities which cannot be

2016-11-30 16:41:27 353

原创 hdu2082 找单词

Problem Description 假设有x1个字母A, x2个字母B,….. x26个字母Z,同时假设字母A的价值为1,字母B的价值为2,….. 字母Z的价值为26。那么,对于给定的字母,可以找到多少价值<=50的单词呢?单词的价值就是组成一个单词的所有字母的价值之和,比如,单词ACM的价值是1+3+14=18,单词HDU的价值是8+4+21=33。(组成的单词与排列顺序无关,比如ACM与C

2016-11-30 15:26:47 413

原创 hdu2152 Fruit

Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 4525 Accepted Submission(s): 2611Problem Description 转眼到了收获的季节,由于有TT的专业指导,Lele获得了大丰收。特别是水果,

2016-11-30 14:22:25 383

原创 hdu1085 Holding Bin-Laden Captive!

Problem Description We all know that Bin-Laden is a notorious terrorist, and he has disappeared for a long time. But recently, it is reported that he hides in Hang Zhou of China! “Oh, God! How terrib

2016-11-30 13:26:29 371

原创 hdu 1028 Ignatius and the Princess III

Problem Description “Well, it seems the first problem is too easy. I will let you know how foolish you are later.” feng5166 says.“The second problem is, given an positive integer N, we define an equat

2016-11-30 00:11:36 274

原创 hdu1171 Big Event in HDU

Problem Description Nowadays, we all know that Computer College is the biggest department in HDU. But, maybe you don’t know that Computer College had ever been split into Computer College and Software

2016-11-29 23:51:31 224

原创 hdu1398 Square Coins

Problem Description People in Silverland use square coins. Not only they have square shapes but also their values are square numbers. Coins with values of all square numbers up to 289 (=17^2), i.e., 1

2016-11-29 21:43:44 355

原创 邻接矩阵无向图的创建和遍历(dfs)

还是这个图,对它用邻接矩阵dfs遍历 #include<bits/stdc++.h> using namespace std; #define MAXVEX 20 #define infinity 0x3f3f3ftypedef struct { char arcs[MAXVEX][MAXVEX]; // 边信息 char vex[MAXVEX]; //顶点信息 i

2016-11-29 16:41:41 4035

原创 邻接表无向图的创建和遍历(dfs)

网上找的一个图,对这个图进行dfs /************************************************************************* > File Name: adjlist.cpp > Author:gens_ukiy > Mail: > Created Time: 2016年11月29日 星期二 07时22

2016-11-29 12:31:36 4944

原创 hdu1556

http://acm.hdu.edu.cn/showproblem.php?pid=1556Problem Description N个气球排成一排,从左到右依次编号为1,2,3….N.每次给定2个整数a b(a <= b),lele便为骑上他的“小飞鸽”牌电动车从气球a开始到气球b依次给每个气球涂一次颜色。但是N次以后lele已经忘记了第I个气球已经涂过几次颜色了,你能帮他算出每个气球被涂过几次

2016-11-28 19:52:46 350

原创 hdu1166(树状数组)

http://acm.hdu.edu.cn/showproblem.php?pid=1166思路 理解树状数组后直接可以套模板#include<iostream> #include<cstdio> using namespace std;template<class T> class Binary_Index_Tree{ public: T * a; T * c;

2016-11-28 12:59:21 315

原创 set基本操作

#include<bits/stdc++.h> using namespace std; int main(){ const int n=5; int a[n]={1,2,2,4,4}; multiset<int> s(a,a+n); //set 不支持迭代器相减 iterator1-iterator /* for(int i=0;i<n;i++)

2016-11-27 16:46:59 541

原创 std::copy() & std::back_inserter()

std::copytemplate<class InputIterator, class OutputIterator> OutputIterator copy (InputIterator first, InputIterator last, OutputIterator result) { while (first!=last) { *result = *first; +

2016-11-27 13:00:15 2402

原创 给定报文,哈弗曼编码、译码

#include<iostream> #include<malloc.h> #include<string.h> #include<algorithm> #include<map>using namespace std; typedef struct { char sign; int weight; int parent; int lchild; int rc

2016-11-25 09:59:29 1406

原创 Codeforces740B. Alyona and flowers

思路 对于选取的下标区间l <=x <=r;如果 Σsubarray[x]>0,就选取这个区间,否则不选#include<bits/stdc++.h> using namespace std; int a[105]; vector<int> b[105]; int main(){ int n,m; cin>>n>>m; for(int i=1;i<=n;i++)

2016-11-24 21:25:43 388

原创 Codeforces740A. Alyona and copybooks

http://codeforces.com/problemset/problem/740/A 思路 让n对4取模,re=n%4 re==0,直接输出 re==1,有可能差1本(a),有可能差1+4本( b+c ),有可能差1+4+4本(3c) re==2,有可能差2本(b or 2*a),有可能差2+4本(2 *c) re==3,有可能差3本(3*a or c or a+b)#

2016-11-24 21:19:44 393

原创 hdu1018 Big Number

http://acm.hdu.edu.cn/search.php?action=listproblem Stirling公式求解#include<cstdio> #include<cmath> #define PI 3.1415926 int main() { int T,n,re; scanf("%d",&T); while(T--)

2016-11-21 12:32:41 311

原创 Codeforces733A - Grasshopper And the String

#include<iostream> #include<cstring> #include<algorithm> using namespace std;bool pd(char c){ return (c=='A')||(c=='E')||(c=='I')||(c=='O')||(c=='U') ||(c=='Y')||(!c); } int main(){ char s[1000]

2016-11-20 18:54:36 394

原创 Codeforces727A. Transformation: from A to B

思路 从b推a, 如果b为偶数,b /= 2; 如果b mod 10 ==1,b = (b-1)/10; 如果b mod 10 == {3,5,7,9}等,输出”NO” #include<bits/stdc++.h> using namespace std; int path[1000]; int k=0; int main(){ int a,b;

2016-11-20 10:09:40 496

原创 Codeforce734B Anton and Digits

#include<bits/stdc++.h> using namespace std; #define ll long long int main(){ int k2,k3,k5,k6; //2 3 5 6 cin>>k2>>k3>>k5>>k6; ll sum=0; while(k2&&k5&&k6){ sum += 256;

2016-11-17 21:14:21 313

原创 Codeforce734A Anton and Danik

#include<bits/stdc++.h> using namespace std; int main(){ int n; string s; cin>>n>>s; int c1=0; int c2=0; for(int i=0;i<s.length();i++){ if(s[i]=='A'){ c1++;

2016-11-17 21:05:39 359

转载 Catalan数计算及应用

问题描述:卡塔兰数,是组合数学中一个常出现在各种计数问题中出现的数列。输入一个整数n,计算h(n)。其递归式如下:h(n)= h(0)*h(n-1)+h(1)*h(n-2) + ... + h(n-1)h(0) (其中n>=2,h(0) = h(1) = 1)    该递推关系的解为:h(n)=C(2n,n)/(n+1) (n=1,2,3,...)         思路:直接根据递归式,

2016-11-09 23:19:48 412

转载 next_permutation函数

这是一个求一个排序的下一个排列的函数,可以遍历全排列,要包含头文件 下面是以前的笔记   与之完全相反的函数还有prev_permutation     (1) int 类型的next_permutation   int main() {  int a[3]; a[0]=1;a[1]=2;a[2]=3;  do { cout } while (next_permutati

2016-11-06 22:46:37 377

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除