<marquee width="600"></marquee>
<marquee width="600"></marquee>
<marquee width="600"></marquee>
The Balance
Time Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 2461Accepted Submission(s): 977
Problem Description
Now you are asked to measure a dose of medicine with a balance and a number of weights. Certainly it is not always achievable. So you should find out the qualities which cannot be measured from the range [1,S].
S is the total quality of all the weights.
Input
The input consists of multiple test cases, and each case begins with a single positive integer N (1<=N<=100) on a line by itself indicating the number of weights you have. Followed by N integers Ai (1<=i<=N),
indicating the quality of each weight where 1<=Ai<=100.
Output
For each input set, you should first print a line specifying the number of qualities which cannot be measured. Then print another line which consists all the irrealizable qualities if the number is not zero.
Sample Input
Sample Output
Source
又是一道关于母函数的题目。
之前没有什么思路,看了白白屋写的代码,发现还是挺好理解的
然后自己理解了之后就动手敲了下。
先开始莫名其妙的WA了,后来发现是前面初始化的时候变量没搞对
代码:
分享到:
相关推荐
杭电acm解题报告 详细解析2000-2099 适合acm初学者
// DATE : 03/21/2007 // VERVISON : 2.1 // ---------------------------------------------------------------------------- // DESCRIPTION : divide input clock by 16 // ------------------------------------...
收集的部分HDOJ杭电ACM题的代码 大牛勿下 全是基础供初级acmer使用
2019 Multi-University Training Contest 4(2019hdu多校第六场数据与标程)
有2019 Multi-University Training Contest 9,hdu多校第9场的题解,数据标程,有需要的可以下载哦
自己积累的部分杭电oj的(hdu)解题代码。。大家有空来看看。 基本上是自己写的哈。有错误之处请指教、
ACM HDU 2000->2099 解题报告 ACM HDU 2000->2099 解题报告 ACM HDU 2000->2099 解题报告
2019 Multi-University Training Contest 4(2019hdu多校第五场数据与标程),欢迎大家下载
hdu-acm源代码(上百题)hdu-acm源代码、hdu-acm源代码hdu-acm源代码
杭电oj4405,一道简单的概率dp题目
HDU的1250,主要是利用高精度加法,但是代码有点繁琐,效率不是很高
flutter_web_browser 一个flutter插件,可使用和打开网页。 此插件正在开发中,API可能会更改。入门安装从pub安装库: dependencies: flutter_web_browser: "^0.14.0"导入库import 'package:flutter_web_browser/...
2-sat---hdu3062,代码详尽,清晰,格式规范,亲测无误。
华为HLR相关资料,介绍了HLR中的HDU数据库单元原理
ACM ICPC HDOJ1000
有2019 Multi-University Training Contest 4,hdu多校第四场的题解,数据标程,有需要的可以下载哦
hdu-winter-2020 存放2020寒假hdu相关的训练,problems下存放集训的专题,contests下存放寒假比赛,包括七场PTA天梯训练赛 luogu 存放洛谷相关练习,problems下存放平时刷题,contests存放月赛题目 nowcoder 存放...
The least common multiple (LCM) of a set of positive integers is the smallest positive integer which is divisible by all the numbers in the set. For example, the LCM of 5, 7 and 15 is 105. Input Input...
HDU 1010-2500解题报告,ACMer可以借鉴一下
hdu2000-2014ac代码,虽然只有几道,但都是简单的