Submission #472717

#TimeUsernameProblemLanguageResultExecution timeMemory
472717MamdouhNCOCI17_cezar (COCI17_cezar)C++14
50 / 50
1 ms268 KiB
#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; break; } 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 (stderr)

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:42: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]
   42 |     for(int i=0;i<allcards.size();i++)if(allcards[i]>sum)greate++;
      |                 ~^~~~~~~~~~~~~~~~
#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...