Codeforces 420 B. Online Meeting】的更多相关文章

B. Online Meeting time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Nearly each project of the F company has a whole team of developers working on it. They often are in different rooms of the…
[题目链接]:http://codeforces.com/contest/782/problem/B [题意] 每个人都有一个速度,只能往上走或往下走; 然后让你找一个地方,所有人都能够在t时间内到达; 让t最小. [题解] 很明显的二分了; 二分时间t; 对于某个时间t,这个人都有一个能够到达的唯一区间 [x[i]-v*t..x[i]+v*t] 如果所有人的区间都有交集. 那么就能在那些交集里面随便选一个点了; 区间的交集可以用 最大的左端点小于等于最小的右端点这个依据来判断是否存在 想让答案…
http://codeforces.com/contest/782/problem/B 题意:有n个人,每个人有一个位置和速度,现在要让这n个人都走到同一个位置,问最少需要的时间是多少. 思路:看上去很像二分搜索啊!枚举距离,判断是否有更少的时间,然后发现时间不随着距离单调增减,想起前两天被三分虐了一道题,那就是三分吧. 三分枚举距离,然后判断是否有更少的时间就可以了.比赛时候用了max函数还有精度开太大,超时了,索性直接循环100次. #include <bits/stdc++.h> usi…
题目链接:Codeforces Round #433 (Div. 2) codeforces 854 A. Fraction[水] 题意:已知分子与分母的和,求分子小于分母的 最大的最简分数. #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> using namespace std; int gcd(int a,int b){return b?gcd(b…
The Meeting Place Cannot Be Changed Problem Description The main road in Bytecity is a straight line from south to north. Conveniently, there are coordinates measured in meters from the southernmost building in north direction. At some points on the…
A. Meeting of Old Friends time limit per test:1 second memory limit per test:256 megabytes input:standard input output:standard output Today an outstanding event is going to happen in the forest — hedgehog Filya will come to his old fried Sonya! Sony…
A. The New Year: Meeting Friends 题目连接: http://codeforces.com/contest/723/problem/A Description There are three friend living on the straight line Ox in Lineland. The first friend lives at the point x1, the second friend lives at the point x2, and the…
A. Meeting of Old Friends 题目连接: http://codeforces.com/contest/714/problem/A Description Today an outstanding event is going to happen in the forest - hedgehog Filya will come to his old fried Sonya! Sonya is an owl and she sleeps during the day and s…
地址:http://codeforces.com/contest/782/problem/B 题目: B. The Meeting Place Cannot Be Changed time limit per test 5 seconds memory limit per test 256 megabytes input standard input output standard output The main road in Bytecity is a straight line from…
题目链接:http://codeforces.com/problemset/problem/420/B 题目意思:给出一段连续的消息记录:记录着哪些人上线或者下线.问通过给出的序列,找出可能为leader的人的编号.符合leader的条件是:至少有一个人上线的时候,绝对要有该人(leader)的存在. 整个五一都把时间耗在这题里了......首先太感谢jhf大神,竟然可以这么有耐心的跟我这个陌生人讨论题目.但是,限于本人理解能力有点问题,在参考他写的代码里,还是有一些部分不太理解. 以下结合我的…