[NOIP 1996 提高组] 砝码称重


Submit solution

Points: 100
Time limit: 1.0s
Memory limit: 256M

Author:
Problem type
Allowed languages
C, C++

P2347 [NOIP 1996 提高组] 砝码称重

题目描述

设有 \(1\mathrm{g}\)、\(2\mathrm{g}\)、\(3\mathrm{g}\)、\(5\mathrm{g}\)、\(10\mathrm{g}\)、\(20\mathrm{g}\) 的砝码各若干枚(其总重 \( \le 1000\)),可以表示成多少种重量?

输入格式

输入方式:\(a_1 , a_2 ,a_3 , a_4 , a_5 ,a_6\)

(表示 \(1\mathrm{g}\) 砝码有 \(a_1\) 个,\(2\mathrm{g}\) 砝码有 \(a_2\) 个,\(\dots\),\(20\mathrm{g}\) 砝码有 \(a_6\) 个)

输出格式

输出方式:Total=N

(\(N\) 表示用这些砝码能称出的不同重量的个数,但不包括一个砝码也不用的情况)

输入输出样例 #1

输入 #1
1 1 0 0 0 0
输出 #1
Total=3

说明/提示

【题目来源】

NOIP 1996 提高组第四题


Comments

There are no comments at the moment.