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

7106번 - Wonderful Fours 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB86584173.214%

문제

Let us name a set of five decimal digits K5. (Note that numbers may be repeated within this set).

We can say that a natural five-digit number is properly formed from K5 if it is formed by sequentially writing all the digits of K5 in a row in any order (taking each of them exactly once) and this number does not start with zero.

In this way, for example, if K5 contains four digits 1,1,7,0 and 4, then numbers 17140 and 47011 are properly formed from K5, while 17740 is not.

Let us call four natural five-digit numbers s1,s2,s3,s4 a K5 wonderful four, if the following properties are true for them :

  1. s1 is properly formed from K5;
  2. s2 is properly formed from K5;
  3. s3 is properly formed from K5;
  4. s4 is properly formed from K5;
  5. s1, s2, s3 un s4 are all different numbers;
  6. s1+ s2 + s3 = s4

The task is to compute how many different K5 wonderful fours can be formed from the five digits contained by the set K5 given in the input data. (Change of order of numbers within a wonderful four does not form a new wonderful four).

입력

출력

제한

예제 입력 1

0 2 6 2 8

예제 출력 1

4

예제 입력 2

9 2 3 3 9

예제 출력 2

0

힌트

출처

Olympiad > Latvian olympiad in informatics > 10th Latvian olympiad in informatics > Stage II (District/City) 1번

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

출처

대학교 대회

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

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