Submission #138281

#TimeUsernameProblemLanguageResultExecution timeMemory
138281mariadincaCOCI17_cezar (COCI17_cezar)C++14
45 / 50
2 ms392 KiB
#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 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...