Submission #341822

#TimeUsernameProblemLanguageResultExecution timeMemory
341822phathnvCOCI17_cezar (COCI17_cezar)C++11
45 / 50
1 ms384 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 53; int n, a[N], cnt[12]; void ReadInput(){ cin >> n; for(int i = 1; i <= n; i++) cin >> a[i]; } void Solve(){ int sum = accumulate(a + 1, a + 1 + n, 0); if (sum > 21){ cout << "DOSTA"; return; } for(int i = 2; i <= 11; i++) cnt[i] = 4; cnt[10] = 12; for(int i = 1; i <= n; i++) cnt[a[i]]--; int x = 21 - sum; int cntLarger = 0; for(int i = x + 1; i <= 11; i++) cntLarger += cnt[i]; cout << (cntLarger >= (52 - n - cntLarger)? "DOSTA" : "VUCI"); } int main(){ ios_base::sync_with_stdio(0); cin.tie(0); ReadInput(); Solve(); 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...