이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
using namespace std;
int n, i, f[14], s, a, nrmic, nrmare, x;
int main(){
for(i=2;i<=11;i++)
f[i] = 4;
cin>>n;
for(i=1;i<=n;i++){
cin>>a;
f[a]--;
s += a;
}
if(s > 21){
cout<<"DOSTA";
return 0;
}
x = 21 - s;
for(i=2;i<=11;i++)
if(i<=x)
nrmic+=f[i];
else
nrmare+=f[i];
if(nrmare < nrmic)
cout<<"VUCI";
else
cout<<"DOSTA";
return 0;
}
/// 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.
/// nu mai tragi alta carte daca numarul de carti ramase in pachet cu valoarea mai mare decat x
/// e mai mare sau egal cu numarul de carti ramase in pachet cu valoarea mai mica decat x,
/// x fiind diferenta dintre 21 si cat ai deja in mana
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |