Submission #37234

#TimeUsernameProblemLanguageResultExecution timeMemory
37234wasylCOCI17_cezar (COCI17_cezar)C++11
50 / 50
3 ms748 KiB
#include <vector> #include <iostream> #include <algorithm> #define d(...) __VA_ARGS__ #define all(x) (x).begin(), (x).end() #define eb(...) emplace_back(__VA_ARGS__) #define range(x,y,z) (x).begin()+y,(x).begin()+z using namespace std;using ll=long long; template<class t>using V = vector< t >; template<typename t>ostream& operator<< (typename enable_if<is_same<typename t::const_iterator, typename string::const_iterator>::value,ostream&>::type s,t& c) {for(auto& i : c)s<<i<<' ';return s;} int n; V< int > tab { 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 16, 4 }; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cin >> n; int sum = 0; while ( n-- ) { int p; cin >> p; --tab[p]; sum += p; } int bal = 0; for ( int i = 1; i < tab.size(); ++i ) bal += tab[i] * ( i + sum > 21? -1 : 1 ); cout << ( bal <= 0? "DOSTA" : "VUCI" ) << '\n'; }

Compilation message (stderr)

cezar.cpp: In function 'int main()':
cezar.cpp:30:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for ( int i = 1; i < tab.size(); ++i )
                   ~~^~~~~~~~~~~~
#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...