自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(34)
  • 收藏
  • 关注

原创 hdu 1937 Finding Seats

#include#include#include#includeusing namespace std;int map[310][310], sum[310][310];int r, c, k, ans;char str[310];int main(){    while(scanf("%d%d%d",&r,&c,&k)!=EOF)    {

2016-08-02 11:11:40 293

原创 Jessica's Reading Problem(尺取法)

DescriptionJessica's a very lovely girl wooed by lots of boys. Recently she has a problem. The final exam is coming, yet she has spent little time on it. If she wants to pass it, she has to mast

2016-08-02 09:38:07 277

转载 C++中Map的基本用法

Map是c++的一个标准容器,她提供了很好一对一的关系,在一些程序中建立一个map可以起到事半功倍的效果,总结了一些map基本简单实用的操作!1. map最基本的构造函数;   mapmapstring;         mapmapint;   mapmapstring;         mapmapchar;   mapmapchar;            mapmapint

2016-08-02 09:06:05 214

原创 hdu 2289 Cup

Problem DescriptionThe WHU ACM Team has a big cup, with which every member drinks water. Now, we know the volume of the water in the cup, can you tell us it height?The radius of the cup's top

2016-08-01 20:55:19 182

转载 动态规划

目录   一、动态规划初探      1、递推      2、记忆化搜索      3、状态和状态转移      4、最优化原理和最优子结构      5、决策和无后效性 二、动态规划的经典模型       1、线性模型       2、区间模型       3、背包模型       4、状态压缩模型       5、树状模型三、动态

2016-07-29 20:54:15 699

原创 hdu 1069 (dp)

#include#include#includeusing namespace std;struct node{    int l,w,h;} s[111];int dp[111];int cmp(node a,node b){    if(a.l>b.l) return 1;    if(a.l==b.l&&a.w>b.w)  return 1;

2016-07-29 20:32:39 204

原创 hdu 1025 && hdu 1058

hdu 1025 #include#include#includeusing namespace std;int dp[500005], s[500005], len, Case=0;int search(int a, int b, int c){ int mid; while(ab) { mid = (a + b) / 2;

2016-07-29 11:14:29 204

转载 DP之最长上升子序列O(n*logn)算法

DP之最长上升子序列O(n*logn)算法 举着见过的例子要说明吧!       假设一个序列d[1..9] = 2 1 5 3 6 4 8 9 7,可以看出来它的LIS长度为5.下面慢慢的一步一步的找出它的LIS.       我们定义一个了序列为B,然后用i从1到9慢慢的考察。另外再定义一个len来记录当前的最长序列的长度首先,把d[1]有序地放到B里,令B[1]

2016-07-29 09:50:49 252

原创 BerSU Ball

DescriptionThe Berland State University is hosting a ballroom dance in celebration of its 100500-th anniversary! n boys and m girls are already busy rehearsing waltz, minuet, polonaise and quadr

2016-07-24 19:50:25 241

原创 The Monocycle

题目内容:你的任务是寻找一个最小的正整数,它的各个位置上的数字乘积为输入的非负整数Q。 输入 一个数Q,0<=Q<=10^9 输出你所找到的最小的正整数。如果它不存在,那么输出-1; 样例: 输入 :10 输出:25 样例解释:2*5=10注意0和1的存在;#includeint n;void judge(){    int i=9, s[20]={0}, j=0;

2016-07-24 19:32:34 164

转载 dfs 和bfs

广度/宽度优先搜索(BFS)【算法入门】郭志伟@SYSU:raphealguo(at)qq.com2012/04/271.前言广度优先搜索(也称宽度优先搜索,缩写BFS,以下采用广度来描述)是连通图的一种遍历策略。因为它的思想是从一个顶点V0开始,辐射状地优先遍历其周围较广的区域,故得名。 一般可以用它做什么呢?一个最直观经典的例子就是走迷宫,我们从起点开始

2016-07-22 20:55:02 217

原创 hdu 1175连连看

Accepted#include#include#includeusing namespace std;int s[1002][1002];struct node{    int x;    int y;    int num;    int ff;    bool operator     {        return num>a.num

2016-07-20 21:00:23 172

原创 hdu 1242 Rescue

#include#include#includeusing namespace std;int n, m, sx, sy, judge[210][210], d[4][2] = {{-1, 0}, {0, -1}, {0, 1}, {1, 0}};char map[210][210];struct node{    int x, y, time;     

2016-07-20 15:43:18 231 1

转载 stdio.h 部分成员函数介绍

stdio.h 部分成员函数介绍 在接下来的内容里,我们将学习标准I/O库中的下列库函数:

2016-07-20 15:25:06 487

原创 hdu 1495 非常可乐

两个杯子按大小排序,为S>M>N,1.只要n满了,就把n里的东西放到s中2.只要m非空,就把m中的放到n中3.如果m为空,把s中的放到m中超时代码#includeint n, m, s;int main(){    while(scanf("%d%d%d",&s,&n,&m)!=EOF)    {        if(s==0

2016-07-19 19:51:22 172

原创 iostream和iostream.h的区别 && VC中iostream的区别

#include    //1998年标准化后的头文件#include //1998年之前的头文件本质为iostream把标准C++库组件放在一个名为std的namespeace里面,而iostream.h把这些标准组件放在全局空间里。使用前者需要加命名空间using namespeace std,后者不需要,否者会引起编译错误。stdio 是C标准库里面的函数库,

2016-07-19 11:12:46 367

转载 STL 中队列的使用(queue)

基本操作:push(x) 将x压入队列的末端pop() 弹出队列的第一个元素(队顶元素),注意此函数并不返回任何值front() 返回第一个元素(队顶元素)back() 返回最后被压入的元素(队尾元素)empty() 当队列为空时,返回truesize() 返回队列的长度 使用方法:头文件:#include  

2016-07-18 10:27:22 218

转载 c语言中long long的用法

在分析BT代码的过程中,遇到了这样的定义:long long line_position;很是纳闷,在C语言中我还没有见过这样的写法,网上搜了,资料也很少,最后在C语言标准与实现这本书中找到了关于long long的说法。在C语言的C99标准扩展了新的整数类型 long long,long是32位宽,占4个字节,long long通常被定义成 64 位宽,也就可以实现了在32位机器上可以扩展8字节

2016-07-14 21:03:03 14456

原创 hdu 2000 ASCII码排序

#include#includeusing namespace std;int main(){    char s[5];    while(scanf("%s",s)!=EOF)    {        int i, j;        char ch;        sort(s, s+3);        for(i=0; i   

2016-07-14 19:57:23 228

原创 hdu 5655(拼四边形)

注意long long 的范围!!!!!#include#includeusing namespace std;int main(){    int t;    scanf("%d",&t);    while(t--)    {        int i, j;        long long  s[10];        for(i=1

2016-07-14 19:32:33 211

原创 hdu 5645(取球&&概率)

#includeint main(){ int t; scanf("%d",&t); while(t--) { int n, i, s[600], j; scanf("%d",&n); for(i=0; in; i++) { scanf("%d",&s[i]);

2016-07-14 19:29:56 241

转载 hdu 5641 password

#include#includeint map[15][15];int vis[15];int main(){    map[1][3] = map[3][1] = 2;    map[1][7] = map[7][1] = 4;    map[3][9] = map[9][3] = 6;    map[7][9] = map[9][7] = 8; 

2016-07-14 19:26:40 321 3

原创 hdu 5640(切蛋糕)

#includeint main(){ int t, i; scanf("%d",&t); for(i=1; it; i++) { int n, m, sum = 0; scanf("%d%d",&n, &m); while(!0) { if(n>m)

2016-07-14 19:21:52 319

转载 HDU 4310 Hero

#include  #include  #include  using namespace std;  struct node  {      int hp,dps;  }s[50];  bool cmp(node x,node y)  {      return (1.0*x.dps/x.hp)>(1.0*y.dps/y.hp);  }  int

2016-07-14 11:12:16 165

转载 Vika and Squares(颜料)

#include#includeusing namespace std;int main(){    long long n, i, s[400005], minn, sum;    scanf("%I64d",&n);    for(i=1; i    {        scanf("%I64d", &s[i]);        s[i+n] = s[

2016-07-13 20:12:44 295

原创 HDU 今年暑假不AC

#includeint main(){ int n, s[110]={0}, t[110]={0}, i, j, a, b; while(scanf("%d", &n)!=EOF) { if(n==0) break; for(i=0; in; i++) scanf("%d%d",&s[i]

2016-07-13 19:57:47 168

原创 HDU Saving

#includestruct msg{    int  pi;    double mi;}s[100],t;int main(){    int n, i, j, sum;    double v;    while(scanf("%lf%d",&v,&n)!=EOF)    {        if(v==0)break;        f

2016-07-13 19:54:22 155

原创 杭电2021发工资咯:)

#includeint main(){ int n, i, s[105]; while(scanf("%d",&n)!=EOF) { if(n==0) break; for(i=0; in; i++) scanf("%d",&s[i]); int sum = 0;

2016-07-13 17:10:30 236

原创 取书

#include int main(){    int n, m, i, s[200000], t[100]={0}, sum=0, j;    scanf("%d%d",&n, &m);    while(n        break;    for(i=0; i        scanf("%d",&s[i]);    for(i=0; i    {

2016-07-12 20:16:18 202

原创 u盘和文件

#include#includeusing namespace std;bool cmp(int a , int b){    return a>b;}int main(){    int n, m, s[100], i, sum=0;    scanf("%d",&n);    scanf("%d",&m);    for(i=1; i 

2016-07-12 19:50:16 163

原创 是否能够组成长方形(不包括正方形)

#includeint main(){    int n, i, j, sum = 0;    scanf("%d",&n);    if(n%2!=0)        printf("%d", sum);    if(n%2==0 && n%4==0)        printf("%d",n/4-1);    if(n%2==0

2016-07-12 19:38:38 405

原创 十进制转换为其他进制数

#includechar change(int r){ if(r10) return(r+'0'); if(r == 10) return'A'; if(r == 11) return'B'; if(r == 12) return'C'; if(r == 13) return

2016-07-11 20:55:02 243

原创 判断三个数是否能够组成一个三角形

#includedouble abs(double a, double b){ double c; if((a-b)0) c = b - a; else c = a - b; return c;}int judge(){ double x1, x2, x3; scanf("%lf%lf%lf",&x1

2016-07-11 20:31:31 1864

原创 求最小公倍数

#includelong long s[1000];long long GYS (long long a, long long b){  if(b!=0)    return GYS(b, a%b);  return a;}int main(){   int i, j, n, m;   long long  flag;   while(scanf

2016-07-11 20:10:50 208

空空如也

空空如也

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

TA关注的人

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