Vasya has got a robot which is situated on an infinite Cartesian plane, initially in the cell (0,0). Robot can perform the following four kinds of operations: U — move from (x,y) to (x,y+1); D — move
581A. Vasya the Hipster 有一天,时髦精瓦夏决定数一数他有多少袜子。原来,他有 a 双红袜子和 b 双蓝袜子。按照最新的时尚,潮人应该穿不同颜色的袜子:左脚一只红袜子,右脚一只蓝袜子。每天早上,瓦夏都会穿上新袜子,然后在睡觉前扔掉,因为他不想洗袜子。 瓦夏想知道,他最多有多少天可以穿得很时髦,穿不同的袜子,之后,他又有多少天可以穿同样的袜子,直到袜子用完,或者用现有的袜子
原题: E. Vasya’s Function time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Vasya is studying number theory. He has denoted a function f(a, b
原题: C. Vasya and Robot time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Vasya has got a robot which is situated on an infinite Cartesian plane,
题目链接: http://codeforces.com/contest/1082/problem/A A. Vasya and Book time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Vasya is r
描述 Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed! Vasya knows that the matrix consists of n rows and m col