Submission #141656

# Submission time Handle Problem Language Result Execution time Memory
141656 2019-08-08T16:30:33 Z MihaelaCismaru COCI17_cezar (COCI17_cezar) C++14
30 / 50
2 ms 380 KB
#include<iostream>
using namespace std;
int a,x,les,gre,n,sum;
int deck[12] = {0,0,4,4,4,4,4,4,4,4,12,4};
int main (void) {
    cin >> n;
    for (int i = 1; i <= n; i ++) {
        cin >> a;
        deck[a] --;
        sum += a;
        x = 21-sum;
        les = 0;
        gre = 0;
        for (int j = 2; j < x; j ++) {
            les += j*deck[j];
        }

        for (int j = x; j <= 11; j ++) {
            gre += j*deck[j];
        }

        if (les < gre) {
            cout << "DOSTA";
            return 0;
        }
    }

    cout << "VUCI";

    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Incorrect 2 ms 376 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Incorrect 2 ms 256 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 2 ms 256 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 380 KB Output is correct
2 Incorrect 2 ms 256 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 2 ms 256 KB Output is correct