设为首页 加入收藏

TOP

HDU4666+POJ2926[最远曼哈顿距离]
2014-11-23 17:37:18 来源: 作者: 【 】 浏览:21
Tags:HDU4666 POJ2926 最远 曼哈顿 距离

一开始就明白那个N*1《k的算法了,

可无奈删除操作耗时还是太多,最后学习了STL set,map相应的用法,方便好多。

STL真的是一个好工具

#include   
#include   
#include   
#include   
#include   
#include   
using namespace std;  
multiset a[60005];  
int x[60005][6];  
int main()  
{  
  int n,k,op,num;  
  while(scanf("%d%d",&n,&k)!=EOF)  
  {  
      for(int i=0;i<1<::iterator sum=a[j].find(s);  
                  a[j].erase(sum);  
              }  
          }  
          int ans=-100000000;  
          for(int j=0;j<1<::iterator t=a[j].end();  
              t--;  
              int t1=(*t);  
              t=a[j].begin();  
              int t2=(*t);  
              ans=max(ans,t1-t2);  
          }  
          printf("%d\n",ans);  
      }  
  }  
  return 0;  
}  

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇HDU 4662――MU Puzzle 下一篇ZOJ 3630 Information 强连通

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·请问c语言刚入门,该 (2025-12-26 10:21:04)
·python 编程怎么定义 (2025-12-26 10:21:01)
·09-指 针 (一)-c语言 (2025-12-26 10:20:58)
·About - Redis (2025-12-26 08:20:56)
·Redis: A Comprehens (2025-12-26 08:20:53)