Submission #884279

# Submission time Handle Problem Language Result Execution time Memory
884279 2023-12-07T05:53:10 Z vjudge1 COCI17_cezar (COCI17_cezar) C++17
5 / 50
1 ms 756 KB
#ifndef Local
    #pragma GCC optimize("O3,unroll-loops")
    const int lim=2e5+100;
#else
    const int lim=2e3+100;
#endif

#include "bits/stdc++.h"
using namespace std;

#define int int64_t
#define pb push_back

const int mod=1e9+7;
using pii=pair<int,int>;

inline void solve(){
    int n;
    cin>>n;
    int numofcards[12]{-1,-1,4,4,4,4,4,4,4,4,16,4};
    int val=0;
    for(int i=0;i<n;i++){
        int tem;
        cin>>tem;
        val+=tem;
        numofcards[tem]--;
    } 
    int left=21-val;
    int lesser=0,great=0;
    for(int i=2;i<=val;i++){
        lesser+=numofcards[i];
    }
    for(int i=val+1;i<12;i++){
        great+=numofcards[i];
    }
    if(lesser<=great){
        cout<<"DOSTA\n";
    }
    else{
        cout<<"VUCI\n";
    }
}

signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
#ifdef Local  
    freopen(".in","r",stdin);
    freopen(".out","w",stdout);
#else
    //freopen("grass.in","r",stdin);
    //freopen("grass.out","w",stdout);
#endif
    int t=1;
    //cin>>t;
    while (t--)
    {
        solve();
    }
}

Compilation message

cezar.cpp: In function 'void solve()':
cezar.cpp:28:9: warning: unused variable 'left' [-Wunused-variable]
   28 |     int left=21-val;
      |         ^~~~
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 756 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -