• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
One_asshole's_blog
All the gods, all the heavens, all the hells are within you!
博客园 | 首页 | 新随笔 | 新文章 | 联系 | 订阅 订阅 | 管理

2016年11月17日

各种模板(part 2)
摘要: 堆: 1 using namespace dui //堆 2 { 3 #include<queue> //需要的库 4 priority_queue < int > Q; //定义一个Q的大根堆,top()为较大的 5 priority_queue < int,vector < int >,grea 阅读全文
posted @ 2016-11-17 17:03 One_asshole's_blog 阅读(335) 评论(0) 推荐(0)
 
各种模板(part 1)
摘要: GCD: 1 int gcd(int a,int b) 2 { 3 return b==0?a:gcd(b,a%b); 4 } 快速幂: 1 void work(int x,int y) //x^y 2 { 3 int ans=1; 4 while(y!=0) 5 { 6 if(y%2==1) 7 阅读全文
posted @ 2016-11-17 10:41 One_asshole's_blog 阅读(283) 评论(2) 推荐(0)
 
WINDOW(单调队列的应用)
摘要: 给你一个长度为 N 的数组,一个长为 K 的滑动的窗体从最左移至最右端, 你只能见到窗口的K个数,每次窗体向右移动一位,如下表: 你的任务是找出窗口在各位置时的 max value,min value. INPUT: 第 1 行 n,k, 20%:n<=500; 50%: n<=100000; 10 阅读全文
posted @ 2016-11-17 08:36 One_asshole's_blog 阅读(492) 评论(0) 推荐(0)
 
 

公告


博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3