(原创)E - Straight Shot Gym - 101652R】的更多相关文章

解题思路:这道题的题意就是给你n,总距离X,速度v:以及n组数据:人行道的左端点和右端点,以及人行道的速度(竖直方向),如果从(0,0)到(X,0)的时间小于2X/v,则输出其时间,否则输出”Too hard“: 需要一定的推导和简单物理知识 代码如下: #include<iostream> #include<stdio.h> #include<cmath> using namespace std; int n , X ; double v; int l , r ,x…
A. Odd Palindrome 所有回文子串长度都是奇数等价于不存在长度为$2$的偶回文子串,即相邻两个字符都不同. #include<cstdio> #include<cstring> char a[1111111];int n,i; int main(){ scanf("%s",a+1); n=strlen(a+1); for(i=1;i<n;i++)if(a[i]==a[i+1])return puts("Or not."),…
A - Odd Palindrome 水. #include <bits/stdc++.h> using namespace std; #define N 110 char s[N]; inline bool work() { int len = strlen(s); ; i < len; ++i) { ]) return false; } return true; } int main() { while (scanf("%s", s) != EOF) { puts…
题意:给你n个高度,再给你1~n每种高度的数量,已知高度连续的3~5个能消去,问你所给的情况能否全部消去:例:n = 4,给出序列1 2 2 1表示高度1的1个,高度2的2个,高度3的2个,高度4的1个.那么我打出1 1 1(高度1 2 3),1 1 1(高度2 3 4)刚好打完. 思路:对于差分数组我们知道,如果我们对区间L,R加1,那么d[L] += 1, d[R + 1] -= 1,我们可以想象这个序列是由0序列不断进行区间+1操作得到.我们打出差分数组,从左到右遍历,如果遇到正数,那么我…
Problem C. Painting CottagesTime Limit: 2 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100342/attachments Description The new cottage settlement is organized near the capital of Flatland. The construction company that is building the settl…
Space Golf 题目连接: http://codeforces.com/gym/100803/attachments Description You surely have never heard of this new planet surface exploration scheme, as it is being carried out in a project with utmost secrecy. The scheme is expected to cut costs of c…
Shopping 题目连接: http://codeforces.com/gym/100803/attachments Description Your friend will enjoy shopping. She will walk through a mall along a straight street, where N individual shops (numbered from 1 to N) are aligned at regular intervals. Each shop…
F. Doomsday Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100187/problem/F Description Doomsday comes in t units of time. In anticipation of such a significant event n people prepared m vaults in which, as they think, it will…
Problem C. Painting CottagesTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100342/attachments Description The new cottage settlement is organized near the capital of Flatland. The construction company that is building the sett…
Problem F. Door LockTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100500/attachments Description It was a beautiful night at Yekaterinburg, the sky was crystal clear with no clouds, and the view of the moon and the stars was…