
模拟
文章平均质量分 56
___fouzhe
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
uva 10881(ants)
题目: Piotr likes playing with ants. He has n of them on a horizontal pole L cm long. Each ant is facing either left or right and walks at a constant speed of 1 cm/s. When two ants bump into each other原创 2016-03-06 11:31:08 · 316 阅读 · 0 评论 -
uvalive 4254(二分+模拟)
分析: 大方向是二分答案,对每一秒进行模拟,判断是否能够处理完在这个时刻可以处理的任务,可以用优先队列储存当前可以执行的任务。当队列中元素不为空且里面有的元素的结束时间小于当前秒时,不能处理完;当队列中元素为空且判断完所有元素时说明可以以该速度执行。 ac代码:#include<iostream>#include<cstdio>#include<algorithm>#include<que原创 2016-03-08 17:00:46 · 499 阅读 · 0 评论 -
LCA模版
LCA在线算法:/*POJ 1330求最近公共祖先(LCA)在线算法 DFS+ST描述对于本题只有一个查询,不适合用在线算法,用离线算法效率更高*/#include#include#include#include#includeusing namespace std;/**********************************************原创 2016-09-09 16:54:36 · 325 阅读 · 0 评论 -
Codeforces Round #176 (Div. 2) D. Shifting(模拟,STLdeque应用)
题目链接D. Shiftingtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputJohn Doe has found the beautiful permut原创 2017-02-22 15:35:42 · 487 阅读 · 0 评论