<Codeforce>1082A. Vasya and Book】的更多相关文章

题目描述: Vasya is reading a e-book. The file of the book consists of nn pages, numbered from 11 to nn. The screen is currently displaying the contents of page xx, and Vasya wants to read the page yy. There are two buttons on the book which allow Vasya t…
http://codeforces.com/contest/1073/problem/C   题意:给你长度为n的字符串,每个字符为L, R, U, D.给你终点位置(x, y).你每次出发的起点为(0, 0).你可以改动每次的移动方向到达(x,y)点.求改动的MaxID-MinID+1是多少. 思路: 先分别求x轴,y轴上的前缀和,偏于之后判断区间是否满足条件.详细见代码. 固定左端点,二分枚举右端点.判断左右端点的区间是否能够达成目标(区间长度是否大于未完成量,奇偶性是否相同) 注意点: s…
Time limit: 1.0 second Memory limit: 64 MB Vasya is the beginning mathematician. He decided to make an important contribution to the science and to become famous all over the world. But how can he do that if the most interesting facts such as Pythago…
H - Vasya and Basketball Time Limit:2000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Submit Status Practice CodeForces 493C Description Vasya follows a basketball game and marks the distances from which each team makes a throw. He k…
A. Vasya and Socks time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vasya has n pairs of socks. In the morning of each day Vasya has to put on a pair of socks before he goes to school. When…
Bahosain is walking in a street of N blocks. Each block is either empty or has one lamp. If there is a lamp in a block, it will light it’s block and the direct adjacent blocks. For example, if there is a lamp at block 3, it will light the blocks 2, 3…
题目传送门 /* 题意:1~1e9的数字里,各个位数数字相加和为s的个数 递推DP:dp[i][j] 表示i位数字,当前数字和为j的个数 状态转移方程:dp[i][j] += dp[i-1][j-k],为了不出现负数 改为:dp[i][j+k] += dp[i-1][j] */ #include <cstdio> #include <cstring> #include <cmath> #include <algorithm> #include <str…
e,还是写一下这次的codeforce吧...庆祝这个月的开始,看自己有能,b到什么样! cf的第二题,脑抽的交了错两次后过了pretest然后system的挂了..脑子里还有自己要挂的感觉,果然回头一小改就过了! 只能呵呵...C题还是看了下,又没写,也许写不出吧...的确时候还是看了别人的额,自己写只到第8组WA! 希望下次少,一点! 哎,等我不,b了这个世界也许都不同了!…
D. Vasya and Chess time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Vasya decided to learn to play chess. Classic chess doesn't seem interesting to him, so he plays his own sort of chess. T…
C. Vasya and Basketball time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Vasya follows a basketball game and marks the distances from which each team makes a throw. He knows that each succe…