CodeForces 670C Cinema】的更多相关文章

C. Cinema time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Moscow is hosting a major international conference, which is attended by n scientists from different countries. Each of the scient…
简单题. 统计一下懂每种语言的人分别有几个,然后$O(n)$扫一遍电影就可以得到答案了. #pragma comment(linker, "/STACK:1024000000,1024000000") #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> #include<vector> #include<map> #inclu…
Moscow is hosting a major international conference, which is attended by n scientists from different countries. Each of the scientists knows exactly one language. For convenience, we enumerate all languages of the world with integers from 1 to 109. I…
[题目链接] http://codeforces.com/contest/670/problem/C [算法] 离散化 [代码] #include<bits/stdc++.h> using namespace std; #define MAXN 200010 ,nx = -,len,i,rkb,rkc; ],tmp[MAXN<<]; template <typename T> inline void read(T &x) { ; x = ; char c = g…
题目链接:http://codeforces.com/problemset/problem/349/A 题目意思:题目不难理解,从一开始什么钱都没有的情况下,要向每一个人售票,每张票价格是25卢布,这些人只可能拥有100,50,25的其中一张卢布.问:售票员是否能在可以找赎的情况下,向每一个人都售到票. 此题被贴上贪心的标签,但我觉得更像模拟题.用了比较笨的方法来解决,但是毕竟是自己编的,还是比较有感觉.要特别注意,收了别人的钱,相应的面额数量要作相应的改动.例如第一个样例的25 25 50 5…
这题做的我好苦啊,编码调试整整搞了一个多小时,而且调到天昏地暗才调出来.. 回归正题,这题是一道本人做过的比较烦,比较无聊的题之一.题意是一个人,在m个影星里有k个喜欢的影星,然后给出n场电影,每场电影给出演出的人的编号,0表示不确定,根据这些人的编号判断是否一定是最喜欢的电影(喜欢的影星最多的电影),或者一定不会是最喜欢的电影,或者是不确定. 做法是算出每场电影最少有多少个喜欢的影星和最多有多少个喜欢的影星,并且得出在所有电影中最少有多少个喜欢的影星和最多有多少个喜欢的影星. 如果分别用MIN…
离散化+排序 离散化统计人数就好,本来不难,但是测试点太丧心病狂了...CF还是大哥啊 #include <bits/stdc++.h> #define INF 0x3f3f3f3f using namespace std; typedef long long ll; inline int lowbit(int x){ return x & (-x); } inline int read(){ int X = 0, w = 0; char ch = 0; while(!isdigit(…
codeforces 670A. Holidays 题目链接: http://codeforces.com/contest/670/problem/A 题意: A. Holidays On the planet Mars a year lasts exactly n days (there are no leap years on Mars). But Martians have the same weeks as earthlings — 5 work days and then 2 days…
http://codeforces.com/contest/738/problem/C Vasya is currently at a car rental service, and he wants to reach cinema. The film he has bought a ticket for starts in t minutes. There is a straight road of length s from the service to the cinema. Let's…
C. Cinema 题目连接: http://www.codeforces.com/contest/670/problem/C Description Moscow is hosting a major international conference, which is attended by n scientists from different countries. Each of the scientists knows exactly one language. For conveni…