Submission #341822

# Submission time Handle Problem Language Result Execution time Memory
341822 2020-12-31T06:23:22 Z phathnv COCI17_cezar (COCI17_cezar) C++11
45 / 50
1 ms 384 KB
#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 time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 384 KB Output is correct