描述 http://poj.org/problem?id=1742 n种不同面额的硬币 ai ,每种各 mi 个,判断可以从这些数字值中选出若干使它们组成的面额恰好为 k 的 k 的个数. 原型: n种不同大小的数字 ai ,每种各 mi 个,判断是否可以从这些数字之中选出若干使它们的和恰好为 k . Coins Time Limit: 3000MS Memory Limit: 30000K Total Submissions: 33732 Accepted: 11453 Descrip…
链接:https://www.nowcoder.com/acm/contest/163/F 来源:牛客网 2018 ACM 国际大学生程序设计竞赛上海大都会赛重现赛 F Color it 时间限制:C/C++ 3秒,其他语言6秒 空间限制:C/C++ 262144K,其他语言524288K 64bit IO Format: %lld 题目描述 There is a matrix A that has N rows and M columns. Each grid (i,j)(0 ≤ i < N,…
Coins Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 10961 Accepted Submission(s): 4418 Problem Description Whuacmers use coins.They have coins of value A1,A2,A3...An Silverland dollar. One…
Description People in Silverland use coins.They have coins of value A1,A2,A3...An Silverland dollar.One day Tony opened his money-box and found there were some coins.He decided to buy a very nice watch in a nearby shop. He wanted to pay the exact pri…
Problem Description Whuacmers use coins.They have coins of value A1,A2,A3...An Silverland dollar. One day Hibix opened purse and found there were some coins. He decided to buy a very nice watch in a nearby shop. He wanted to pay the exact price(witho…
Problem Description Marsha and Bill own a collection of marbles. They want to split the collection among themselves so that both receive an equal share of the marbles. This would be easy if all the marbles had the same value, because then they could…
2018 ACM 国际大学生程序设计竞赛上海大都会赛重现赛 F Color it (扫描线) 链接:https://ac.nowcoder.com/acm/contest/163/F来源:牛客网 时间限制:C/C++ 3秒,其他语言6秒 空间限制:C/C++ 262144K,其他语言524288K 64bit IO Format: %lld 题目描述 There is a matrix A that has N rows and M columns. Each grid (i,j)(0 ≤ i…
Landlocked Time Limit: 5 Sec Memory Limit: 128 MB Submit: 288 Solved: 39 Description Canada is not a landlocked country: the country touches at least one ocean (in fact, it touches three). There are 46 countries (including Bolivia and Mongolia, for e…
Couple Trees Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://hihocoder.com/problemset/problem/1232 Description "Couple Trees" are two trees, a husband tree and a wife tree. They are named because they look like a couple leaning on each other.…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5514 题意:有m个石子围成一圈, 有n只青蛙从跳石子, 都从0号石子开始, 每只能越过xi个石子.问所有被至少踩过一次的石子的序号之和. 题解:根据裴蜀定理每个青蛙可以跳到的最小石子编号为 gcd(xi,m) = bi,所有小于 m 的 bi 的倍数都是可以到达的石头.显然所有 bi 都为 m 的因子,标记 m 中所有能到达的因子,进行容斥,比如因子2.3.6都可以到达,计算 2 和 3 的倍数的时…
Couple Trees Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://hihocoder.com/problemset/problem/1232 Description "Couple Trees" are two trees, a husband tree and a wife tree. They are named because they look like a couple leaning on each other.…
10411: F.Distribution Time Limit: 1 Sec Memory Limit: 128 MB Submit: 11 Solved: 8 [Submit][Status][Web Board] Description One day , Wang and Dong in the Dubai desert expedition, discovered an ancient castle. Fortunately, they found a map of the cas…