zjuoj 3607 Lazier Salesgirl】的更多相关文章

http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3607 Lazier Salesgirl Time Limit: 2 Seconds      Memory Limit: 65536 KB Kochiya Sanae is a lazy girl who makes and sells bread. She is an expert at bread making and selling. She can sell th…
Lazier Salesgirl Time Limit: 2 Seconds Memory Limit: 65536 KB Kochiya Sanae is a lazy girl who makes and sells bread. She is an expert at bread making and selling. She can sell the i-th customer a piece of bread for price pi. But she is so lazy that…
题目:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3607 题意:一个卖面包的小姑娘,给第i个来买面包的人的价格是pi, 每个人的时间是ti, 问用最小的时间间隔 求最大的平均值. 刚开始没有 考虑,后一个的时间间隔要大于之前的最大的时间间隔 才行... #include <iostream> #include <cstdio> #include <cstring> #include <…
这个题比上个题简单得多,也是超过W时间会睡着,睡着就再也不会卖了,顾客按时间顺序来的,但是可能有顾客同时到(同时到如果醒着就全卖了),并且每个人只买一块面包,也是求最大的W,使得卖出面包的平均价格最高. 同理最大的W一定是某两个相邻人的时间差.因为睡着了就不会醒了,所以枚举的时间差必须越来越大.如果某个时间差比前面枚举过的小也没啥意义(因为在前面就会睡着).因此,直接枚举第i个人和第(i-1)个人的那个时间差(在此之前的时间差都比这个小),然后从第(i+1)个人开始连续一段人的时间差都不超过这个…
Kochiya Sanae is a lazy girl who makes and sells bread. She is an expert at bread making and selling. She can sell the i-th customer a piece of bread for price pi. But she is so lazy that she will fall asleep if no customer comes to buy bread for mor…
Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%lld & %llu Submit Status Practice ZOJ 3607 Description Kochiya Sanae is a lazy girl who makes and sells bread. She is an expert at bread making and selling. She can sell the i-th custome…
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3606 Lazy Salesgirl Time Limit: 5 Seconds      Memory Limit: 65536 KB Kochiya Sanae is a lazy girl who makes and sells bread. She is an expert at bread making and selling. She can sell the …
Description Kochiya Sanae is a lazy girl who makes and sells bread. She is an expert at bread making and selling. She can sell the i-th customer a piece of bread for price pi. But she is so lazy that she will fall asleep if no customer comes to buy b…
Kochiya Sanae is a lazy girl who makes and sells bread. She is an expert at bread making and selling. She can sell the i-th customer a piece of bread for price pi. But she is so lazy that she will fall asleep if no customer comes to buy bread for mor…
http://blog.csdn.net/ffq5050139/article/details/7832991 http://blog.watashi.ws/1944/the-8th-zjpcpc/ http://blog.csdn.net/crescent__moon/article/details/16801097 #include<cstdio> #include<cstring> ; double t[Max],p[Max],lev[Max]; double max(dou…
The 9th Zhejiang Provincial Collegiate Programming Contest A    Taxi Fare    25.57% (166/649)     (水题)    计算两种计程车计费方式的差值, 注意四舍五入    B    Unrequited Love    14.00% (7/50)    水题) C    Count the Trees    9.87% (8/81)   (二叉树)    卡特兰数应用的问题     D    Draw S…
Lazy Salesgirl Time Limit: 5 Seconds      Memory Limit: 65536 KB Kochiya Sanae is a lazy girl who makes and sells bread. She is an expert at bread making and selling. She can sell the i-th customer some pieces of bread at price pi for each piece. But…
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3773 Paint the Grid Time Limit: 2 Seconds      Memory Limit: 65536 KB      Special Judge Leo has a grid with N × N cells. He wants to paint each cell either black or white. After he finishe…
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3780 Paint the Grid Again Time Limit: 2 Seconds      Memory Limit: 65536 KB Leo has a grid with N × N cells. He wants to paint each cell with a specific color (either black or white). Leo h…
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3602 Count the Trees Time Limit: 2 Seconds      Memory Limit: 65536 KB A binary tree is a tree data structure in which each node has at most two child nodes, usually distinguished as "left&…
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3608 Signal Detection Time Limit: 2 Seconds      Memory Limit: 65536 KB Parallelepiped Type Prism Faces 6 parallelograms Edges 12 Vertices 8 Dr. Gale is testing his laser system. He uses a…
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3605 Find the Marble Time Limit: 2 Seconds      Memory Limit: 65536 KB Alice and Bob are playing a game. This game is played with several identical pots and one marble. When the game starts…
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3604 Tunnel Network Time Limit: 2 Seconds      Memory Limit: 65536 KB Country Far-Far-Away is a big country with N cities. But it is now under a civil war. The rebel uses the ancient tunnel…
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3601 Unrequited Love Time Limit: 16 Seconds      Memory Limit: 131072 KB There are n single boys and m single girls. Each of them may love none, one or several of other people unrequitedly…
http://acm.zju.edu.cn/onlinejudge/showContestProblem.do?problemId=5493 The 12th Zhejiang Provincial Collegiate Programming Contest - A Ace of Aces Time Limit: 2 Seconds      Memory Limit: 65536 KB There is a mysterious organization called Time-Space…
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3609 Modular Inverse Time Limit: 2 Seconds      Memory Limit: 65536 KB The modular modular multiplicative inverse of an integer a modulo m is an integer x such that a-1≡x (mod m). This is e…
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3610 Yet Another Story of Rock-paper-scissors Time Limit: 2 Seconds      Memory Limit: 65536 KB Akihisa and Hideyoshi were lovers. They were sentenced to death by the FFF Inquisition. Ryou,…
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3603 Draw Something Cheat Time Limit: 2 Seconds      Memory Limit: 65536 KB Have you played Draw Something? It's currently one of the hottest social drawing games on Apple iOS and Android D…
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3600 Taxi Fare Time Limit: 2 Seconds      Memory Limit: 65536 KB Last September, Hangzhou raised the taxi fares. The original flag-down fare in Hangzhou was 10 yuan, plusing 2 yuan per kilo…
卖切糕的小女孩 http://www.cnblogs.com/wuyiqi/archive/2012/04/28/2474672.html #include <cstdio> #include <cstring> #include <algorithm> #define lson l, m, rt << 1 #define rson m+1, r, rt << 1 | 1 #define lc rt << 1 #define rc r…
题意:从左往右跳箱子,每个箱子有金币数量,只能从矮处向高处跳,求最大可获得金币数,数据规模1<=n<=1e5. 显然是一个dp的问题,不难得出dp[ i ] = max(dp[j] )+val [ i ] ,j < i ; 第一眼会想到o(n^2)的算法,显然会超时,这个时候就需要用线段树维护最大值,将复杂度降低到o(nlogn) 首先离散化处理,将高度从小到大排序,并使用unique函数去重,之后每个高度就可以映射为它的下标pos,然后用线段树维护每个下标对应的最优解bestans […
[it-ebooks]电子书列表   [2014]: Learning Objective-C by Developing iPhone Games || Leverage Xcode and Objective-C to develop iPhone games http://it-ebooks.info/book/3544/Learning Web App Development || Build Quickly with Proven JavaScript Techniques http:…
Awesome系列的JavaScript资源整理.awesome-javascript是sorrycc发起维护的 JS 资源列表,内容包括:包管理器.加载器.测试框架.运行器.QA.MVC框架和库.模板引擎.数据可视化.时间轴.编辑器等. 前端MVC框架与库 angular.js - 前端MVVM框架,支持双向绑定,实现MVC架构,增强Web应用 aurelia - A Javascript client framework for mobile, desktop and web. backbo…
问题来源 今天做项目的时候发现了一个问题,在使用text-indent属性对元素进行缩进是发现在360浏览器下发生了元素偏移,跟margin-left的效果一样,打开f12发现3607.1浏览采用的ie7.0的文档模式,果然在ie7里面测试是一样的结果 IE7下效果 其他浏览器下效果 之所以这样是因为ie6.7浏览器不支持display属性的inline-block值,你设置了也会忽视,而恰巧我的页面中的元素就使用了display:inline-block属性,但是在ie7看来就是inline…
转自:http://www.cnblogs.com/SeasonLee/archive/2010/04/24/1719444.html 一些往事 在正式进入Decorator话题之前,请允许我讲一个小故事. 在最近的项目开发过程中,一位同事在读我的代码的时候,提出质疑,为什么同样的验证代码要重复出现在服务接口中呢? 如某服务接口是游戏中的玩家想建造建筑: def build(user, build_name): if not is_user_valid(user): redirect("/aut…