Submission #341837

#TimeUsernameProblemLanguageResultExecution timeMemory
341837phathnvCOCI17_cezar (COCI17_cezar)C++11
50 / 50
1 ms512 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 cntLeq = 0, cntGe = 0; for(int i = 2; i <= x; i++) cntLeq += cnt[i]; for(int i = x + 1; i <= 11; i++) cntGe += cnt[i]; cout << (cntGe >= cntLeq? "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...