Submission #37234

# Submission time Handle Problem Language Result Execution time Memory
37234 2017-12-22T19:00:37 Z wasyl COCI17_cezar (COCI17_cezar) C++11
50 / 50
3 ms 748 KB
#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

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 time Memory Grader output
1 Correct 2 ms 248 KB Output is correct
2 Correct 2 ms 484 KB Output is correct
3 Correct 2 ms 484 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 484 KB Output is correct
2 Correct 2 ms 536 KB Output is correct
3 Correct 3 ms 664 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 664 KB Output is correct
2 Correct 3 ms 720 KB Output is correct
3 Correct 3 ms 720 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 720 KB Output is correct
2 Correct 2 ms 720 KB Output is correct
3 Correct 3 ms 720 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 720 KB Output is correct
2 Correct 3 ms 720 KB Output is correct
3 Correct 2 ms 720 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 720 KB Output is correct
2 Correct 2 ms 720 KB Output is correct
3 Correct 2 ms 748 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 748 KB Output is correct
2 Correct 2 ms 748 KB Output is correct
3 Correct 2 ms 748 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 748 KB Output is correct
2 Correct 2 ms 748 KB Output is correct
3 Correct 2 ms 748 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 748 KB Output is correct
2 Correct 2 ms 748 KB Output is correct
3 Correct 2 ms 748 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 748 KB Output is correct
2 Correct 2 ms 748 KB Output is correct
3 Correct 2 ms 748 KB Output is correct