2009ACM多校联合暑期集训(1)——TJU专场

来源:互联网 发布:cad图纸加密软件 编辑:程序博客网 时间:2024/06/05 18:10

 http://acm.hdu.edu.cn/showproblem.php?pid=2817

 

http://acm.hdu.edu.cn/forum/read.php?tid=13874//解题报告

 

2817 A sequence of numbers——ac.

   其实题目挺简单的,用二分做就行。

 

2822 Dogs——赛后ac.

    是搜索题,要用到优先队列,比赛后学会。后来用着挺顺的。

格式

只有一个条件的

struct node// return dignum>t.dignum;//按dignum小的返回 
                          //若return  dignum<t.dignum,按dignum大的返回 ;
                   //记住固定格式
{
 bool operator <(const node t)const
 {
     return dignum>t.dignum;
 }

 int dignum;
 int x,y;
}top,next,start;

两个条件的优先队列

struct node
{
 int change,cnt,x,y;
 bool operator <(const node t)const
 {
  if(change==t.change)
   return cnt>t.cnt;
  else
   return change>t.change;
 }
}top,start,next;

 

 

 

 

原创粉丝点击