Submission #472714

# Submission time Handle Problem Language Result Execution time Memory
472714 2021-09-14T08:16:58 Z MamdouhN COCI17_cezar (COCI17_cezar) C++14
45 / 50
1 ms 272 KB
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define endl "\n"

vector<int>allcards;

main()
{
    for(int i=2;i<=14;i++)
    {
        int x = i;
        if(i>11) x =10;
        allcards.push_back(x);
        allcards.push_back(x);
        allcards.push_back(x);
        allcards.push_back(x);
    }
    int deck = 52;
    //cout<<allcards.size()<<endl;
    //for(auto v:allcards)cout<<v<<" ";
    //cout<<endl;
    sort(allcards.begin(),allcards.end());
    int n;
    cin>>n;
    int sum = 0;
    for(int i=0;i<n;i++)
    {
        int x;
        cin>>x;
        for(int i=0;i<allcards.size();i++)
            if(allcards[i]==x)allcards[i]=0;
        deck--;
        sum+=x;
    }
    sum = 21-sum;
    int greate=0;
    for(int i=0;i<allcards.size();i++)if(allcards[i]>sum)greate++;
    if(greate>=deck-greate)cout<<"DOSTA"<<endl;
    else cout<<"VUCI"<<endl;

}

Compilation message

cezar.cpp:8:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    8 | main()
      | ^~~~
cezar.cpp: In function 'int main()':
cezar.cpp:31:22: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   31 |         for(int i=0;i<allcards.size();i++)
      |                     ~^~~~~~~~~~~~~~~~
cezar.cpp:38:18: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   38 |     for(int i=0;i<allcards.size();i++)if(allcards[i]>sum)greate++;
      |                 ~^~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 244 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 272 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct