Gym 100531J Joy of Flight (几何)】的更多相关文章

题意:你从开始坐标到末尾坐标,要经过 k 秒,然后给你每秒的风向,和飞机的最大速度,问能不能从开始到末尾. 析:首先这个风向是不确定的,所以我们先排除风向的影响,然后算出,静风是的最小速度,如果这都大于最大速度,肯定是不可能,如果可能, 再计算出每秒走的单位长度,然后再模拟整个过程. 代码如下: #pragma comment(linker, "/STACK:1024000000,1024000000") #include <cstdio> #include <str…
Joy of Flight 题目连接: http://codeforces.com/gym/100531/attachments Description Jacob likes to play with his radio-controlled aircraft. The weather today is pretty windy and Jacob has to plan flight carefully. He has a weather forecast - the speed and d…
E. Polish Fortress time limit per test 2.0 s memory limit per test 256 MB input standard input output standard output The Malbork castle is the largest brick castle in the world. It was built in 1274 in honor to Holy Mary, and is located near the riv…
Note: My new book Atomic Habits is available to preorder now. Click here to learn more. The Evolution of Anxiety: Why We Worry and What to Do About It by James Clear Read this on JamesClear.com Let’s pretend for a moment that you are a giraffe. You l…
B. A Lot of Joy Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100187/problem/A Description Two boys Gena and Petya wrote on two strips of paper the same string s that consisted of lowercase Latin letters. Then each boy took o…
Flight Boarding Optimization 题目连接: http://codeforces.com/gym/100269/attachments Description Peter is an executive boarding manager in Byteland airport. His job is to optimize the boarding process. The planes in Byteland have s rows, numbered from 1 t…
BUPT2017 wintertraining(15) #4F Gym - 101124A 题意 给定画框宽度,画的四边和一个对角线长度,求画框外沿周长. 题解 过顶点做画框的垂线,每个角都得到两个全等直角三角形.然后用余弦公式求得四个角,再在直角三角形中计算出比内沿多出来的长度,加上画的四边长度即可. 代码 #include <cstdio> #include <cstring> #include <algorithm> #include <cmath>…
原题链接 题意: 现在有n个人,s个位置和你可以划分长k个区域你可以把s个位置划分成k个区域,这样每个人坐下你的代价是该区域内,在你之前比你小的人的数量问你怎么划分这s个位置(当然,每个区域必须是连续的),才能使得总代价最小,输出代价. 分析:dp[i][j]表示第i个位置是第j个区域的结尾,dp[i][j]→dp[t][j+1]暴力转移.但是需要预处理每个范围里的代价值,需要树状数组维护. #include<bits/stdc++.h> using namespace std; ; ]; i…
http://codeforces.com/gym/101147/problem/I I. On the way to the park time limit per test 5 seconds memory limit per test 64 megabytes input walk.in output standard output Engineers around the world share a lot of common characteristics. For example,…
题意:给一个字符串,将每个字符分开放进两个口袋,每次从两个口袋分别拿出一个字符,如果相同则开心,问开心的次数期望是多少. 分析:数学期望题,然而这是我最不拿手的...最后答案是每个字符在字符串出现的次数/字符串长度的和. #include <cstdio> #include <cmath> #include <cstring> #include <ctime> #include <iostream> #include <algorithm&…