Codeforces Round #575 (Div. 3) 这个div3打的太差了,心态都崩了. B. Odd Sum Segments B 题我就想了很久,这个题目我是找的奇数的个数,因为奇数想分成x个奇数,那么这个x肯定是一个奇数, 偶数同理,如果一个偶数想分成y个奇数,那么这个y肯定是一个偶数. 所以数奇数的个数,如果奇数有x个,x是偶数,那么k一定是一个偶数,如果x是一个奇数,那么k肯定是一个奇数. 输出也比较简单,因为奇数要分成奇数个,所以可以前面每组都是含有一个奇数,最后肯定会有奇…
Beru-taxi 题目链接: http://codeforces.com/contest/706/problem/A Description Vasiliy lives at point (a, b) of the coordinate plane. He is hurrying up to work so he wants to get out of his house as soon as possible. New app suggested n available Beru-taxi…
A. Uncowed Forces Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/604/problem/A Description Kevin Sun has just finished competing in Codeforces Round #334! The round was 120 minutes long and featured five problems with maxi…
https://codeforces.com/contest/1136/problem/D 贪心 + 思维 题意 你面前有一个队列,加上你有n个人(n<=3e5),有m(m<=个交换法则,假如u在v相邻前面,那么u和v可以交换位置,问你是队列最后一个人的时候你最前可以换到前面哪里 题解 因为相邻才能换,所以最后一个换到前面一定是一步一步向前走,所以不存在还要向后走的情况 设最后一个为u,假设前面有一个能和u换位置的集合,那么需要将这些点尽量往后移动去接u 假设前面有一个不能和u换位置的集合S,…
题意:给出一个串,只包含 ( ? ) 三种符号,求出有多少个子串是完美匹配的. ( ) ? ) => ( ) ( ) 完美匹配( ( ) ? => ( ( ) )完美匹配? ? ? ? => ( ) ( ) => ( ( ) ) 算一种子串 思路:看代码. #include<bits/stdc++.h> using namespace std; #define int long long signed main(){ string str; cin>>str…
A. Wizards' Duel Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/591/problem/A Description Harry Potter and He-Who-Must-Not-Be-Named engaged in a fight to the death once again. This time they are located at opposite ends of…
A. Two Substrings Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/550/problem/A Description You are given string s. Your task is to determine if the given string s contains two non-overlapping substrings "AB" and "…
D. Searching Rectangles 题目连接: http://codeforces.com/contest/714/problem/D Description Filya just learned new geometry object - rectangle. He is given a field consisting of n × n unit cells. Rows are numbered from bottom to top with integer from 1 to…
B. Lovely Palindromes 题目连接: http://www.codeforces.com/contest/688/problem/B Description Pari has a friend who loves palindrome numbers. A palindrome number is a number that reads the same forward or backward. For example 12321, 100001 and 1 are palin…
A. Infinite Sequence 题目连接: http://www.codeforces.com/contest/675/problem/A Description Vasya likes everything infinite. Now he is studying the properties of a sequence s, such that its first element is equal to a (s1 = a), and the difference between…