포럼
문제 COCI00449

Cezar

설명

Little Caesar likes card games. Everytime he comes to Zagreb, he plays blackjack, the
famous card game, with his friends.
In this game, the player draws cards while the sum of the cards in his hand is less than or
equal to 21 or until he says “DOSTA” (Croatian for “STOP”).
At the beginning of the game, there are 52 cards in the deck, thirteen ranks of each of the
four suits. The card ranks are two, three, ..., ten, Jack, Queen, King and Ace. The card
values are the following: the cards with numbers on them are worth that number (e.g., “nine”
is 9), the cards with pictures (Jack, Queen, and King) are worth 10, whereas the Ace is worth
11.
Caesar has found himself in an interesting situation. During the game, he already drew \(N\)
cards whose sum is less than or equal to 21 and is now having second thoughts about
drawing one more card or not. Let’s assume \(X\) is the difference from the sum of the cards so
far to 21. Everybody knows that you don’t draw a card if the number of the remaining cards
in the deck whose value is greater than \(X\) is greater than or equal to the number of the
remaining cards in the deck whose value is less than or equal to \(X\).
Since Caesar is having a difficult time calculating whether he needs to draw another card or
not, he’s asking you to do it for him.

제약
입력 형식

The first line of input contains the positive integer \(N\) (\(1 \le N \le 52\)), the number of cards
Caesar has drawn so far.
Each of the following \(N\) lines contains a single positive integer, the value of the i^{th} card
Caesar drew.

출력 형식

If Caesar should draw another card, output “VUCI” (Croatian for “DRAW”), otherwise output
“DOSTA” (Croatian for “STOP”).

예제 1
입력
6
2
3
2
3
2
3
출력
DOSTA
예제 2
입력
1
10
출력
VUCI
예제 3
입력
2
5
6
출력
VUCI
문제 정보

생성자가 기록되지 않았습니다.

출처 COCI 2017/2018 Contest 1

평가 및 의견

Cezar

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 1 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

Cezar

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8