# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
92659 | kitsu_hi | Scales (IOI15_scales) | 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.
#include "scales.h"
#include<bits/stdc++.h>
using namespace std;
vector<int> mi1, ma1;
void init(int T) {
/* ... */
}
vector<int> all = {1, 2, 3, 4, 5, 6};
int kick( int x ) {
for( int i = 0; i < all.size() - 1; i++ ) {
if ( all[i] == x ) {
swap( all[i], all[i + 1] );
}
}
all.pop();
}
void orderCoins() {
/* ... */
vector <int> ANS[6];
int ma = getHeaviest(1, 2, 3);
int mi = getLightest(4, 5, 6);
for ( int i = 1; i <= 3; i++ ) {
if ( i != ma ) {
mi1.push_back(i);
}
}
for ( int j = 4; j <= 6; j++ ) {
if ( j != mi ) {
ma1.push_back(i);
}
}
ANS[0] = getLightest( mi1[0], mi1[1], mi );
ANS[5] = getHeaviest( ma1[0], ma1[1], ma );
kick( ANS[0] );
kick( ANS[5] );
int p = getMedian( all[0], all[1], all[2] );
kick( p );
int y = all[2];
all.pop();
int ANS[4] = getHeaviest( y, all[0], all[1] );
int niilber = all[0] + all[1];
if ( y == ANS[4] ) {
ANS[2] = p;
ANS[1] = getLightest( all[0], all[1], ANS[5] );
ANS[3] = niilber - ANS[1];
}
if ( y != ANS[4] ) {
int k = niilber - ANS[4];
ANS[2] = getMedian( k, y, p);
if( k == ANS[2] ) {
ANS[3] = p;
ANS[1] = y;
}
if ( y == ANS[2] ) {
ANS[3] = p;
ANS[1] = k;
}
if ( p == ANS[2] ) {
ANS[1] = k;
ANS[3] = y;
}
}
answer(ANS);
}
Compilation message (stderr)
In file included from grader.c:2:0: graderlib.c: In function 'void answer(int*)': graderlib.c:53:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation] if (_ghksjhdfkae19ga_ > 1) ^~ graderlib.c:56:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if' for (i = 0; i < 6; i++) { ^~~ scales.cpp: In function 'void init(int)': scales.cpp:7:15: warning: unused parameter 'T' [-Wunused-parameter] void init(int T) { ^ scales.cpp: In function 'int kick(int)': scales.cpp:14:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for( int i = 0; i < all.size() - 1; i++ ) { ~~^~~~~~~~~~~~~~~~ scales.cpp:19:9: error: 'class std::vector<int>' has no member named 'pop' all.pop(); ^~~ scales.cpp:20:1: warning: no return statement in function returning non-void [-Wreturn-type] } ^ scales.cpp: In function 'void orderCoins()': scales.cpp:35:27: error: 'i' was not declared in this scope ma1.push_back(i); ^ scales.cpp:38:46: error: no match for 'operator=' (operand types are 'std::vector<int>' and 'int') ANS[0] = getLightest( mi1[0], mi1[1], mi ); ^ In file included from /usr/include/c++/7/vector:69:0, from /usr/include/c++/7/queue:61, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:86, from scales.cpp:2: /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 /usr/include/c++/7/queue:61, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:86, from scales.cpp:2: /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>' scales.cpp:39:46: error: no match for 'operator=' (operand types are 'std::vector<int>' and 'int') ANS[5] = getHeaviest( ma1[0], ma1[1], ma ); ^ In file included from /usr/include/c++/7/vector:69:0, from /usr/include/c++/7/queue:61, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:86, from scales.cpp:2: /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 /usr/include/c++/7/queue:61, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:86, from scales.cpp:2: /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>' scales.cpp:40:18: error: cannot convert 'std::vector<int>' to 'int' for argument '1' to 'int kick(int)' kick( ANS[0] ); ^ scales.cpp:41:18: error: cannot convert 'std::vector<int>' to 'int' for argument '1' to 'int kick(int)' kick( ANS[5] ); ^ scales.cpp:45:9: error: 'class std::vector<int>' has no member named 'pop' all.pop(); ^~~ scales.cpp:46:14: error: conflicting declaration 'int ANS [4]' int ANS[4] = getHeaviest( y, all[0], all[1] ); ^ scales.cpp:24:18: note: previous declaration as 'std::vector<int> ANS [6]' vector <int> ANS[6]; ^~~ scales.cpp:48:12: error: no match for 'operator==' (operand types are 'int' and 'std::vector<int>') if ( y == ANS[4] ) { ~~^~~~~~~~~ In file included from /usr/include/c++/7/regex:62:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:110, from scales.cpp:2: /usr/include/c++/7/bits/regex.h:940:5: note: candidate: template<class _BiIter> bool std::__cxx11::operator==(const std::__cxx11::sub_match<_BiIter>&, const std::__cxx11::sub_match<_BiIter>&) operator==(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) ^~~~~~~~ /usr/include/c++/7/bits/regex.h:940:5: note: template argument deduction/substitution failed: scales.cpp:48:20: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' if ( y == ANS[4] ) { ^ In file included from /usr/include/c++/7/regex:62:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:110, from scales.cpp:2: /usr/include/c++/7/bits/regex.h:1013:5: note: candidate: template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const std::__cxx11::sub_match<_BiIter>&) operator==(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, ^~~~~~~~ /usr/include/c++/7/bits/regex.h:1013:5: note: template argument deduction/substitution failed: scales.cpp:48:20: note: mismatched types 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>' and 'int' if ( y == ANS[4] ) { ^ In file included from /usr/include/c++/7/regex:62:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:110, from scales.cpp:2: /usr/include/c++/7/bits/regex.h:1093:5: note: candidate: template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(const std::__cxx11::sub_match<_BiIter>&, std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&) operator==(const sub_match<_Bi_iter>& __lhs, ^~~~~~~~ /usr/include/c++/7/bits/regex.h:1093:5: note: template argument deduction/substitution failed: scales.cpp:48:20: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' if ( y == ANS[4] ) { ^ In file included from /usr/include/c++/7/regex:62:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:110, from scales.cpp:2: /usr/include/c++/7/bits/regex.h:1173:5: note: candidate: template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type*, const std::__cxx11::sub_match<_BiIter>&) operator==(typename iterator_traits<_Bi_iter>::value_type const* __lhs, ^~~~~~~~ /usr/include/c++/7/bits/regex.h:1173:5: note: template argument deduction/substitution failed: scales.cpp:48:20: note: 'std::vector<int>' is not derived from 'const std::__cxx11::sub_match<_BiIter>' if ( y == ANS[4] ) { ^ In file included from /usr/include/c++/7/regex:62:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:110, from scales.cpp:2: /usr/include/c++/7/bits/regex.h:1247:5: note: candidate: template<class _Bi_iter> bool std::__cxx11::operator==(const std::__cxx11::sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*) operator==(const sub_match<_Bi_iter>& __lhs, ^~~~~~~~ /usr/include/c++/7/bits/regex.h:1247:5: note: template argument deduction/substitution failed: scales.cpp:48:20: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' if ( y == ANS[4] ) { ^ In file included from /usr/include/c++/7/regex:62:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:110, from scales.cpp:2: /usr/include/c++/7/bits/regex.h:1321:5: note: candidate: template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type&, const std::__cxx11::sub_match<_BiIter>&) operator==(typename iterator_traits<_Bi_iter>::value_type const& __lhs, ^~~~~~~~ /usr/include/c++/7/bits/regex.h:1321:5: note: template argument deduction/substitution failed: scales.cpp:48:20: note: 'std::vector<int>' is not derived from 'const std::__cxx11::sub_match<_BiIter>' if ( y == ANS[4] ) { ^ In file included from /usr/include/c++/7/regex:62:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:110, from scales.cpp:2: /usr/include/c++/7/bits/regex.h:1401:5: note: candidate: template<class _Bi_iter> bool std::__cxx11::operator==(const std::__cxx11::sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&) operator==(const sub_match<_Bi_iter>& __lhs, ^~~~~~~~ /usr/include/c++/7/bits/regex.h:1401:5: note: template argument deduction/substitution failed: scales.cpp:48:20: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' if ( y == ANS[4] ) { ^ In file included from /usr/include/c++/7/regex:62:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:110, from scales.cpp:2: /usr/include/c++/7/bits/regex.h:1920:5: note: candidate: template<class _Bi_iter, class _Alloc> bool std::__cxx11::operator==(const std::__cxx11::match_results<_BiIter, _Alloc>&, const std::__cxx11::match_results<_BiIter, _Alloc>&) operator==(const match_results<_Bi_iter, _Alloc>& __m1, ^~~~~~~~ /usr/include/c++/7/bits/regex.h:1920:5: note: template argument deduction/substitution failed: scales.cpp:48:20: note: mismatched types 'const std::__cxx11::match_results<_BiIter, _Alloc>' and 'int' if ( y == ANS[4] ) { ^ In file included from /usr/include/c++/7/iosfwd:40:0, from /usr/include/c++/7/ios:38, from /usr/include/c++/7/istream:38, from /usr/include/c++/7/sstream:38, from /usr/include/c++/7/complex:45, from /usr/include/c++/7/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52, from scales.cpp:2: /usr/include/c++/7/bits/postypes.h:216:5: note: candidate: template<class _StateT> bool std::operator==(const std::fpos<_StateT>&, const std::fpos<_StateT>&) operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) ^~~~~~~~ /usr/include/c++/7/bits/postypes.h:216:5: note: template argument deduction/substitution failed: scales.cpp:48:20: note: mismatched types 'const std::fpos<_StateT>' and 'int' if ( y == ANS[4] ) { ^ In file included from /usr/include/c++/7/bits/stl_algobase.h:64:0, from /usr/include/c++/7/bits/char_traits.h:39, from /usr/include/c++/7/ios:40, from /usr/include/c++/7/istream:38, from /usr/include/c++/7/sstream:38, from /usr/include/c++/7/complex:45, from /usr/include/c++/7/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52, from scales.cpp:2: /usr/include/c++/7/bits/stl_pair.h:443: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:443:5: note: template argument deduction/substitution failed: scales.cpp:48:20: note: mismatched types 'const std::pair<_T1, _T2>' and 'int' if ( y == ANS[4] ) { ^ In file included from /usr/include/c++/7/bits/stl_algobase.h:67:0, from /usr/include/c++/7/bits/char_traits.h:39, from /usr/include/c++/7/ios:40, from /usr/include/c++/7/istream:38, from /usr/include/c++/7/sstream:38, from /usr/include/c++/7/complex:45, from /usr/include/c++/7/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52, from scales.cpp:2: /usr/include/c++/7/bits/stl_iterator.h:299: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:299:5: note: template argument deduction/substitution failed: scales.cpp:48:20: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int' if ( y == ANS[4] ) { ^ In file included from /usr/include/c++/7/bits/stl_algobase.h:67:0, from /usr/include/c++/7/bits/char_traits.h:39, from /usr/include/c++/7/ios:40, from /usr/include/c++/7/istream:38, from /usr/include/c++/7/sstream:38, from /usr/include/c++/7/complex:45, from /usr/include/c++/7/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52, from scales.cpp:2: /usr/include/c++/7/bits/stl_iterator.h:337: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:337:5: note: template argument deduction/substitution failed: scales.cpp:48:20: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int' if ( y == ANS[4] ) { ^ In file included from /usr/include/c++/7/bits/stl_algobase.h:67:0, from /usr/include/c++/7/bits/char_traits.h:39, from /usr/include/c++/7/ios:40, from /usr/include/c++/7/istream:38, from /usr/include/c++/7/sstream:38, from /usr/include/c++/7/complex:45, from /usr/include/c++/7/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52, from scales.cpp:2: /usr/include/c++/7/bits/stl_iterator.h:1118: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:1118:5: note: template argument deduction/substitution failed: scales.cpp:48:20: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int' if ( y == ANS[4] ) { ^ In file included from /usr/include/c++/7/bits/stl_algobase.h:67:0, from /usr/include/c++/7/bits/char_traits.h:39, from /usr/include/c++/7/ios:40, from /usr/include/c++/7/istream:38, from /usr/include/c++/7/sstream:38, from /usr/include/c++/7/complex:45, from /usr/include/c++/7/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52, from scales.cpp:2: /usr/include/c++/7/bits/stl_iterator.h:1124: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:1124:5: note: template argument deduction/substitution failed: scales.cpp:48:20: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int' if ( y == ANS[4] ) { ^ In file included from /usr/include/c++/7/string:41: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/istream:38, from /usr/include/c++/7/sstream:38, from /usr/include/c++/7/complex:45, from /usr/include/c++/7/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52, from scales.cpp:2: /usr/include/c++/7/bits/allocator.h:146:5: note: candidate: template<class _T1, class _T2> bool std::operator==(const std::allocator<_CharT>&, const std::allocator<_T2>&) operator==(const allocator<_T1>&, const allocator<_T2>&) ^~~~~~~~ /usr/include/c++/7/bits/allocator.h:146:5: note: template argument deduction/substitution failed: scales.cpp:48:20: note: mismatched types 'const std::allocator<_CharT>' and 'int' if ( y == ANS[4] ) { ^ In file included from /usr/include/c++/7/string:41:0, from /usr/include/c++/7/bits/locale_classes.h:40, from /usr/include/c++/7/bits/ios_base.h:41,