Cashier (codeforces 1059A)】的更多相关文章

题目倒是不难注意第一个时间段可能不是从零开始的,所以注意第一个时间的开始节点与零之间可能存在休息的时间 还有这个题我打的时候一直谜之RE......发现原来bool函数忘记写return了.....以后一定主函数也写上,return 0;也写上 #include <bits/stdc++.h> using namespace std; struct node { int l,coss; }p[1000100]; bool cmp(node aa,node bb) { return aa.l&l…
B. Cinema Cashier 题目连接: http://www.codeforces.com/contest/10/problem/B Description All cinema halls in Berland are rectangles with K rows of K seats each, and K is an odd number. Rows and seats are numbered from 1 to K. For safety reasons people, who…
题目大意: n波人去k*k的电影院看电影. 要尽量往中间坐,往前坐. 直接枚举,贪心,能坐就坐,坐在离中心近期的地方. #include <cstdio> #include <iostream> #include <cstring> #include <algorithm> #define maxn 1000005 #define lowbit(x) (x&(-x)) using namespace std; struct BIT { int sum…
目录 Codeforces 1059 A.Cashier B.Forgery C.Sequence Transformation D.Nature Reserve(二分) E.Split the Tree(贪心 并查集/二分) Codeforces 1059 比赛链接 好失败啊.. D挺简单的,但是没做.E读错题了,以为链可以拐弯,不知这样怎么求每个点最远延伸距离(想了想好像不难不过也好像很麻烦就弃疗了).不然不就是个显然的贪心么.. Update:E读错题了,读成NOIP Day1T3了. A…
B. Save the problem! http://codeforces.com/contest/867/problem/B time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Attention: we lost all the test cases for this problem, so instead of solvi…
B. Shopping 题目连接: http://www.codeforces.com/contest/665/problem/B Description Ayush is a cashier at the shopping center. Recently his department has started a ''click and collect" service which allows users to shop online. The store contains k items.…
https://codeforces.com/contest/1241/problem/C You are an environmental activist at heart but the reality is harsh and you are just a cashier in a cinema. But you can still do something! You have n tickets to sell. The price of the i-th ticket is pi.…
链接: https://codeforces.com/contest/1241/problem/C 题意: You are an environmental activist at heart but the reality is harsh and you are just a cashier in a cinema. But you can still do something! You have n tickets to sell. The price of the i-th ticket…
上一次我们拿学校的URP做了个小小的demo.... 其实我们还可以把每个学生的证件照爬下来做成一个证件照校花校草评比 另外也可以写一个物理实验自动选课... 但是出于多种原因,,还是绕开这些敏感话题.. 今天,我们来扒一下cf的题面! PS:本代码不是我原创 1. 必要的分析 1.1 页面的获取 一般情况CF的每一个 contest 是这样的: 对应的URL是:http://codeforces.com/contest/xxx 还有一个Complete problemset页面,它是这样的:…
http://codeforces.com/contest/738/problem/D Galya is playing one-dimensional Sea Battle on a 1 × n grid. In this game a ships are placed on the grid. Each of the ships consists of bconsecutive cells. No cell can be part of two ships, however, the shi…