Description Santa Claus has Robot which lives on the infinite grid and can move along its lines. He can also, having a sequence of m points p1, p2, ..., pm with integer coordinates, do the following: denote its initial location by p0. First, the robo…
Description Santa Claus decided to disassemble his keyboard to clean it. After he returned all the keys back, he suddenly realized that some pairs of keys took each other's place! That is, Santa suspects that each key is either on its place, or on th…
Description Santa Claus is the first who came to the Christmas Olympiad, and he is going to be the first to take his place at a desk! In the classroom there are n lanes of m desks each, and there are two working places at each of the desks. The lanes…
D. Santa Claus and a Palindrome time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Santa Claus likes palindromes very much. There was his birthday recently. k of his friends came to him to co…
E. Santa Claus and Tangerines time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Santa Claus has n tangerines, and the i-th of them consists of exactly ai slices. Santa Claus came to a school…
A. Santa Claus and a Place in a Class 模拟题.(0:12) 题意:n列桌子,每列m张桌子,每张桌子一分为2,具体格式看题面描述.给出n,m及k.求编号为k的桌子在第几行第几列是左还是右. 思路:由图知k为奇数在左边.每列有2*m个数,k/(2*m)然后就可以知道在第几列.然后数据小遍历找到第几行. int main() { int n,m,k; while(~scanf("%d%d%d",&n,&m,&k)) { char…
E. Subordinates time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output There are n workers in a company, each of them has a unique id from 1 to n. Exaclty one of them is a chief, his id is s. Each…
D. Sea Battle time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Galya is playing one-dimensional Sea Battle on a 1 × n grid. In this game a ships are placed on the grid. Each of the ships con…