Polycarp likes to play with numbers. He takes some integer number xx, writes it down on the board, and then performs with it n−1n−1operations of the two kinds: divide the number xx by 33 (xx must be divisible by 33); multiply the number xx by 22. A…
Making Genome in Berland time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Berland scientists face a very important task - given the parts of short DNA fragments, restore the dinosaur DNA! Th…
Anna and Maria are in charge of the math club for junior students. When the club gathers together, the students behave badly. They've brought lots of shoe laces to the club and got tied with each other. Specifically, each string ties together two stu…
传送门 D. Divide by three, multiply by two •题意 给你一个数 x,有以下两种操作,x 可以任选其中一种操作得到数 y 1.如果x可以被3整除,y=x/3 2.y=x*2 y 再执行上述两种操作的一种得到数 z: 接着对 z 得到...... 这样依次执行了 n-1 次会得到 n 个数: 现在给你这 n 个数,让你按照上述规则给这 n 个数排序,使得其满足 a1=x , a2=y , a3=z , ........ •思路 对于任意一个数 p,能通过两类操作得…
B. Drazil and Tiles 题目连接: http://codeforces.com/contest/516/problem/B Description Drazil created a following problem about putting 1 × 2 tiles into an n × m grid: "There is a grid with some cells that are empty and some cells that are occupied. You s…
C. Mail Stamps Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/problemset/problem/29/C Description One day Bob got a letter in an envelope. Bob knows that when Berland's post officers send a letter directly from city «A» to city «B…