
数学
文章平均质量分 68
czdb
这个作者很懒,什么都没留下…
展开
-
XTU1254 Blance 如何实现称出1∼n 克的物品,请问最少需要几颗砝码?
题目描述小明有一架天平,小明想称出1∼n 克的物品,请问最少需要几颗砝码? 比如小明想称出1∼4 克的物品,需要2颗砝码,为1和3克。 balance输入第一行是一个整数T(1≤T≤10000) ,表示样例的个数。 以后每行一个样例,为一个整数 (1≤n≤10 9 )。输出每行输出一个样例的结果。样例输入3 1 4原创 2017-05-15 22:19:24 · 1087 阅读 · 0 评论 -
广工校赛H哲哲的疑惑(组合数学)
题目链接:https://www.nowcoder.com/acm/contest/90/H 思路:这题的关键就是要理解C(k,m)的实际意义:从没有用到的颜色中挑出m个颜色,也就是一个颜色集合,按照题目的描述,是先选出一中染色方案再选出一种颜色集合,也就是说这两者之间只用满足一种关系就是染色方案中的颜色没有颜色属于这个颜色集合,那么我们就可以先选择颜色集合,然后确定染色方案,就是C(n,m) ...原创 2018-03-25 14:08:28 · 456 阅读 · 0 评论 -
Ilya And The Tree(dfs,数学)
C. Ilya And The Treetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputIlya is very fond of graphs, especiall原创 2017-08-30 13:29:16 · 211 阅读 · 0 评论 -
Password UVA - 1262(组合数)
题目链接:点击打开链接题目思路:先找出每一列相同的个数,然后根据排列组合原理去逐渐确定范围。#include#include#include#include#include#include#define LL long long#define INF 0x3f3f3f3fusing namespace std;const int maxn = 1e5;int cnt[1原创 2017-08-27 19:23:17 · 238 阅读 · 0 评论 -
Snake Rana ——(暴力+容斥+计数)
Old Macdonald wants to build a new hen house for his hens. He buys a new rectangular area of size N by M. The night before he builds the hen house, snake Rana devises an evil plan to plant bombs in原创 2017-08-26 11:16:36 · 328 阅读 · 0 评论 -
Irrelevant Elements UVA - 1635(组合数,唯一分解定理)
题目链接:点击打开链接题目思路:对于这道题,我们容易知道各个参数对应着杨辉三角的系数,所以问题就是求某一层杨辉三角的系数是否能整除m,也就是c(n,k),那么如何去判断呢,如果直接算出组合数,虽然是可以但是需要高精度,十分麻烦,所以我们需要一些技巧去求是否为m的倍数,根据唯一分解定理,我们知道如果一个数的质因子的指数个数大于等于另一个数的所有质因子指数个数,那么就是可以的,所以这道题我们可原创 2017-08-24 23:36:44 · 294 阅读 · 0 评论 -
atcoder-Coloring Dominoes(组合数学)
Problem StatementWe have a board with a 2×N grid. Snuke covered the board with N dominoes without overlaps. Here, a domino can cover a 1×2 or 2×1 square.Then, Snuke decided to paint these domino原创 2017-08-21 00:08:45 · 544 阅读 · 0 评论 -
Friend-Graph(数学,思维)
Problem DescriptionIt is well known that small groups are not conducive of the development of a team. Therefore, there shouldn’t be any small groups in a good team.In a team with n members,if ther原创 2017-08-19 21:21:31 · 295 阅读 · 0 评论 -
小C的倍数问题(余数定理)
Problem Description根据小学数学的知识,我们知道一个正整数x是3的倍数的条件是x每一位加起来的和是3的倍数。反之,如果一个数每一位加起来是3的倍数,则这个数肯定是3的倍数。现在给定进制P,求有多少个B满足P进制下,一个正整数是B的倍数的充分必要条件是每一位加起来的和是B的倍数。Input第一行一个正整数T表示数据组数(1Output对于每组数据原创 2017-08-12 22:00:16 · 1119 阅读 · 0 评论 -
csu:1967-Election(组合数学)
DescriptionAfter all the fundraising, campaigning and debating, the election day has finally arrived. Only two candidates remain on the ballot and you work as an aide to one of them.Reports from t原创 2017-07-24 13:27:52 · 239 阅读 · 0 评论 -
xtu 1268 Strange Optimization 湘潭邀请赛I
Strange OptimizationAccepted : 67 Submit : 289Time Limit : 1000 MS Memory Limit : 65536 KB Strange OptimizationBobo is facing a strange opti原创 2017-05-16 17:54:32 · 690 阅读 · 0 评论 -
Border Codeforces Round #499 (Div. 2) (数论)
E. Border time limit per test 1 second memory limit per test 256 megabytes input standard input output standard outputAstronaut Natasha arrived on Mars. She knows that the Martians are very ...原创 2018-07-27 15:06:36 · 468 阅读 · 0 评论