abc164
A - Sheep and Wolves
题意
判断两个数的大小
题解
ac代码
|
|
B - Battle
题意
给定两个人的生命值和攻击力,两个人回合制battle,谁的生命值先小于等于0
判断两个数的大小
ac代码
|
|
给定两个人的生命值和攻击力,两个人回合制battle,谁的生命值先小于等于0
Count the number of n x n matrices A satisfying the following condition modulo m.
The input consists of several test cases and is terminated by end-of-file. Each test case contains two integers n and m.
给一个数n,找一个数x,满足 x+2x+4x+8x+… = n
等比数列求和,变成2^m
然后枚举,看哪个能整除
ac代码
|
|
给一数n,问是否可以构造一个数列
求圆周长
ac代码
|
|
给定假期的时间和每一项作业完成的时间,求这个假期能玩几天
ac代码
|
|
告诉每个员工的老板,询问每个老板有多少个员工
将一堆糖果分给两个女孩,其中一个要比另一个多,问有几种分法
可以看出规律
ac代码
|
|
输入a,b,c 构造字符串,使字符串的长度为a,任意b个字符有c个不同字符
问一个整数中是否含有数字7!
ac代码
|
|
找出不大于n的自然数中不能被3和5整除的数的和
模拟或者集成成公式O(1)
Now you get a number N, and a M-integers set, you should find out how many integers which are small than N, that they can divided exactly by any integers in the set. For example, N=12, and M-integer set is {2,3}, so there is another set {2,3,4,6,8,9,10}, all the integers of the set can be divided exactly by 2 or 3. As a result, you just output the number 7.
模拟
ac代码
|
|
贪心
shy有一颗树,树有n个结点。有k种不同颜色的染料给树染色。一个染色方案是合法的,当且仅当对于所有相同颜色的点对(x,y),x到y的路径上的所有点的颜色都要与x和y相同。请统计方案数。
给三个数a,b,c,交换ab的值,交换ac的值,输出
模拟
ac代码
|
|
有n件商品,每种商品有一价格,给一数m
给n个数和数字k,你可以对数列进行扩充k个数,使得扩充后的数列出现1~m的
数字至少一次,求m的最大值
用计数器对原始数列计数,如果不连续,则k递减,直到k耗光,最后还要判断