codeforces 235 div2 B. Sereja and Contests】的更多相关文章

Sereja is a coder and he likes to take part in Codesorfes rounds. However, Uzhland doesn't have good internet connection, so Sereja sometimes skips rounds. Codesorfes has rounds of two types: Div1 (for advanced coders) and Div2 (for beginner coders).…
题目:http://codeforces.com/contest/401/problem/C 题意:n个0,m个1,求没有00或111的情况. 这么简单的题..... 做题的时候脑残了...,今天,贴一下ac的代码,警示一下自己 #include <iostream> #include <cstdio> #include <cstring> #include <cstdlib> #include <algorithm> using namespa…
Vanya loves playing. He even has a special set of cards to play with. Each card has a single integer. The number on the card can be positive, negative and can even be equal to zero. The only limit is, the number on each card doesn't exceed x in the a…
[codeforces 235]A. LCM Challenge 试题描述 Some days ago, I learned the concept of LCM (least common multiple). I've played with it for several times and I want to make a big number with it. But I also don't want to use many numbers, so I'll choose three…
// Codeforces #180 div2 C Parity Game // // 这个问题的意思被摄物体没有解释 // // 这个主题是如此的狠一点(对我来说,),不多说了这 // // 解决问题的思路: // // 第一个假设a字符串和b字符串相等,说直接YES // 假设b串全是0,直接YES // 注意到a串有一个性质,1的个数不会超过本身的加1. // a有个1的上限设为x,b有个1的个数设为y,则假设x < y // 那么直接NO. // // 如今普通情况下.就是模拟啦,找到a…
Problem   Codeforces #541 (Div2) - E. String Multiplication Time Limit: 2000 mSec Problem Description Input Output Print exactly one integer — the beauty of the product of the strings. Sample Input 3aba Sample Output 3 题解:这个题的思维难度其实不大,需要维护什么东西很容易想到,或…
Problem   Codeforces #541 (Div2) - F. Asya And Kittens Time Limit: 2000 mSec Problem Description Input The first line contains a single integer nn (2≤n≤150000) — the number of kittens. Each of the following n−1lines contains integers xi and yi (1≤xi,…
Problem   Codeforces #541 (Div2) - D. Gourmet choice Time Limit: 2000 mSec Problem Description Input Output The first line of output should contain "Yes", if it's possible to do a correct evaluation for all the dishes, or "No" otherwis…
Problem   Codeforces #548 (Div2) - D.Steps to One Time Limit: 2000 mSec Problem Description Input The first and only line contains a single integer mm (1≤m≤100000,1≤m≤100000). Output Print a single integer — the expected length of the array aa writte…
# [Codeforces #312 div2 A]Lala Land and Apple Trees 首先,此题的大意是在一条坐标轴上,有\(n\)个点,每个点的权值为\(a_{i}\),第一次从原点开始走,方向自选(<- or ->),在过程中,若遇到一个权值>0的点,则将此权值计入答案,并归零.当次.此方向上的所有点均为0后,输出此时的答案. 然后,进行分析: 我们很容易想到这是一个贪心,我们将正的和负的分别存入两个数组,最初的方向为: \(zhengsum > fusum…