问题描述作为一个神秘的电脑高手,Farmer John 用二进制数字标识他的奶牛.然而,他有点迷信,标识奶牛用的二进制数字,必须只含有 K 位“1”(1 <= K <= 10). 当然,每个标识数字的首位必须为“1”.FJ 按递增的顺序,安排标识数字,开始是最小可行的标识数字(由“1”组成的一个 K 位数).不幸的是,他没有记录下标识数字.请帮他计算,第 N 个标识数字(1 <= N <= 10^7). 输入第 1 行:空格隔开的两个整数,N 和 K. 输出如题,第 N 个标识数字…
链接: http://poj.org/problem?id=3414 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=22009#problem/J Pots Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 8253 Accepted: 3499 Special Judge Description You are given two pots, havin…
E. Frog Fights 题目连接: http://www.codeforces.com/contest/625/problem/E Description stap Bender recently visited frog farm and was inspired to create his own frog game. Number of frogs are places on a cyclic gameboard, divided into m cells. Cells are nu…