# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
144976 | 2019-08-18 10:11:11 | emilem | Zagrade (COI17_zagrade) | C++14 | Compilation error | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
long long ans;
int n;
int op, clos;
string path;
vector< vector<int> > nei;
string a;
void Chain(const string& a)
{
vector<int> pref(a.length());
for (int i = 0; i < pref.size(); ++i)
{
if (a[i] == '(') ++pref[i];
else --pref[i];
if (i) pref[i] += pref[i - 1];
}
vector<int> r(n, -1);
for (int i = 0; i < n; ++i)
{
int minElem = pref[i];
for (int j = i; j < n; ++j)
{
minElem = min(minElem, pref[j]);
if (minElem - (i ? pref[i - 1] : 0) < 0)
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Compilation message (stderr)
zagrade.cpp: In function 'void Chain(const string&)': zagrade.cpp:17:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int i = 0; i < pref.size(); ++i) ~~^~~~~~~~~~~~~ zagrade.cpp:33:9: error: no match for 'operator=' (operand types are 'std::vector<int>' and 'int') r = j; ^ In file included from /usr/include/c++/7/vector:69:0, from zagrade.cpp:4: /usr/include/c++/7/bits/vector.tcc:179:5: note: candidate: std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = int; _Alloc = std::allocator<int>] vector<_Tp, _Alloc>:: ^~~~~~~~~~~~~~~~~~~ /usr/include/c++/7/bits/vector.tcc:179:5: note: no known conversion for argument 1 from 'int' to 'const std::vector<int>&' In file included from /usr/include/c++/7/vector:64:0, from zagrade.cpp:4: /usr/include/c++/7/bits/stl_vector.h:461:7: note: candidate: std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = int; _Alloc = std::allocator<int>] operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move()) ^~~~~~~~ /usr/include/c++/7/bits/stl_vector.h:461:7: note: no known conversion for argument 1 from 'int' to 'std::vector<int>&&' /usr/include/c++/7/bits/stl_vector.h:482:7: note: candidate: std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = int; _Alloc = std::allocator<int>] operator=(initializer_list<value_type> __l) ^~~~~~~~ /usr/include/c++/7/bits/stl_vector.h:482:7: note: no known conversion for argument 1 from 'int' to 'std::initializer_list<int>' zagrade.cpp:38:22: error: no match for 'operator<=' (operand types are 'int' and 'std::vector<int>') for (int j = i; j <= r; ++j) ~~^~~~ In file included from /usr/include/c++/7/utility:70:0, from /usr/include/c++/7/algorithm:60, from zagrade.cpp:1: /usr/include/c++/7/bits/stl_pair.h:468:5: note: candidate: template<class _T1, class _T2> constexpr bool std::operator<=(const std::pair<_T1, _T2>&, const std::pair<_T1, _T2>&) operator<=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) ^~~~~~~~ /usr/include/c++/7/bits/stl_pair.h:468:5: note: template argument deduction/substitution failed: zagrade.cpp:38:25: note: mismatched types 'const std::pair<_T1, _T2>' and 'int' for (int j = i; j <= r; ++j) ^ In file included from /usr/include/c++/7/bits/stl_algobase.h:67:0, from /usr/include/c++/7/algorithm:61, from zagrade.cpp:1: /usr/include/c++/7/bits/stl_iterator.h:323:5: note: candidate: template<class _Iterator> bool std::operator<=(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_Iterator>&) operator<=(const reverse_iterator<_Iterator>& __x, ^~~~~~~~ /usr/include/c++/7/bits/stl_iterator.h:323:5: note: template argument deduction/substitution failed: zagrade.cpp:38:25: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int' for (int j = i; j <= r; ++j) ^ In file included from /usr/include/c++/7/bits/stl_algobase.h:67:0, from /usr/include/c++/7/algorithm:61, from zagrade.cpp:1: /usr/include/c++/7/bits/stl_iterator.h:361:5: note: candidate: template<class _IteratorL, class _IteratorR> bool std::operator<=(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_IteratorR>&) operator<=(const reverse_iterator<_IteratorL>& __x, ^~~~~~~~ /usr/include/c++/7/bits/stl_iterator.h:361:5: note: template argument deduction/substitution failed: zagrade.cpp:38:25: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int' for (int j = i; j <= r; ++j) ^ In file included from /usr/include/c++/7/bits/stl_algobase.h:67:0, from /usr/include/c++/7/algorithm:61, from zagrade.cpp:1: /usr/include/c++/7/bits/stl_iterator.h:1154:5: note: candidate: template<class _IteratorL, class _IteratorR> bool std::operator<=(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorR>&) operator<=(const move_iterator<_IteratorL>& __x, ^~~~~~~~ /usr/include/c++/7/bits/stl_iterator.h:1154:5: note: template argument deduction/substitution failed: zagrade.cpp:38:25: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int' for (int j = i; j <= r; ++j) ^ In file included from /usr/include/c++/7/bits/stl_algobase.h:67:0, from /usr/include/c++/7/algorithm:61, from zagrade.cpp:1: /usr/include/c++/7/bits/stl_iterator.h:1160:5: note: candidate: template<class _Iterator> bool std::operator<=(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorL>&) operator<=(const move_iterator<_Iterator>& __x, ^~~~~~~~ /usr/include/c++/7/bits/stl_iterator.h:1160:5: note: template argument deduction/substitution failed: zagrade.cpp:38:25: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int' for (int j = i; j <= r; ++j) ^ In file included from /usr/include/c++/7/string:52:0, from /usr/include/c++/7/bits/locale_classes.h:40, from /usr/include/c++/7/bits/ios_base.h:41, from /usr/include/c++/7/ios:42, from /usr/include/c++/7/ostream:38, from /usr/include/c++/7/iostream:39, from zagrade.cpp:2: /usr/include/c++/7/bits/basic_string.h:6158:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> bool std::operator<=(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) operator<=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, ^~~~~~~~ /usr/include/c++/7/bits/basic_string.h:6158:5: note: template argument deduction/substitution failed: zagrade.cpp:38:25: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>' and 'int' for (int j = i; j <= r; ++j) ^ In file included from /usr/include/c++/7/string:52:0, from /usr/include/c++/7/bits/locale_classes.h:40, from /usr/include/c++/7/bits/ios_base.h:41, from /usr/include/c++/7/ios:42, from /usr/include/c++/7/ostream:38, from /usr/include/c++/7/iostream:39, from zagrade.cpp:2: /usr/include/c++/7/bits/basic_string.h:6171:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> bool std::operator<=(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _CharT*) operator<=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, ^~~~~~~~ /usr/include/c++/7/bits/basic_string.h:6171:5: note: template argument deduction/substitution failed: zagrade.cpp:38:25: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>' and 'int' for (int j = i; j <= r; ++j) ^ In file included from /usr/include/c++/7/string:52:0, from /usr/include/c++/7/bits/locale_classes.h:40, from /usr/include/c++/7/bits/ios_base.h:41, from /usr/include/c++/7/ios:42, from /usr/include/c++/7/ostream:38, from /usr/include/c++/7/iostream:39, from zagrade.cpp:2: /usr/include/c++/7/bits/basic_string.h:6183:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> bool std::operator<=(const _CharT*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) operator<=(const _CharT* __lhs, ^~~~~~~~ /usr/include/c++/7/bits/basic_string.h:6183:5: note: template argument deduction/substitution failed: zagrade.cpp:38:25: note: mismatched types 'const _CharT*' and 'int' for (int j = i; j <= r; ++j) ^ In file included from /usr/include/c++/7/vector:64:0, from zagrade.cpp:4: /usr/include/c++/7/bits/stl_vector.h:1632:5: note: candidate: template<class _Tp, class _Alloc> bool std::operator<=(const std::vector<_Tp, _Alloc>&, const std::vector<_Tp, _Alloc>&) operator<=(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y) ^~~~~~~~ /usr/include/c++/7/bits/stl_vector.h:1632:5: note: template argument deduction/substitution failed: zagrade.cpp:38:25: note: mismatched types 'const std::vector<_Tp, _Alloc>' and 'int' for (int j = i; j <= r; ++j) ^ In file included from /usr/include/c++/7/bits/stl_algobase.h:67:0, from /usr/include/c++/7/algorithm:61, from zagrade.cpp:1: /usr/include/c++/7/bits/stl_iterator.h:923:5: note: candidate: template<class _Iterator, class _Container> bool __gnu_cxx::operator<=(const __gnu_cxx::__normal_iterator<_Iterator, _Container>&, const __gnu_cxx::__normal_iterator<_Iterator, _Container>&) operator<=(const __normal_iterator<_Iterator, _Container>& __lhs, ^~~~~~~~ /usr/include/c++/7/bits/stl_iterator.h:923:5: note: template argument deduction/substitution failed: zagrade.cpp:38:25: note: mismatched types 'const __gnu_cxx::__normal_iterator<_Iterator, _Container>' and 'int' for (int j = i; j <= r; ++j) ^ In file included from /usr/include/c++/7/bits/stl_algobase.h:67:0, from /usr/include/c++/7/algorithm:61, from zagrade.cpp:1: /usr/include/c++/7/bits/stl_iterator.h:916:5: note: candidate: template<class _IteratorL, class _IteratorR, class _Container> bool __gnu_cxx::operator<=(const __gnu_cxx::__normal_iterator<_IteratorL, _Container>&, const __gnu_cxx::__normal_iterator<_IteratorR, _Container>&) operator<=(const __normal_iterator<_IteratorL, _Container>& __lhs, ^~~~~~~~ /usr/include/c++/7/bits/stl_iterator.h:916:5: note: template argument deduction/substitution failed: zagrade.cpp:38:25: note: mismatched types 'const __gnu_cxx::__normal_iterator<_IteratorL, _Container>' and 'int' for (int j = i; j <= r; ++j) ^ zagrade.cpp: In function 'void Dfs(int, int)': zagrade.cpp:51:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int i = 0; i < nei[v].size(); ++i) ~~^~~~~~~~~~~~~~~