답안 #472728

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
472728 2021-09-14T08:45:30 Z Ahmed_Solyman Cezar (COCI17_cezar) C++14
45 / 50
1 ms 204 KB
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int main()
{
    ll n;cin>>n;
    map<string,ll>fr;
    ll x=0;
    for(ll i=0;i<n;i++){
        int k;cin>>k;
        x+=k;
        fr[to_string(k)]++;
    }
    x=21-x;
    if(x>10){
        cout<<"VUCI"<<endl;return 0;
    }
    for(int i=1;i<10;i++){
        string y=to_string(i);
        fr[y]=4-fr[y];
    }
    fr["Ace"]=4-fr["Ace"];
    fr["Jack"]=4-fr["Jack"];
    fr["Queen"]=4-fr["Queen"];
    fr["King"]=4-fr["King"];
    ll cnt1=0,cnt2=0;
    for(int i=x+1;i<10;i++){
        string y=to_string(i);
        cnt1+=fr[y];
    }
    for(int i=1;i<=x;i++){
        string y=to_string(i);
        cnt2+=fr[y];
    }
    cnt1+=fr["Ace"]+fr["Jack"]+fr["Queen"]+fr["King"];
    if(x==10){
        cnt1-=fr["Jack"]+fr["Queen"]+fr["King"];
        cnt2+=fr["Jack"]+fr["Queen"]+fr["King"];
    }
    if(cnt1>cnt2){
        cout<<"DOSTA"<<endl;
    }
    else{
        cout<<"VUCI"<<endl;
    }
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct