Codeforces 15B Laser】的更多相关文章

题目链接:点击打开链接 #include<stdio.h> #include<iostream> #include<string.h> #include<set> #include<vector> #include<map> #include<math.h> #include<queue> #include<string> #include<stdlib.h> #include<a…
[题目链接] https://codeforces.com/contest/957/problem/C [算法] 二分 注意精度问题 时间复杂度 :O(NlogN) [代码] #include<bits/stdc++.h> using namespace std; ; ; int n,m; int a[MAXN]; double ans; bool ok; template <typename T> inline void read(T &x) { ; x = ; char…
题意: 说的是一个电子云的三种状态,但是这不重要. 简单来说,就是在一个升序的序列中找三个数x,y,z,x和z的值之差不超过u,然后使得(z – y) / (z – x)最大. 思路: 使得(z – y)/(z – x)最大,那么y与x要尽量接近,并且z – x尽量大,一个比较显然的例子是8/9大于7/8. 对于每一个x,紧邻它的下一个数就是y,然后二分查找最大的小于等于x+u的数字,然后取(z – y) / (z – x)的最大值. 我的失误在于考虑到了最后可能x与z相等,但是没有考虑到y与z…
题目链接: http://codeforces.com/contest/724 A. Checking the Calendar time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You are given names of two days of the week. Please, determine whether it is…
[codeforces 241]C. Mirror Box 试题描述 Mirror Box is a name of a popular game in the Iranian National Amusement Park (INAP). There is a wooden box, 105 cm long and 100cm high in this game. Some parts of the box's ceiling and floor are covered by mirrors.…
K. Perpetuum Mobile Time Limit: 2 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100187/problem/K Description The world famous scientist Innokentiy almost finished the creation of perpetuum mobile. Its main part is the energy generator which…
上一次我们拿学校的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…
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…
http://codeforces.com/contest/738/problem/A Polycarp has interviewed Oleg and has written the interview down without punctuation marks and spaces to save time. Thus, the interview is now a string s consisting of n lowercase English letters. There is…