Logo
(追記) (追記ここまで)

19362번 - Coins 2 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB68322443.636%

문제

In ICPCCamp, people usually use coins of values 1,ドル 2, 3, \dots, n$.

Bobo was very poor, he had only $a_1, a_2, a_3, \dots, a_n$ coins of values 1,ドル 2, 3, \dots, n,ドル respectively. He bought an item of an unknown value without making change.

The unknown item was of non-negative integer value. Find the number of possible values it may have had.

입력

The input contains zero or more test cases, and is terminated by end-of-file. For each test case:

The first line contains one integer $n$ (1ドル \leq n \leq 15$).

The second line contains $n$ integers $a_1, a_2, \dots, a_n$ (0ドル \leq a_i \leq 10^9$).

It is guaranteed that the number of test cases does not exceed 100ドル,ドル and there is at most one test case where $n > 10$.

출력

For each test case, output an integer which denotes the number of possibilities.

제한

예제 입력 1

3
0 1 2
3
0 2 3

예제 출력 1

6
12

힌트

출처

Camp > Petrozavodsk Programming Camp > Winter 2017 > Day 2: Xiaoxu Guo Contest D번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /