# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
865039 | Darren0724 | Football (info1cup20_football) | C++17 | 컴파일 에러 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
#define all(x) x.begin(),x.end()
#define int long long
#define ACorz ios_base::sync_with_stdio(false);cin.tie(0);
void solve(){
int n,k;cin>>n>>k;
vector<int> v(n);
int total=0,total2=0;
for(int i=0;i<n;i++){
cin>>v[i];
total+=v[i];
total2+=v[i]/2;
}
if(k==1){
cout<<(total&1);
return;
}
cout<<(total&1)|(total2&1);
}
int32_t main(){
ACorz;
int t=1;cin>>t;
while(t--){
solve();
}
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
football.cpp: In function 'void solve()': football.cpp:21:20: error: no match for 'operator|' (operand types are 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} and 'long long int') 21 | cout<<(total&1)|(total2&1); | ~~~~~~~~~~~~~~~^~~~~~~~~~~ | | | | | long long int | std::basic_ostream<char>::__ostream_type {aka std::basic_ostream<char>} football.cpp:21:20: note: candidate: 'operator|(int, long long int)' (built-in) 21 | cout<<(total&1)|(total2&1); | ~~~~~~~~~~~~~~~^~~~~~~~~~~ football.cpp:21:20: note: no known conversion for argument 1 from 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} to 'int' In file included from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:45, from football.cpp:1: /usr/include/c++/10/cstddef:134:3: note: candidate: 'constexpr std::byte std::operator|(std::byte, std::byte)' 134 | operator|(byte __l, byte __r) noexcept | ^~~~~~~~ /usr/include/c++/10/cstddef:134:18: note: no known conversion for argument 1 from 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} to 'std::byte' 134 | operator|(byte __l, byte __r) noexcept | ~~~~~^~~ In file included from /usr/include/c++/10/ios:42, from /usr/include/c++/10/istream:38, from /usr/include/c++/10/sstream:38, from /usr/include/c++/10/complex:45, from /usr/include/c++/10/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54, from football.cpp:1: /usr/include/c++/10/bits/ios_base.h:87:3: note: candidate: 'constexpr std::_Ios_Fmtflags std::operator|(std::_Ios_Fmtflags, std::_Ios_Fmtflags)' 87 | operator|(_Ios_Fmtflags __a, _Ios_Fmtflags __b) | ^~~~~~~~ /usr/include/c++/10/bits/ios_base.h:87:27: note: no known conversion for argument 1 from 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} to 'std::_Ios_Fmtflags' 87 | operator|(_Ios_Fmtflags __a, _Ios_Fmtflags __b) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/10/bits/ios_base.h:129:3: note: candidate: 'constexpr std::_Ios_Openmode std::operator|(std::_Ios_Openmode, std::_Ios_Openmode)' 129 | operator|(_Ios_Openmode __a, _Ios_Openmode __b) | ^~~~~~~~ /usr/include/c++/10/bits/ios_base.h:129:27: note: no known conversion for argument 1 from 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} to 'std::_Ios_Openmode' 129 | operator|(_Ios_Openmode __a, _Ios_Openmode __b) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/10/bits/ios_base.h:169:3: note: candidate: 'constexpr std::_Ios_Iostate std::operator|(std::_Ios_Iostate, std::_Ios_Iostate)' 169 | operator|(_Ios_Iostate __a, _Ios_Iostate __b) | ^~~~~~~~ /usr/include/c++/10/bits/ios_base.h:169:26: note: no known conversion for argument 1 from 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} to 'std::_Ios_Iostate' 169 | operator|(_Ios_Iostate __a, _Ios_Iostate __b) | ~~~~~~~~~~~~~^~~ In file included from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:66, from football.cpp:1: /usr/include/c++/10/bitset:1444:5: note: candidate: 'template<long unsigned int _Nb> std::bitset<_Nb> std::operator|(const std::bitset<_Nb>&, const std::bitset<_Nb>&)' 1444 | operator|(const bitset<_Nb>& __x, const bitset<_Nb>& __y) _GLIBCXX_NOEXCEPT | ^~~~~~~~ /usr/include/c++/10/bitset:1444:5: note: template argument deduction/substitution failed: football.cpp:21:30: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::bitset<_Nb>' 21 | cout<<(total&1)|(total2&1); | ^ In file included from /usr/include/c++/10/bits/shared_ptr_atomic.h:33, from /usr/include/c++/10/memory:85, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:82, from football.cpp:1: /usr/include/c++/10/bits/atomic_base.h:94:3: note: candidate: 'constexpr std::memory_order std::operator|(std::memory_order, std::__memory_order_modifier)' 94 | operator|(memory_order __m, __memory_order_modifier __mod) | ^~~~~~~~ /usr/include/c++/10/bits/atomic_base.h:94:26: note: no known conversion for argument 1 from 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} to 'std::memory_order' 94 | operator|(memory_order __m, __memory_order_modifier __mod) | ~~~~~~~~~~~~~^~~ In file included from /usr/include/c++/10/valarray:603, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:95, from football.cpp:1: /usr/include/c++/10/bits/valarray_after.h:412:5: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__bitwise_or, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__bitwise_or, typename _Dom1::value_type>::result_type> std::operator|(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const std::_Expr<_Dom2, typename _Dom2::value_type>&)' 412 | _DEFINE_EXPR_BINARY_OPERATOR(|, __bitwise_or) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/10/bits/valarray_after.h:412:5: note: template argument deduction/substitution failed: football.cpp:21:30: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 21 | cout<<(total&1)|(total2&1); | ^ In file included from /usr/include/c++/10/valarray:603, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:95, from football.cpp:1: /usr/include/c++/10/bits/valarray_after.h:412:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__bitwise_or, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__bitwise_or, typename _Dom1::value_type>::result_type> std::operator|(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)' 412 | _DEFINE_EXPR_BINARY_OPERATOR(|, __bitwise_or) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/10/bits/valarray_after.h:412:5: note: template argument deduction/substitution failed: football.cpp:21:30: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 21 | cout<<(total&1)|(total2&1); | ^ In file included from /usr/include/c++/10/valarray:603, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:95, from football.cpp:1: /usr/include/c++/10/bits/valarray_after.h:412:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__bitwise_or, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__bitwise_or, typename _Dom1::value_type>::result_type> std::operator|(const typename _Dom::value_type&, const std::_Expr<_Dom1, typename _Dom1::value_type>&)' 412 | _DEFINE_EXPR_BINARY_OPERATOR(|, __bitwise_or) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/10/bits/valarray_after.h:412:5: note: template argument deduction/substitution failed: football.cpp:21:30: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'long long int' 21 | cout<<(total&1)|(total2&1); | ^ In file included from /usr/include/c++/10/valarray:603, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:95, from football.cpp:1: /usr/include/c++/10/bits/valarray_after.h:412:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__bitwise_or, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__bitwise_or, typename _Dom1::value_type>::result_type> std::operator|(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const std::valarray<typename _Dom::value_type>&)' 412 | _DEFINE_EXPR_BINARY_OPERATOR(|, __bitwise_or) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/10/bits/valarray_after.h:412:5: note: template argument deduction/substitution failed: football.cpp:21:30: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 21 | cout<<(total&1)|(total2&1); | ^ In file included from /usr/include/c++/10/valarray:603, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:95, from football.cpp:1: /usr/include/c++/10/bits/valarray_after.h:412:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__bitwise_or, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__bitwise_or, typename _Dom1::value_type>::result_type> std::operator|(const std::valarray<typename _Dom::value_type>&, const std::_Expr<_Dom1, typename _Dom1::value_type>&)' 412 | _DEFINE_EXPR_BINARY_OPERATOR(|, __bitwise_or) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/10/bits/valarray_after.h:412:5: note: template argument deduction/substitution failed: football.cpp:21:30: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'long long int' 21 | cout<<(total&1)|(total2&1); | ^ In file included from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:95, from football.cpp:1: /usr/include/c++/10/valarray:1192:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__bitwise_or, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__bitwise_or, _Tp>::result_type> std::operator|(const std::valarray<_Tp>&, const std::valarray<_Tp>&)' 1192 | _DEFINE_BINARY_OPERATOR(|, __bitwise_or) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/10/valarray:1192:1: note: template argument deduction/substitution failed: football.cpp:21:30: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::valarray<_Tp>' 21 | cout<<(total&1)|(total2&1); | ^ In file included from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:95, from football.cpp:1: /usr/include/c++/10/valarray:1192:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__bitwise_or, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__bitwise_or, _Tp>::result_type> std::operator|(const std::valarray<_Tp>&, const typename std::valarray<_Tp>::value_type&)' 1192 | _DEFINE_BINARY_OPERATOR(|, __bitwise_or) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/10/valarray:1192:1: note: template argument deduction/substitution failed: football.cpp:21:30: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::valarray<_Tp>' 21 | cout<<(total&1)|(total2&1); | ^ In file included from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:95, from football.cpp:1: /usr/include/c++/10/valarray:1192:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__bitwise_or, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__bitwise_or, _Tp>::result_type> std::operator|(const typename std::valarray<_Tp>::value_type&, const std::valarray<_Tp>&)' 1192 | _DEFINE_BINARY_OPERATOR(|, __bitwise_or) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/10/valarray:1192:1: note: template argument deduction/substitution failed: football.cpp:21:30: note: mismatched types 'const std::valarray<_Tp>' and 'long long int' 21 | cout<<(total&1)|(total2&1); | ^ In file included from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:105, from football.cpp:1: /usr/include/c++/10/future:149:20: note: candidate: 'constexpr std::launch std::operator|(std::launch, std::launch)' 149 | constexpr launch operator|(launch __x, launch __y) | ^~~~~~~~ /usr/include/c++/10/future:149:37: note: no known conversion for argument 1 from 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} to 'std::launch' 149 | constexpr launch operator|(launch __x, launch __y) | ~~~~~~~^~~ In file included from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:127, from football.cpp:1: /usr/include/c++/10/charconv:664:3: note: candidate: 'constexpr std::chars_format std::operator|(std::chars_format, std::chars_format)' 664 | operator|(chars_format __lhs, chars_format __rhs) noexcept | ^~~~~~~~ /usr/include/c++/10/charconv:664:26: note: no known conversion for argument 1 from 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} to 'std::chars_format' 664 | operator|(chars_format __lhs, chars_format __rhs) noexcept | ~~~~~~~~~~~~~^~~~~