Submission #472726

#TimeUsernameProblemLanguageResultExecution timeMemory
472726Ahmed_SolymanCOCI17_cezar (COCI17_cezar)C++14
45 / 50
1 ms204 KiB
#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"]; } if(cnt1>=cnt2){ cout<<"DOSTA"<<endl; } else{ cout<<"VUCI"<<endl; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...