最新文章列表

HDU 4006 The kth great number(优先队列、堆实现)

/* 题意:"I"表示输入数据,"Q"表示输出第k大数据 题解:优先队列,从大到小,队列中只需要k个元素。每次输出最小的即可 我用小顶堆实现,如果插入元素比tree[1]小,则直接舍掉。否则,更新。 */ #include <iostream> using namespace std; const int nMax = 1000010; int ...
HDU 
jiaohe333 评论(0) 有8人浏览 2012-08-15 13:41

【并查集】hdu 1325 Is It A Tree? 或 poj 1308 Is It A Tree?

  /* THE PROGRAM IS MADE BY PYY */ /*----------------------------------------------------------------------------// Copyright (c) 2012 panyanyany All rights reserved. URL : http://ac ...
panyanyany 评论(0) 有1724人浏览 2012-04-10 17:55

HDU1000

HDU 1000 注意:1、不止有一组测试数据,所以用while   #include<stdio.h> int main(){ int a,b; while (scanf("%d %d",&a,&b)==2){ printf("%d\n",a+b); } ret ...
麦蒂小东 评论(0) 有969人浏览 2012-03-24 02:03

HDU 1008 Elevator

原题:http://acm.hdu.edu.cn/showproblem.php?pid=1008 JAVA 代码(AC): import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(Sy ...
JAVA那点事 评论(0) 有1226人浏览 2012-02-14 19:30

HDU 1009 FatMouse' Trade

原题:http://acm.hdu.edu.cn/showproblem.php?pid=1009 Problem Description:  FatMouse准备了M磅的Cat-Food,以便用来跟小Cat交换好吃的JavaBean。  现在有N个房间,第i个房间有J[i]磅的JavaBean,其交换的筹码是F[i]磅的Cat-Food。 当然,FatMouse还是有很大的选择权的,对 ...
JAVA那点事 评论(0) 有2006人浏览 2012-02-09 15:56

【最小生成树+Prim】杭电 hdu 1875 畅通工程再续

/* THE PROGRAM IS MADE BY PYY */ /*----------------------------------------------------------------------------// Copyright (c) 2012 panyanyany All rights reserved. URL : http://acm.hd ...
panyanyany 评论(0) 有1254人浏览 2012-02-07 16:19

【最小生成树+Prim】杭电 hdu 1863 畅通工程

/* THE PROGRAM IS MADE BY PYY */ /*----------------------------------------------------------------------------// Copyright (c) 2012 panyanyany All rights reserved. URL : http://acm.hd ...
panyanyany 评论(0) 有1327人浏览 2012-02-05 14:13

【ACM】杭电 hdu 1482 Counterfeit Dollar

  /* THE PROGRAM IS MADE BY PYY */ /*----------------------------------------------------------------------------// Copyright (c) 2011 panyanyany All rights reserved. URL : http://acm.h ...
panyanyany 评论(0) 有1103人浏览 2012-01-22 15:36

【最短路+dijkstra】 2680 Choose the best route

  /* THE PROGRAM IS MADE BY PYY */ /*----------------------------------------------------------------------------// Copyright (c) 2011 panyanyany All rights reserved. URL : http://acm.hdu. ...
panyanyany 评论(0) 有1118人浏览 2012-01-15 10:30

【最短路+floyd】杭电 hdu 1217 Arbitrage

  /* THE PROGRAM IS MADE BY PYY */ /*----------------------------------------------------------------------------// Copyright (c) 2011 panyanyany All rights reserved. URL : http://acm.hdu. ...
panyanyany 评论(0) 有1091人浏览 2012-01-15 09:55

【BKDR_hash】HDU 2648 Shopping

KIDx 的解题报告   题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2648 题意很简单,不解释,用map暴力也可以,但是要1000ms左右,或者更慢   引用:各种字符串Hash函数比较   其中我用的是BKDR Hash: // BKDR Hash Function unsigned int BKDRHash(char *st ...
基德KID.1412 评论(0) 有1827人浏览 2011-12-10 19:35

【三分】HDU 2241 考研路茫茫——早起看书

KIDx 的解题报告 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2241 解题思路: 由题意得:【设题目所给m个点存放到点结构p[m]中】 F = n/(x^2) 设Y是第i-1个点跟第i个点连线的方程【设k是这2点连线的斜率】 则:【根据题目:i<j Xi<Xj 且 Yi<=Yj】 Y = k * (x-p[i-1].x) ...
基德KID.1412 评论(0) 有1426人浏览 2011-12-09 18:16

【二分】HDU 2141 Can you find it?

KIDx 的解题报告 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2141 题意很简单 很好的一道二分+降维思想的题! #include <iostream> #include <algorithm> using namespace std; #define eps 1e-8 #define PI 3.1415 ...
基德KID.1412 评论(0) 有1673人浏览 2011-12-07 22:19

【树状数组 + 简单题】杭电 hdu 1166 敌兵布阵

/* THE PROGRAM IS MADE BY PYY */ /*----------------------------------------------------------------------------// Copyright (c) 2011 panyanyany All rights reserved. URL : htt ...
panyanyany 评论(0) 有1576人浏览 2011-09-18 15:04

杭电 hdu 1213 How Many Tables (并查集,简单题)

/* THE PROGRAM IS MADE BY PYY */ /*----------------------------------------------------------------------------// Copyright (c) 2011 panyanyany All rights reserved. URL : http://acm.hd ...
panyanyany 评论(0) 有1620人浏览 2011-09-04 14:33

杭电 hdu 1498 50 years, 50 colors (二分图,最大匹配)

/* THE PROGRAM IS MADE BY PYY */ /*----------------------------------------------------------------------------// Copyright (c) 2011 panyanyany All rights reserved. URL : http://acm.hdu.edu.cn ...
panyanyany 评论(0) 有984人浏览 2011-08-26 21:10

杭电 hdu 1305 Immediate Decodability

/* THE PROGRAM IS MADE BY PYY */ /*----------------------------------------------------------------------------// Copyright (c) 2011 panyanyany All rights reserved. URL : http://acm.hdu.edu.cn ...
panyanyany 评论(0) 有867人浏览 2011-08-24 21:32

杭电 hdu 1874 畅通工程续

第二次 /* THE PROGRAM IS MADE BY PYY */ /*----------------------------------------------------------------------------// Copyright (c) 2011 panyanyany All rights reserved. URL : http://acm.hdu. ...
panyanyany 评论(0) 有1160人浏览 2011-08-19 21:52

杭电 hdu 2066 一个人的旅行

第二次 /* THE PROGRAM IS MADE BY PYY */ /*----------------------------------------------------------------------------// Copyright (c) 2011 panyanyany All rights reserved. URL : http://acm.hdu ...
panyanyany 评论(0) 有1090人浏览 2011-08-19 20:52

杭电 hdu 2896 病毒侵袭

/* THE PROGRAM IS MADE BY PYY */ /*----------------------------------------------------------------------------// Copyright (c) 2011 panyanyany All rights reserved. URL : http://acm.hdu.edu. ...
panyanyany 评论(0) 有998人浏览 2011-08-19 16:57

最近博客热门TAG

Java(141747) C(73651) C++(68608) SQL(64571) C#(59609) XML(59133) HTML(59043) JavaScript(54918) .net(54785) Web(54513) 工作(54116) Linux(50906) Oracle(49876) 应用服务器(43288) Spring(40812) 编程(39454) Windows(39381) JSP(37542) MySQL(37268) 数据结构(36423)

博客人气排行榜

    博客电子书下载排行

      >>浏览更多下载

      相关资讯

      相关讨论

      Global site tag (gtag.js) - Google Analytics