- 博客(7)
- 收藏
- 关注
原创 CodeForces 253E Printer
题目链接 题意:有N份文件需要打印,每行输入该文件传入时间第ti秒,需要打印的时间si秒,和打印优先级pi。每一秒打印机都打印优先级最高的文件,传入的N份文件中有一份优先级为-1代表未知。已知所有文件全部都完成打印的时间为T,求优先级未知的文件的优先级可以为多少,按顺序输出每份文件打印结束的时间。 题解:二分文件的优先级,判断是否成立,最后按输入顺序输出。 #incl
2015-10-30 17:17:27
1365
原创 CodeForces 253D Table with Letters - 2
Description input input.txt output output.txt Vasya has recently started to learn English. Now he needs to remember how to write English letters. He isn't sure about some of them, so
2015-10-30 17:11:16
448
原创 CodeForces 253C Text Editor
题意:模拟一个文本编辑器,按上键光标会到上一行相同位置,若为第一行则不动,若上一行长度小于当前位置,则到上一行行尾,下键同理,左右则光标向左向右移动一位,若为最前端或最后端则不动,输入一个N行的文本,每行有ai个字符,求从第r1行c1位到r2行c2位最少需要按键多少次。 题解:要考虑到按上下键时某一行特别短时可以利用移动到这一行来加快从右端左移的速度。所以假设最少的按键方法必须按到某一行,暴力枚
2015-10-30 16:42:52
744
原创 CodeForces 253B Physics Practical
Description input input.txt output output.txt One day Vasya was on a physics practical, performing the task on measuring the capacitance. He followed the teacher's advice and did as m
2015-10-30 16:15:42
489
原创 CodeForces 253A Boys and Girls
Description input input.txt output output.txt There are n boys and m girls studying in the class. They should stand in a line so that boys and girls alternated there as much as poss
2015-10-30 16:05:52
351
原创 HDU 5172 GTY's gay friends(线段树)
题意:给你n个数,有m次询问,每次询问[l,r]的区间内是否为1到r-l+1的全排列。对于1到r-l+1的全排列,和可以通过一个数组记录前缀和。接下来就是去重,我们可以用线段树储存每个数上一个相同的数的位置,线段树的每个点即为区间内上一个数位置的最大值,若求得的值小于l,即满足条件,输出YES。#include<stdio.h> #include<queue> #include<cstring> #
2015-10-20 20:37:50
447
原创 UVA 10118 Free Candies
UVA 10118 Free Candies题意:有4堆糖果,每堆有n(最多40)个,有一个篮子,最多装5个糖果,我们每次只能从某一堆糖果里拿出一个糖果,如果篮子里有两个相同的糖果,那么就可以把这两个(一对)糖果放进自己的口袋里,问最多能拿走多少对糖果。糖果种类最多20种.#include<stdio.h> #include<queue> #include<cstring> #include<i
2015-10-20 19:10:12
333
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人