아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

Sum25

면접 대비

시간 제한1초메모리 제한1024 MB

요약
0을 10으로 치는 일곱 개의 숫자가 주어질 때, 합이 정확히 25가 되는 부분집합의 개수를 센다.
난이도

보통10점 중 4점

유형
완전 탐색, 비트 연산, 배열, 조합론
정답자
아직 제출이 없습니다

문제

Write a program that inputs 7 digits (0 ≤ each digit ≤ 9) and counts the number of ways one can extract a set of digits to sum to 25. The digit '0' means 10, not 0.

This input:

5 0 1 5 4 3 7

yields five different sums to 25:

5 0       3 7
5   1 5 4 3 7
5 0 1 5 4
  0 1   4 3 7
  0   5   3 7

입력

A single line with seven single digit integers.

출력

A single line that tells the number of subsets that sum to 25.

예제1

  1. 예제 1

    입력
    5 0 1 5 4 3 7
    
    예상 출력
    5