submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3 values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s618391054 | p03777 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
string a,b,ans;
cin>>a>>b;
if(a=="H" && b=="D")
ans="D";
else if(a=="D" && b=="H")
ans="D";
else if(s=="H" && b=="H")
ans="H";
else
ans="H";
cout<<ans<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:11:9: error: 's' was not declared in this scope
11 | else if(s=="H" && b=="H")
| ^
|
s599833777 | p03777 | C++ | #import<iostream>
main(){char a,b;std::cin>>a>>b;std::cout<<(a-b?"D":'H');} | a.cc:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
1 | #import<iostream>
| ^~~~~~
a.cc:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
2 | main(){char a,b;std::cin>>a>>b;std::cout<<(a-b?"D":'H');}
| ^~~~
a.cc: In function 'int main()':
a.cc:2:47: error: operands to '?:' have different types 'const char*' and 'char'
2 | main(){char a,b;std::cin>>a>>b;std::cout<<(a-b?"D":'H');}
| ~~~^~~~~~~~
|
s730461137 | p03777 | C++ | #import<iostream.h>
main(){char a,b;cin>>a>>b;cout<<(a-b?"D":'H');} | a.cc:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
1 | #import<iostream.h>
| ^~~~~~
a.cc:1:8: fatal error: iostream.h: No such file or directory
1 | #import<iostream.h>
| ^~~~~~~~~~~~
compilation terminated.
|
s164683267 | p03777 | C++ | #pragma GCC optimize("O3")
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lim 200005
#define pb push_back
#define S second
#define pb push_back
#define mp make_pair
#define INF 1e18
#define fr(i,j,k) for(ll i=j;i<=k;i++)
#define frd(i,j,k) for(ll i=j;i>=k;i--)
#define F first
#define sd(n) scanf("%lld",&n)
#define pd(n) printf("%lld\n",n)
#define db double
#define mod 1000000007
#define pii pair<ll,ll>
ll getans(ll n,ll k)
{ if(k==1)
return n+1;
ll ans=n;
for(ll i=0;i<=(k-2);i++)
ans*=(n-i);
return ans;
}
int main()
{
char a,b;
cin>>a>>b;
if(a=='H')
{
cout<<b;
}
else
{
if(b=='H')
cout<<"D";
else cout<"H";
}
} | a.cc: In function 'int main()':
a.cc:39:14: error: no match for 'operator<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'const char [2]')
39 | else cout<"H";
| ~~~~^~~~
| | |
| | const char [2]
| std::ostream {aka std::basic_ostream<char>}
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
from a.cc:2:
/usr/include/c++/14/bits/regex.h:1143:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const sub_match<_BiIter>&)'
1143 | operator<(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1143:5: note: template argument deduction/substitution failed:
a.cc:39:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
39 | else cout<"H";
| ^~~
/usr/include/c++/14/bits/regex.h:1224:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)'
1224 | operator<(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1224:5: note: template argument deduction/substitution failed:
a.cc:39:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>'
39 | else cout<"H";
| ^~~
/usr/include/c++/14/bits/regex.h:1317:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)'
1317 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1317:5: note: template argument deduction/substitution failed:
a.cc:39:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
39 | else cout<"H";
| ^~~
/usr/include/c++/14/bits/regex.h:1391:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)'
1391 | operator<(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1391:5: note: template argument deduction/substitution failed:
a.cc:39:15: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'const char [2]'
39 | else cout<"H";
| ^~~
/usr/include/c++/14/bits/regex.h:1485:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)'
1485 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1485:5: note: template argument deduction/substitution failed:
a.cc:39:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
39 | else cout<"H";
| ^~~
/usr/include/c++/14/bits/regex.h:1560:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)'
1560 | operator<(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1560:5: note: template argument deduction/substitution failed:
a.cc:39:15: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'const char [2]'
39 | else cout<"H";
| ^~~
/usr/include/c++/14/bits/regex.h:1660:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)'
1660 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1660:5: note: template argument deduction/substitution failed:
a.cc:39:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
39 | else cout<"H";
| ^~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed:
a.cc:39:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::pair<_T1, _T2>'
39 | else cout<"H";
| ^~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
448 | operator<(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed:
a.cc:39:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
39 | else cout<"H";
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
493 | operator<(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed:
a.cc:39:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
39 | else cout<"H";
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1694 | operator<(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed:
a.cc:39:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
39 | else cout<"H";
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1760 | operator<(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed:
a.cc:39:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
39 | else cout<"H";
| ^~~
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
673 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed:
a.cc:39:15: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
39 | else cout<"H";
| ^~~
/usr/include/c++/14/string_view:680:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
680 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:680:5: note: template argument deduction/substitution failed:
a.cc:39:15: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
39 | else cout<"H";
| ^~~
/usr/include/c++/14/string_view:688:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)'
688 | operator< (__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:688:5: note: template argument deduction/substitution failed:
a.cc:39:15: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'const char*'
39 | else cout<"H";
| ^~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3874 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: template argument deduction/substitution failed:
a.cc:39:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
39 | else cout<"H";
| ^~~
/usr/include/c++/14/bits/basic_string.h:3888:5: note: candidate: 'template<clas |
s509882078 | p03777 | C++ | #pragma GCC optimize("O3")
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lim 200005
#define pb push_back
#define S second
#define pb push_back
#define mp make_pair
#define INF 1e18
#define fr(i,j,k) for(ll i=j;i<=k;i++)
#define frd(i,j,k) for(ll i=j;i>=k;i--)
#define F first
#define sd(n) scanf("%lld",&n)
#define pd(n) printf("%lld\n",n)
#define db double
#define mod 1000000007
#define pii pair<ll,ll>
ll getans(ll n,ll k)
{ if(k==1)
return n+1;
ll ans=n;
for(ll i=0;i<=(k-2);i++)
ans*=(n-i);
return ans;
}
int main()
{
char a,b;
cin>>a>>b;
if(a=='H')
{
cout<<b;
}
else
{
if(b=='H')
cout<"D";
else cout<"H";
}
} | a.cc: In function 'int main()':
a.cc:38:11: error: no match for 'operator<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'const char [2]')
38 | cout<"D";
| ~~~~^~~~
| | |
| | const char [2]
| std::ostream {aka std::basic_ostream<char>}
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
from a.cc:2:
/usr/include/c++/14/bits/regex.h:1143:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const sub_match<_BiIter>&)'
1143 | operator<(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1143:5: note: template argument deduction/substitution failed:
a.cc:38:12: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
38 | cout<"D";
| ^~~
/usr/include/c++/14/bits/regex.h:1224:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)'
1224 | operator<(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1224:5: note: template argument deduction/substitution failed:
a.cc:38:12: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>'
38 | cout<"D";
| ^~~
/usr/include/c++/14/bits/regex.h:1317:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)'
1317 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1317:5: note: template argument deduction/substitution failed:
a.cc:38:12: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
38 | cout<"D";
| ^~~
/usr/include/c++/14/bits/regex.h:1391:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)'
1391 | operator<(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1391:5: note: template argument deduction/substitution failed:
a.cc:38:12: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'const char [2]'
38 | cout<"D";
| ^~~
/usr/include/c++/14/bits/regex.h:1485:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)'
1485 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1485:5: note: template argument deduction/substitution failed:
a.cc:38:12: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
38 | cout<"D";
| ^~~
/usr/include/c++/14/bits/regex.h:1560:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)'
1560 | operator<(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1560:5: note: template argument deduction/substitution failed:
a.cc:38:12: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'const char [2]'
38 | cout<"D";
| ^~~
/usr/include/c++/14/bits/regex.h:1660:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)'
1660 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1660:5: note: template argument deduction/substitution failed:
a.cc:38:12: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
38 | cout<"D";
| ^~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed:
a.cc:38:12: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::pair<_T1, _T2>'
38 | cout<"D";
| ^~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
448 | operator<(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed:
a.cc:38:12: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
38 | cout<"D";
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
493 | operator<(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed:
a.cc:38:12: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
38 | cout<"D";
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1694 | operator<(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed:
a.cc:38:12: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
38 | cout<"D";
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1760 | operator<(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed:
a.cc:38:12: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
38 | cout<"D";
| ^~~
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
673 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed:
a.cc:38:12: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
38 | cout<"D";
| ^~~
/usr/include/c++/14/string_view:680:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
680 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:680:5: note: template argument deduction/substitution failed:
a.cc:38:12: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
38 | cout<"D";
| ^~~
/usr/include/c++/14/string_view:688:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)'
688 | operator< (__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:688:5: note: template argument deduction/substitution failed:
a.cc:38:12: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'const char*'
38 | cout<"D";
| ^~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3874 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: template argument deduction/substitution failed:
a.cc:38:12: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
38 | cout<"D";
| ^~~
/usr/include/c++/14/bits/basic_string.h:3888:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Alloca |
s954390947 | p03777 | C++ | #pragma GCC optimize("O3")
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lim 200005
#define pb push_back
#define S second
#define pb push_back
#define mp make_pair
#define INF 1e18
#define fr(i,j,k) for(ll i=j;i<=k;i++)
#define frd(i,j,k) for(ll i=j;i>=k;i--)
#define F first
#define sd(n) scanf("%lld",&n)
#define pd(n) printf("%lld\n",n)
#define db double
#define mod 1000000007
#define pii pair<ll,ll>
ll getans(ll n,ll k)
{ if(k==1)
return n+1;
ll ans=n;
for(ll i=0;i<=(k-2);i++)
ans*=(n-i);
return ans;
}
int main()
{
char a,b;
cin>>a>>b;
if(a=='H')
{
cout<<b;
}
else
{
if(b=='H')
cout<"D";
else cout<"B";
}
} | a.cc: In function 'int main()':
a.cc:38:11: error: no match for 'operator<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'const char [2]')
38 | cout<"D";
| ~~~~^~~~
| | |
| | const char [2]
| std::ostream {aka std::basic_ostream<char>}
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
from a.cc:2:
/usr/include/c++/14/bits/regex.h:1143:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const sub_match<_BiIter>&)'
1143 | operator<(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1143:5: note: template argument deduction/substitution failed:
a.cc:38:12: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
38 | cout<"D";
| ^~~
/usr/include/c++/14/bits/regex.h:1224:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)'
1224 | operator<(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1224:5: note: template argument deduction/substitution failed:
a.cc:38:12: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>'
38 | cout<"D";
| ^~~
/usr/include/c++/14/bits/regex.h:1317:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)'
1317 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1317:5: note: template argument deduction/substitution failed:
a.cc:38:12: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
38 | cout<"D";
| ^~~
/usr/include/c++/14/bits/regex.h:1391:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)'
1391 | operator<(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1391:5: note: template argument deduction/substitution failed:
a.cc:38:12: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'const char [2]'
38 | cout<"D";
| ^~~
/usr/include/c++/14/bits/regex.h:1485:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)'
1485 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1485:5: note: template argument deduction/substitution failed:
a.cc:38:12: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
38 | cout<"D";
| ^~~
/usr/include/c++/14/bits/regex.h:1560:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)'
1560 | operator<(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1560:5: note: template argument deduction/substitution failed:
a.cc:38:12: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'const char [2]'
38 | cout<"D";
| ^~~
/usr/include/c++/14/bits/regex.h:1660:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)'
1660 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1660:5: note: template argument deduction/substitution failed:
a.cc:38:12: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
38 | cout<"D";
| ^~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed:
a.cc:38:12: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::pair<_T1, _T2>'
38 | cout<"D";
| ^~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
448 | operator<(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed:
a.cc:38:12: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
38 | cout<"D";
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
493 | operator<(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed:
a.cc:38:12: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
38 | cout<"D";
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1694 | operator<(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed:
a.cc:38:12: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
38 | cout<"D";
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1760 | operator<(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed:
a.cc:38:12: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
38 | cout<"D";
| ^~~
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
673 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed:
a.cc:38:12: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
38 | cout<"D";
| ^~~
/usr/include/c++/14/string_view:680:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
680 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:680:5: note: template argument deduction/substitution failed:
a.cc:38:12: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
38 | cout<"D";
| ^~~
/usr/include/c++/14/string_view:688:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)'
688 | operator< (__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:688:5: note: template argument deduction/substitution failed:
a.cc:38:12: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'const char*'
38 | cout<"D";
| ^~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3874 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: template argument deduction/substitution failed:
a.cc:38:12: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
38 | cout<"D";
| ^~~
/usr/include/c++/14/bits/basic_string.h:3888:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Alloca |
s042255861 | p03777 | C++ | #include <stdio.h>
int main(int argc, char const *argv[])
{
int W, a, b;
scanf("%d%d%d", &W, &a, &b);
if(a+W<b) {
printf("%d\n", b-W-a);
} else if (a+W==b || a==b+w) {
printf("1\n");
} else if ((a < b && b < a+W) || (a < b+W < a+W)) {
printf("0\n");
} else {
printf("%d\n", a-b-W);
}
return 0;
}
| a.cc: In function 'int main(int, const char**)':
a.cc:9:29: error: 'w' was not declared in this scope
9 | } else if (a+W==b || a==b+w) {
| ^
|
s089383352 | p03777 | C++ | #include<iostream>
using namespace std;
int main(){
string s1,s2;
cin>>s1>>s2;
if(s1[0]=='H'){
if(s2[0]=='H')cout<<'H'<<endl;
else cout<<'D'<<endl;
)
else{
if(s2[0]=='D')cout<<'H'<<endl;
else cout<<'D'<<endl;
}
} | a.cc: In function 'int main()':
a.cc:9:1: error: expected primary-expression before ')' token
9 | )
| ^
a.cc:14:2: error: expected '}' at end of input
14 | }
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s251752830 | p03777 | C++ | #include<iostream>
using namespace std;
int main(){
string s1,s2;
cin>>s1>>s2;
if(s1[0]=='H'{
if(s2[0]=='H')cout<<'H'<<endl;
else cout<<'D'<<endl;
)
else{
if(s2[0]=='D')cout<<'H'<<endl;
else cout<<'D'<<endl;
}
} | a.cc: In function 'int main()':
a.cc:6:14: error: expected ')' before '{' token
6 | if(s1[0]=='H'{
| ~ ^
| )
a.cc:14:2: error: expected statement at end of input
14 | }
| ^
a.cc:14:2: error: expected '}' at end of input
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s924601278 | p03777 | C | #include<stdio.h>
int main(void)
{
char a,b;
scanf("%c",&a);
scanf("%c",&b);
if(a=='H'){
if(b=='H')printf("H");
else if(b=='D')printf("D");
}else if(a=='D'){
if(b=='H')printf("D");
else if(b==''D')printf("H");
}
return 0;
} | main.c: In function 'main':
main.c:12:20: error: empty character constant
12 | else if(b==''D')printf("H");
| ^~
main.c:12:22: error: expected ')' before 'D'
12 | else if(b==''D')printf("H");
| ~ ^
| )
main.c:12:23: warning: missing terminating ' character
12 | else if(b==''D')printf("H");
| ^
main.c:12:23: error: missing terminating ' character
12 | else if(b==''D')printf("H");
| ^~~~~~~~~~~~~~
main.c:13:5: error: expected expression before '}' token
13 | }
| ^
|
s715397945 | p03777 | C++ | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
using namespace std;
#define ll long long
#define PI acos(-1.0)
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)
//H-そのまま
//D-逆
int main(){
string a, b;
cin>>a>>b;
cout << (a=='H'?b:(b=='H'?'D':'H')) << endl;
} | a.cc: In function 'int main()':
a.cc:26:15: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
26 | cout << (a=='H'?b:(b=='H'?'D':'H')) << endl;
| ~^~~~~
| | |
| | char
| std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60,
from a.cc:1:
/usr/include/c++/14/bits/stl_pair.h:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1033 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1033:5: note: template argument deduction/substitution failed:
a.cc:26:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>'
26 | cout << (a=='H'?b:(b=='H'?'D':'H')) << endl;
| ^~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
441 | operator==(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:441:5: note: template argument deduction/substitution failed:
a.cc:26:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
26 | cout << (a=='H'?b:(b=='H'?'D':'H')) << endl;
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
486 | operator==(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:486:5: note: template argument deduction/substitution failed:
a.cc:26:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
26 | cout << (a=='H'?b:(b=='H'?'D':'H')) << endl;
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1667 | operator==(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1667:5: note: template argument deduction/substitution failed:
a.cc:26:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
26 | cout << (a=='H'?b:(b=='H'?'D':'H')) << endl;
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1737:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1737 | operator==(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1737:5: note: template argument deduction/substitution failed:
a.cc:26:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
26 | cout << (a=='H'?b:(b=='H'?'D':'H')) << endl;
| ^~~
In file included from /usr/include/c++/14/iosfwd:42,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:3:
/usr/include/c++/14/bits/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)'
192 | operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/postypes.h:192:5: note: template argument deduction/substitution failed:
a.cc:26:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>'
26 | cout << (a=='H'?b:(b=='H'?'D':'H')) << endl;
| ^~~
In file included from /usr/include/c++/14/string:43,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44:
/usr/include/c++/14/bits/allocator.h:235:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)'
235 | operator==(const allocator<_T1>&, const allocator<_T2>&)
| ^~~~~~~~
/usr/include/c++/14/bits/allocator.h:235:5: note: template argument deduction/substitution failed:
a.cc:26:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>'
26 | cout << (a=='H'?b:(b=='H'?'D':'H')) << endl;
| ^~~
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54:
/usr/include/c++/14/string_view:629:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
629 | operator==(basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:629:5: note: template argument deduction/substitution failed:
a.cc:26:17: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
26 | cout << (a=='H'?b:(b=='H'?'D':'H')) << endl;
| ^~~
/usr/include/c++/14/string_view:637:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
637 | operator==(basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:637:5: note: template argument deduction/substitution failed:
a.cc:26:17: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
26 | cout << (a=='H'?b:(b=='H'?'D':'H')) << endl;
| ^~~
/usr/include/c++/14/string_view:644:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)'
644 | operator==(__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:644:5: note: template argument deduction/substitution failed:
a.cc:26:17: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'char'
26 | cout << (a=='H'?b:(b=='H'?'D':'H')) << endl;
| ^~~
/usr/include/c++/14/bits/basic_string.h:3755:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3755 | operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3755:5: note: template argument deduction/substitution failed:
a.cc:26:17: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'char'
26 | cout << (a=='H'?b:(b=='H'?'D':'H')) << endl;
| ^~~
/usr/include/c++/14/bits/basic_string.h:3772:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
3772 | operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3772:5: note: template argument deduction/substitution failed:
a.cc:26:17: note: mismatched types 'const _CharT*' and 'char'
26 | cout << (a=='H'?b:(b=='H'?'D':'H')) << endl;
| ^~~
/usr/include/c++/14/bits/basic_string.h:3819:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3819 | operator==(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3819:5: note: template argument deduction/substitution failed:
a.cc:26:17: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>'
26 | cout << (a=='H'?b:(b=='H'?'D':'H')) << endl;
| ^~~
In file included from /usr/include/c++/14/bits/memory_resource.h:47,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/tuple:2558:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator==(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)'
2558 | operator==(const tuple<_TElements...>& __t,
| ^~~~~~~~
/usr/include/c++/14/tuple:2558:5: note: template argument deduction/substitution failed:
a.cc:26:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::tuple<_UTypes ...>'
26 | cout << (a=='H'?b:(b=='H'?'D':'H')) << endl;
| ^~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
from /usr/include/c++/14/bits/basic_ios.h:37,
from /usr/include/c++/14/ios:46:
/usr/include/c++/14/bits/streambuf_iterator.h:234:5: note: candidate: 'template<class _CharT, class _Traits> bool std::operator==(const istreambuf_iterator<_CharT, _Traits>&, const istreambuf_iterator<_CharT, _Traits>&)'
234 | operator==(const istreambuf_iterator<_CharT, _Traits>& __a,
| ^~~~~~~~
/usr/include/c++/14/bits/streambuf_iterator.h:234:5: note: template argument deduction/substitution failed:
a.cc:26:17: note: 'std::string' {aka 'std::__cxx11:: |
s771916416 | p03777 | C | #include <stdio.h>
#define HONEST 'H'
#define DISHONEST 'D'
#decine LIER(x) ((x==HONEST) ? (DISHONEST) : (HONEST))
int main(void) {
char a, b;
scanf("%c %c", &a, &b);
if (a == HONEST) {
printf("%c¥n", b);
} else {
printf("%c¥n", LIER(b));
}
return 0;
} | main.c:5:2: error: invalid preprocessing directive #decine; did you mean #define?
5 | #decine LIER(x) ((x==HONEST) ? (DISHONEST) : (HONEST))
| ^~~~~~
| define
main.c: In function 'main':
main.c:13:20: error: implicit declaration of function 'LIER' [-Wimplicit-function-declaration]
13 | printf("%c¥n", LIER(b));
| ^~~~
|
s713151300 | p03777 | C++ | #include<iostream>
using namespace std;
int main(){
char a,b;
std::cin>>a>>b;
if(a==b){
std::cout<<'H';
}else{
std::cout>>'D';
}
return 0;
} | a.cc: In function 'int main()':
a.cc:9:17: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'char')
9 | std::cout>>'D';
| ~~~~~~~~~^~~~~
| | |
| | char
| std::ostream {aka std::basic_ostream<char>}
a.cc:9:17: note: candidate: 'operator>>(int, int)' (built-in)
9 | std::cout>>'D';
| ~~~~~~~~~^~~~~
a.cc:9:17: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int'
In file included from /usr/include/c++/14/string:55,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
835 | operator>>(basic_istream<_CharT, _Traits>& __in,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed:
a.cc:9:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
9 | std::cout>>'D';
| ^~~
In file included from /usr/include/c++/14/bits/memory_resource.h:38,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)'
131 | operator>>(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed:
a.cc:9:13: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte'
9 | std::cout>>'D';
| ~~~~~^~~~
In file included from /usr/include/c++/14/istream:1109,
from /usr/include/c++/14/iostream:42:
/usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)'
978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c)
| ^~~~~~~~
/usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed:
a.cc:9:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
9 | std::cout>>'D';
| ^~~
/usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)'
849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed:
a.cc:9:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
9 | std::cout>>'D';
| ^~~
/usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)'
854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed:
a.cc:9:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
9 | std::cout>>'D';
| ^~~
/usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)'
896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed:
a.cc:9:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
9 | std::cout>>'D';
| ^~~
/usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)'
939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed:
a.cc:9:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
9 | std::cout>>'D';
| ^~~
/usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)'
945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed:
a.cc:9:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
9 | std::cout>>'D';
| ^~~
/usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
/usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = char]':
a.cc:9:19: required from here
9 | std::cout>>'D';
| ^~~
/usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
|
s505797810 | p03777 | C++ | #include <bits/stdc++.h>
#define MAX_N 1000100
using namespace std;
#define ll long long
#define ull unsigned long long
#define ii pair<int,int>
#define iii pair<ii, int>
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define ep emplace_back
#define sz(a) (int) a.size()
#define cl(a) a.clear()
#define vi vector<int>
#define vii vector<ii>
#define LOWBIT(x) ( (x) & -(x) )
#define FOR(x,a,b) for (int x=a;x<=b;x++)
#define FOD(x,a,b) for (int x=a;x>=b;x--)
#define REP(x,a,b) for (int x=a;x<b;x++)
#define RED(x,a,b) for (int x=a;x>b;x--)
const int MAX = 1e5 + 10;
const int MAXN = 1e4 + 10;
const int MOD = 1e9 + 7;
const int inf = 1e9;
const double pi = acos(-1.0);
const double eps = 1e-6;
int dx[] = {0 , -1 , 0 , 1};
int dy[] = {1 , 0 , -1 , 0};
int main()
{
//freopen("t.txt","r",stdin);
char a[100],b[100]; cin>>a>>b;
if (a[0]=='H'&&b[0]=='H') cout<<'H'
if (a[0]=='H'&&b[0]=='D') cout<<'D'
if (a[0]=='D'&&b[0]=='H') cout<<'D'
if (a[0]=='D'&&b[0]=='D') cout<<'H'
}
| a.cc: In function 'int main()':
a.cc:43:45: error: expected ';' before 'if'
43 | if (a[0]=='H'&&b[0]=='H') cout<<'H'
| ^
| ;
44 | if (a[0]=='H'&&b[0]=='D') cout<<'D'
| ~~
|
s126840065 | p03777 | C++ | #include<iostream>
using namespace std;
void main()
{
char a,b;
cin>>a;
cin>>b;
if(a=='H'&&b=='H')
cout<<"H";
if(a=='D'&&b=='H')
cout<<"D";
if(a=='D'&&b=='D')
cout<<"H";
return 0;
} | a.cc:3:1: error: '::main' must return 'int'
3 | void main()
| ^~~~
|
s411742265 | p03777 | C++ | #include<iostream>
using namespace std;
void main()
{
char a,b;
cin>>a;
cin>>b;
if(a=='H'&&b=='H')
cout<<"H";
if(a=='D'&&b=='H')
cout<<"D";
if(a=='D'&&b=='D')
cout<<"H";
} | a.cc:3:1: error: '::main' must return 'int'
3 | void main()
| ^~~~
|
s909816741 | p03777 | C++ | #include<iostream>
using namespace std;
void main()
{
char a,b;
cin>>a;
cin>>b;
if(a=='H'&&b=='H')
cout<<"H";
if(a=='D'&&b=='H')
cout<<"D";
if(a=='D&&b=='D')
cout<<"H";
} | a.cc:12:7: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes
12 | if(a=='D&&b=='D')
| ^~~~~~~~~
a.cc:12:16: warning: missing terminating ' character
12 | if(a=='D&&b=='D')
| ^
a.cc:12:16: error: missing terminating ' character
12 | if(a=='D&&b=='D')
| ^~
a.cc:3:1: error: '::main' must return 'int'
3 | void main()
| ^~~~
a.cc: In function 'int main()':
a.cc:12:7: error: unable to find character literal operator 'operator""D' with 'int' argument
12 | if(a=='D&&b=='D')
| ^~~~~~~~~
a.cc:14:1: error: expected primary-expression before '}' token
14 | }
| ^
a.cc:13:11: error: expected ')' before '}' token
13 | cout<<"H";
| ^
| )
14 | }
| ~
a.cc:12:3: note: to match this '('
12 | if(a=='D&&b=='D')
| ^
a.cc:14:1: error: expected primary-expression before '}' token
14 | }
| ^
|
s193277392 | p03777 | C++ | #include<iostream>
using namespace std;
void main()
{
char a,b;
cin>>a;
cin>>b;
if(a=='H'&b=='H')
cout<<"H";
if(a=='D'&b=='H')
cout<<"D";
if(a=='D&b=='D')
cout<<"H";
} | a.cc:12:7: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes
12 | if(a=='D&b=='D')
| ^~~~~~~~
a.cc:12:15: warning: missing terminating ' character
12 | if(a=='D&b=='D')
| ^
a.cc:12:15: error: missing terminating ' character
12 | if(a=='D&b=='D')
| ^~
a.cc:3:1: error: '::main' must return 'int'
3 | void main()
| ^~~~
a.cc: In function 'int main()':
a.cc:12:7: error: unable to find character literal operator 'operator""D' with 'int' argument
12 | if(a=='D&b=='D')
| ^~~~~~~~
a.cc:14:1: error: expected primary-expression before '}' token
14 | }
| ^
a.cc:13:11: error: expected ')' before '}' token
13 | cout<<"H";
| ^
| )
14 | }
| ~
a.cc:12:3: note: to match this '('
12 | if(a=='D&b=='D')
| ^
a.cc:14:1: error: expected primary-expression before '}' token
14 | }
| ^
|
s480163015 | p03777 | C++ | #include <stdio.h>
#include <stdlib.h>
int main()
{
char a,b;
scanf("%c%c",&a,&b);
{
if(a==H&&b==H)
printf("H\n");
if(a==H&&b==D)
printf("D\n");
if(a==D&&b==H)
printf("D\n");
if(a==D&&b==D)
printf("H\n");
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:9:15: error: 'H' was not declared in this scope
9 | if(a==H&&b==H)
| ^
a.cc:11:15: error: 'H' was not declared in this scope
11 | if(a==H&&b==D)
| ^
a.cc:11:21: error: 'D' was not declared in this scope
11 | if(a==H&&b==D)
| ^
a.cc:13:15: error: 'D' was not declared in this scope
13 | if(a==D&&b==H)
| ^
a.cc:13:21: error: 'H' was not declared in this scope
13 | if(a==D&&b==H)
| ^
a.cc:15:15: error: 'D' was not declared in this scope
15 | if(a==D&&b==D)
| ^
|
s800100129 | p03777 | C++ | #include <bits/stdc++.h>
using std;
int main()
{
char a, b;
cin >> a >> b;
cout << a == b ? 'H' : 'D' << endl;
} | a.cc:2:7: error: expected nested-name-specifier before 'std'
2 | using std;
| ^~~
a.cc: In function 'int main()':
a.cc:7:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
7 | cin >> a >> b;
| ^~~
| std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:8:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
8 | cout << a == b ? 'H' : 'D' << endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:8:35: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
8 | cout << a == b ? 'H' : 'D' << endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s816082123 | p03777 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int N, K;
cin >> N >> K;
vector<int> nums(N, 0);
for (int i = 0; i < N; i++)
cin >> nums[i];
sort(nums.begin(), nums.end());
int res = 0;
int case_num = pow(2, N);
for (int i = 0; i < N; i++){
int add = pow(2, i);
int is_need = 0;
int has = 0;
for (int j = 0; j < case_num; j++){
if (((j >> i) & 1) == 0) {
continue;
}
int sum = 0;
for (int k = 0; k < 32; k++) {
if (((j >> k) & 1) == 1) {
sum += nums[k];
}
}
if (sum >= K) {
has = 1;
if (sum - nums[i] < K){
is_need = 1;
}
}
if (is_need == 1) {
break;
}
}
if (has == 1 && is_need == 0) {
res++;
}
}
cout << res << endl;
} | a.cc: In function 'int main()':
a.cc:14:24: error: 'pow' was not declared in this scope
14 | int case_num = pow(2, N);
| ^~~
|
s504585587 | p03777 | C++ | #include<iostream>
using namespace std;
#define loop(i,a,b) for(int i=a;i<(int)b;i++)
int main()
{
char ch1,ch3,ch4.ch2;
ch3='H';
ch4='D';
cin>>ch1>>ch2;
if(ch1=='H' && ch2=='H')
cout<<ch3;
else
{
if(ch1=='H' && ch2=='D')
cout<<ch4;
else
{
if(ch1=='D' && ch2=='H')
cout<<ch4;
else
{
if(ch1=='D' && ch2=='D')
cout<<ch3;
}
}
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:6:21: error: expected initializer before '.' token
6 | char ch1,ch3,ch4.ch2;
| ^
a.cc:8:5: error: 'ch4' was not declared in this scope; did you mean 'ch3'?
8 | ch4='D';
| ^~~
| ch3
a.cc:9:15: error: 'ch2' was not declared in this scope; did you mean 'ch3'?
9 | cin>>ch1>>ch2;
| ^~~
| ch3
|
s352221766 | p03777 | C++ | #include <bits/stdc++.h>
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define SORTR(v,n) sort(v, v+n, greater<int>());
// #define int long long
#define pb push_back
#define INF 100000000
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, pii> piii;
typedef pair<ll, pll> plll;
char c;
char s;
signed main(){
scanf("%c", c);
scanf("%c", s);
if(c == 'H'){
if(s == 'H'){
printf("H\n");
}else if(s == 'D'){
printf("D\n");
}
}else if(c == 'D'){
if(s == 'H'){
printf("D\n");
}else if(s == 'D'){
printf("H\n");
}
return 0;
} | a.cc: In function 'int main()':
a.cc:44:2: error: expected '}' at end of input
44 | }
| ^
a.cc:22:14: note: to match this '{'
22 | signed main(){
| ^
|
s408233548 | p03777 | C++ | #include <bits/stdc++.h>
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define SORTR(v,n) sort(v, v+n, greater<int>());
// #define int long long
#define pb push_back
#define INF 100000000
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, pii> piii;
typedef pair<ll, pll> plll;
char c;
char s;
signed main(){
scanf("%c", c);
scanf("%c", s);
if(c == 'H'){
if(s == 'H'){
printf("H\n");
}else if(s == 'D'){
printf("D\n");
}
}else if(c == 'D'){
if(s == 'H'){
printf("D\n");
}else if(s == 'D'){
printf("H\n");
}
return 0;
} | a.cc: In function 'int main()':
a.cc:43:2: error: expected '}' at end of input
43 | }
| ^
a.cc:22:14: note: to match this '{'
22 | signed main(){
| ^
|
s407066405 | p03777 | C | #include<stdio.h>
int main()
{
char act[1],top[1];
scanf("%1s %1s",act,top);
if (strcmp(act,top)==0){
printf("H\n");}else{
printf("D\n");}
return 0;
} | main.c:2:1: error: stray '\302' in program
2 | <U+00A0>
| ^~~~~~~~
main.c: In function 'main':
main.c:7:13: error: implicit declaration of function 'strcmp' [-Wimplicit-function-declaration]
7 | if (strcmp(act,top)==0){
| ^~~~~~
main.c:2:1: note: include '<string.h>' or provide a declaration of 'strcmp'
1 | #include<stdio.h>
+++ |+#include <string.h>
2 |
|
s125098833 | p03777 | C++ | #include<stdio.h>
int main()
{
char act[1],top[1];
scanf("%1s %1s",act,top);
if (strcmp(act,top)==0){
printf("H\n");}else{
printf("D\n");}
return 0;
} | a.cc:2:1: error: extended character is not valid in an identifier
2 |
| ^
a.cc:2:1: error: '\U000000a0' does not name a type
2 |
| ^
|
s460680842 | p03777 | C++ |
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
double a,b,H,D;
cin >> a >> b >> ;
if(a == H && b == H)
{
cout << "H" << endl;
}
else if(a == H && b == D)
{
cout << "D" << endl;
}
else if (a == D && b == H)
{
cout << "D" << endl;
}
else if(a == D && b == D)
{
cout << "H" << endl;
}
} | a.cc: In function 'int main()':
a.cc:8:31: error: expected primary-expression before ';' token
8 | cin >> a >> b >> ;
| ^
|
s995576945 | p03777 | C | #include<stdio.h>
int main(void)
{
char a,b;
scanf("%c",&a);
scanf("%c",&b)
if(a='H'){
if(b='H')printf("H");
else printf("D");}
else{
if(b='H')printf("D");
else printf("H");}
return 0;
} | main.c: In function 'main':
main.c:6:15: error: expected ';' before 'if'
6 | scanf("%c",&b)
| ^
| ;
7 | if(a='H'){
| ~~
|
s717999523 | p03777 | C++ | #include <string.h>
int W, a, b;
void solve() {
int ans;
if (a < b) {
if ((b - (a + W)) < 0) {
ans = 0;
}
else {
ans = b - (a + W);
}
}
else {
if ((a - (b + W)) < 0) {
ans = 0;
}
else {
ans = a - (b + W);
}
}
printf("%d\n", ans);
}
int main()
{
// 標準入力から入力
scanf("%d %d %d", &W, &a, &b);
solve();
return 0;
}
| a.cc: In function 'void solve()':
a.cc:21:9: error: 'printf' was not declared in this scope
21 | printf("%d\n", ans);
| ^~~~~~
a.cc:2:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
1 | #include <string.h>
+++ |+#include <cstdio>
2 | int W, a, b;
a.cc: In function 'int main()':
a.cc:27:9: error: 'scanf' was not declared in this scope
27 | scanf("%d %d %d", &W, &a, &b);
| ^~~~~
|
s227876318 | p03777 | C++ | #include <string.h>
int W, a, b;
void solve() {
int ans;
if (a < b) {
if ((b - (a + W)) < 0) {
ans = 0;
}
else {
ans = b - (a + W);
}
}
else {
if ((a - (b + W)) < 0) {
ans = 0;
}
else {
ans = a - (b + W);
}
}
printf("%d\n", ans);
}
int main()
{
// 標準入力から入力
scanf_s("%d %d %d", &W, &a, &b);
solve();
return 0;
} | a.cc: In function 'void solve()':
a.cc:21:9: error: 'printf' was not declared in this scope
21 | printf("%d\n", ans);
| ^~~~~~
a.cc:2:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
1 | #include <string.h>
+++ |+#include <cstdio>
2 | int W, a, b;
a.cc: In function 'int main()':
a.cc:27:9: error: 'scanf_s' was not declared in this scope
27 | scanf_s("%d %d %d", &W, &a, &b);
| ^~~~~~~
|
s063133059 | p03777 | C++ | #include <iostream>
using namespace std;
int main()
{
int a,b;
cin >> a >> b;
if (a==H)
if(b==H) {
cout << "H" << endl;
}
else {
cout << "D" << endl;
}
else if (b==H) {
cout << "D" << endl;
}
else {
cout << "H" << endl;
}
} | a.cc: In function 'int main()':
a.cc:7:8: error: 'H' was not declared in this scope
7 | if (a==H)
| ^
|
s156156457 | p03777 | C++ | #include <iostream>
using namespace std;
int main()
{
int a,b;
cin >> a >> b;
if (a==H)
if(b==H) {
cout "H" << endl;
}
else {
cout "D" << endl;
}
else if (b==H) {
cout "D" << endl;
}
else {
cout "H" << endl;
}
} | a.cc: In function 'int main()':
a.cc:7:8: error: 'H' was not declared in this scope
7 | if (a==H)
| ^
a.cc:9:33: error: expected ';' before string constant
9 | cout "H" << endl;
| ^ ~~~
| ;
a.cc:12:33: error: expected ';' before string constant
12 | cout "D" << endl;
| ^ ~~~
| ;
a.cc:15:33: error: expected ';' before string constant
15 | cout "D" << endl;
| ^ ~~~
| ;
a.cc:18:33: error: expected ';' before string constant
18 | cout "H" << endl;
| ^ ~~~
| ;
|
s120074998 | p03777 | C | #include <stdio.h>
int main(void)
{
int a.b;
printf ("A.Bは正直者?嘘つき?");
scanf ("%d",&a,&b);
if (a=H,b=H)
printf ("H");
else if (a=D,b=H)
printf ("D");
else if (a=H,b=D)
printf ("D");
else if (a=D,b=D)
printf ("H");
return 0;
} | main.c: In function 'main':
main.c:5:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
5 | int a.b;
| ^
main.c:5:13: error: expected expression before '.' token
main.c:7:21: error: 'a' undeclared (first use in this function)
7 | scanf ("%d",&a,&b);
| ^
main.c:7:21: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:24: error: 'b' undeclared (first use in this function)
7 | scanf ("%d",&a,&b);
| ^
main.c:9:14: error: 'H' undeclared (first use in this function)
9 | if (a=H,b=H)
| ^
main.c:11:19: error: 'D' undeclared (first use in this function)
11 | else if (a=D,b=H)
| ^
|
s106079388 | p03777 | C++ | #include<stdio.h>
int main()
{
char act[1],top[1];
scanf("%1s %1s",act,top);
if(strcmp(act,top)==0){
printf("H¥n");}else{
printf("D¥n");};
return0;
} | a.cc: In function 'int main()':
a.cc:7:5: error: 'strcmp' was not declared in this scope
7 | if(strcmp(act,top)==0){
| ^~~~~~
a.cc:2:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include<stdio.h>
+++ |+#include <cstring>
2 |
a.cc:10:1: error: 'return0' was not declared in this scope
10 | return0;
| ^~~~~~~
|
s392906660 | p03777 | C++ |
#include <iostream>
using namespace std;
int main()
{
int a,b;
cin >> a >> b;
if (a = H)
if(b=H) {
cout "H" << endl;
}
else {
cout "D" << endl;
}
else if (b=H) {
cout "D" << endl;
}
else {
cout "H" << endl;
}
} | a.cc: In function 'int main()':
a.cc:8:9: error: 'H' was not declared in this scope
8 | if (a = H)
| ^
a.cc:10:33: error: expected ';' before string constant
10 | cout "H" << endl;
| ^ ~~~
| ;
a.cc:13:33: error: expected ';' before string constant
13 | cout "D" << endl;
| ^ ~~~
| ;
a.cc:16:33: error: expected ';' before string constant
16 | cout "D" << endl;
| ^ ~~~
| ;
a.cc:19:33: error: expected ';' before string constant
19 | cout "H" << endl;
| ^ ~~~
| ;
|
s301964663 | p03777 | C++ | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
char a = sc.next().charAt(0);
char b = sc.next().charAt(0);
if( (a=='H'&&b=='H')||(a=='D'&&b=='D') ){
System.out.println("H");
}else{
System.out.println("D");
}
return;
}
} | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
3 | public class Main{
| ^~~~~~
|
s098411433 | p03777 | C | #include <stdio.h>
int main(void)
{
int a.b;
printf ("A.Bは正直者?嘘つき?");
scanf ("%d",&a,&b);
if (a=H,b=H)
printf ("H");
else if (a=D,b=H)
printf ("D");
else if (a=H,b=D)
printf ("D");
else if (a=D,b=D)
printf ("H")
return 0;
} | main.c: In function 'main':
main.c:5:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
5 | int a.b;
| ^
main.c:5:13: error: expected expression before '.' token
main.c:7:21: error: 'a' undeclared (first use in this function)
7 | scanf ("%d",&a,&b);
| ^
main.c:7:21: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:24: error: 'b' undeclared (first use in this function)
7 | scanf ("%d",&a,&b);
| ^
main.c:9:14: error: 'H' undeclared (first use in this function)
9 | if (a=H,b=H)
| ^
main.c:11:19: error: 'D' undeclared (first use in this function)
11 | else if (a=D,b=H)
| ^
main.c:16:22: error: expected ';' before 'return'
16 | printf ("H")
| ^
| ;
17 |
18 | return 0;
| ~~~~~~
|
s944014649 | p03777 | C | #include "stdafx.h"
void solve(char a, char b) {
char ans;
if (a == 'H') {
ans = b;
}
else if (b == 'H'){
ans = 'D';
}
else {
ans = 'H';
}
printf("%c", ans);
}
int main()
{
char a, b;
scanf("%c %c", &a, &b);
solve(a, b);
return 0;
}
| main.c:1:10: fatal error: stdafx.h: No such file or directory
1 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s457876687 | p03777 | C++ | #include "stdafx.h"
void solve(char a, char b) {
char ans;
if (a == 'H') {
ans = b;
}
else if (b == 'H'){
ans = 'D';
}
else {
ans = 'H';
}
printf("%c", ans);
}
int main()
{
char a, b;
scanf("%c %c", &a, &b);
solve(a, b);
return 0;
}
| a.cc:1:10: fatal error: stdafx.h: No such file or directory
1 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s645594048 | p03777 | C++ | #pragma once
#include <stdio.h>
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
using namespace std;
string S[2],H,D;
int main() {
H = "H";
D = "D";
cin >> S[0];
cin >> S[1];
if (S[0]==H) {
if (S[1] == H) {
cout << H.c_str << endl;
}
else {
cout << D.c_str << endl;
}
}
else {
if (S[1] == H) {
cout << D.c_str << endl;
}
else {
cout << H.c_str << endl;
}
}
return 0;
}
| a.cc:1:9: warning: #pragma once in main file
1 | #pragma once
| ^~~~
a.cc: In function 'int main()':
a.cc:23:30: error: invalid use of non-static member function 'const _CharT* std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::c_str() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
23 | cout << H.c_str << endl;
| ~~~~~^~~~~~~~~~
In file included from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:4:
/usr/include/c++/14/bits/basic_string.h:2640:7: note: declared here
2640 | c_str() const _GLIBCXX_NOEXCEPT
| ^~~~~
a.cc:26:30: error: invalid use of non-static member function 'const _CharT* std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::c_str() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
26 | cout << D.c_str << endl;
| ~~~~~^~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:2640:7: note: declared here
2640 | c_str() const _GLIBCXX_NOEXCEPT
| ^~~~~
a.cc:31:30: error: invalid use of non-static member function 'const _CharT* std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::c_str() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
31 | cout << D.c_str << endl;
| ~~~~~^~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:2640:7: note: declared here
2640 | c_str() const _GLIBCXX_NOEXCEPT
| ^~~~~
a.cc:34:30: error: invalid use of non-static member function 'const _CharT* std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::c_str() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
34 | cout << H.c_str << endl;
| ~~~~~^~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:2640:7: note: declared here
2640 | c_str() const _GLIBCXX_NOEXCEPT
| ^~~~~
|
s836917432 | p03777 | C++ | #include <stdio.h>
int main()
{
int a,b,H,D;
scanf("a,b",&no);
if (a = H)
if(b=H)
puts("H");
else
puts("D");
else if (b=H)
puts("D");
else
puts("H");
} | a.cc: In function 'int main()':
a.cc:6:14: error: 'no' was not declared in this scope
6 | scanf("a,b",&no);
| ^~
|
s322366532 | p03777 | C++ | a, b = input().split()
if a == "H":
print(b)
if a == "D":
if b == "H":
print("D")
else:
print("H")
| a.cc:1:1: error: 'a' does not name a type
1 | a, b = input().split()
| ^
|
s247777156 | p03777 | Java | import java.util.Scanner;
public class HonestOrDishonest {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int a = s.next().equals("H") ? 0 : 1;
int b = s.next().equals("H") ? 0 : 1;
if (a + b == 1) {
System.out.println("D");
} else {
System.out.println("H");
}
}
} | Main.java:3: error: class HonestOrDishonest is public, should be declared in a file named HonestOrDishonest.java
public class HonestOrDishonest {
^
1 error
|
s050823490 | p03777 | C++ | nclude <iostream>
#include <string.h>
using namespace std;
int main(){
char a,b;
scanf("%c %c",&a,&b);
//cout << a << b << endl;
if (a == b){
cout << "H" << endl;
}
else{
cout << "D" << endl;
}
return 0;
}
| a.cc:1:1: error: 'nclude' does not name a type
1 | nclude <iostream>
| ^~~~~~
a.cc: In function 'int main()':
a.cc:8:3: error: 'scanf' was not declared in this scope
8 | scanf("%c %c",&a,&b);
| ^~~~~
a.cc:12:5: error: 'cout' was not declared in this scope
12 | cout << "H" << endl;
| ^~~~
a.cc:3:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
2 | #include <string.h>
+++ |+#include <iostream>
3 |
a.cc:12:20: error: 'endl' was not declared in this scope
12 | cout << "H" << endl;
| ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
2 | #include <string.h>
+++ |+#include <ostream>
3 |
a.cc:15:5: error: 'cout' was not declared in this scope
15 | cout << "D" << endl;
| ^~~~
a.cc:15:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:15:20: error: 'endl' was not declared in this scope
15 | cout << "D" << endl;
| ^~~~
a.cc:15:20: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
|
s834262519 | p03777 | C++ | using System;
namespace A_HonestOrDishonest {
class Program {
static void Main(string[] args) {
// スペース区切りの整数の入力
string[] input = Console.ReadLine().Split(' ');
string a = input[0];
string b = input[1];
string ans = (a == "H" && b == "H") || (a == "D" && b == "D")? "H": "D";
Console.WriteLine(ans);
}
}
}
| a.cc:1:7: error: expected nested-name-specifier before 'System'
1 | using System;
| ^~~~~~
a.cc:5:26: error: 'string' has not been declared
5 | static void Main(string[] args) {
| ^~~~~~
a.cc:5:35: error: expected ',' or '...' before 'args'
5 | static void Main(string[] args) {
| ^~~~
a.cc:13:6: error: expected ';' after class definition
13 | }
| ^
| ;
a.cc: In static member function 'static void A_HonestOrDishonest::Program::Main(int*)':
a.cc:7:13: error: 'string' was not declared in this scope
7 | string[] input = Console.ReadLine().Split(' ');
| ^~~~~~
a.cc:7:20: error: expected primary-expression before ']' token
7 | string[] input = Console.ReadLine().Split(' ');
| ^
a.cc:8:20: error: expected ';' before 'a'
8 | string a = input[0];
| ^
a.cc:9:20: error: expected ';' before 'b'
9 | string b = input[1];
| ^
a.cc:10:20: error: expected ';' before 'ans'
10 | string ans = (a == "H" && b == "H") || (a == "D" && b == "D")? "H": "D";
| ^~~
a.cc:11:13: error: 'Console' was not declared in this scope
11 | Console.WriteLine(ans);
| ^~~~~~~
a.cc:11:31: error: 'ans' was not declared in this scope
11 | Console.WriteLine(ans);
| ^~~
|
s647348625 | p03777 | C++ | #include<iostream>
using namespace std;
int main(){
char a,b;
std::cin>>a>>b;
if(a==b){
std::cout<<H;
}else{
std::cout<<D;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:7:20: error: 'H' was not declared in this scope
7 | std::cout<<H;
| ^
a.cc:9:15: error: 'D' was not declared in this scope
9 | std::cout<<D;
| ^
|
s301174968 | p03777 | C++ | if (a = H)
if(b=H)
puts("H");
else
puts("D");
else if (b=H)
puts("D");
else
puts("H"); | a.cc:1:1: error: expected unqualified-id before 'if'
1 | if (a = H)
| ^~
a.cc:4:9: error: expected unqualified-id before 'else'
4 | else
| ^~~~
a.cc:6:1: error: expected unqualified-id before 'else'
6 | else if (b=H)
| ^~~~
a.cc:8:9: error: expected unqualified-id before 'else'
8 | else
| ^~~~
|
s298818234 | p03777 | C++ | #include <iostream>
#include <cstdlib>
int main()
{
int w, a, b;
std::cin >> w;
std::cin >> a;
std::cin >> b;
if(w > abs(a - b){
std::cout << abs(b - a - w)) << std::endl;
}
else{
std::cout << 0 << std::endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:11:23: error: expected ';' before '{' token
11 | if(w > abs(a - b){
| ^
| ;
a.cc:14:6: error: expected primary-expression before 'else'
14 | else{
| ^~~~
a.cc:13:7: error: expected ')' before 'else'
13 | }
| ^
| )
14 | else{
| ~~~~
a.cc:11:8: note: to match this '('
11 | if(w > abs(a - b){
| ^
|
s015575968 | p03777 | C++ | #include <iostream>
#include <string>
using namespace std;
void main() {
string a, b;
cin >> a >> b;
if ((a == "H"&&b == "H") || (a == "D"&&b == "D")) {
cout << "H" << endl;
}
else {
cout << "D" << endl;
}
} | a.cc:7:1: error: '::main' must return 'int'
7 | void main() {
| ^~~~
|
s799072369 | p03777 | C++ | #include <iostream>
#include <cmath>
#include<cstdio>
#include<cstring>
using namespace std;
int main()
{
char str[5],r;
while(gets(str)!=NULL)
{
if(str[0]=='H')
{
if(str[2]=='H')
r='H';
else
r='D';
}
else
{
if(str[2]=='H')
r='D';
else
r='H';
}
printf("%c\n",r);
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:10:11: error: 'gets' was not declared in this scope; did you mean 'getw'?
10 | while(gets(str)!=NULL)
| ^~~~
| getw
|
s310282471 | p03777 | C++ | #include <iostream>
using namespace std;
int main()
{
char a,b;
cin >> a >>b;
bool boola = a == 'H';
bool boolb = b == 'H';
bool result = false;
if(a && b) result = true;
else if (a || b) result = false;
else result = true;
if(result)
{
return 'H';
}
else
{
return 'D';
}
}
if(result)
{
return 'H';
}
else
{
return 'D';
}
} | a.cc:27:5: error: expected unqualified-id before 'if'
27 | if(result)
| ^~
a.cc:31:5: error: expected unqualified-id before 'else'
31 | else
| ^~~~
a.cc:35:1: error: expected declaration before '}' token
35 | }
| ^
|
s976697587 | p03777 | C++ | #include <iostream>
#include <cstdio>
#include <stdio.h>
using namespace std;
int main()
{
char a[3];
gets(a);
if(a[0]=='H')
{
if(a[2]=='H') cout<<'H'<<endl;
else cout<<'D'<<endl;
}
else if(a[0]=='D')
{
if(a[2]=='H') cout<<'D'<<endl;
else cout<<'H'<<endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:10:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
10 | gets(a);
| ^~~~
| getw
|
s012936600 | p03777 | C++ | #include <iostream>
#include <string>
using namespace std;
string han(string A){
if(A == "H"){
return D;
}
else return H;
}
int main(){
string A, B;
cin >> A >> B;
if (A == "H") cout << B << endl;
else cout << han(B) << endl;
return 0;
} | a.cc: In function 'std::string han(std::string)':
a.cc:7:24: error: 'D' was not declared in this scope
7 | return D;
| ^
a.cc:9:21: error: 'H' was not declared in this scope
9 | else return H;
| ^
|
s785544464 | p03777 | C++ | #include <iostream>
#include <cstdio>
using namespace std;
int main()
{
char a[3];
gets(a);
if(a[0]=='H')
{
if(a[2]=='H') cout<<'H'<<endl;
else cout<<'D'<<endl;
}
else if(a[0]=='D')
{
if(a[2]=='H') cout<<'D'<<endl;
else cout<<'H'<<endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:9:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
9 | gets(a);
| ^~~~
| getw
|
s127697617 | p03777 | C++ | #include <bits/stdc++.h> .h>
using namespace std;
#define ll long long
ll n,m;
int main()
{
cin>>n;
for(ll i=1;;i++)
{
m+=i;
if(m>=n)
{
break;
}
}
cout<<min(i,n)<<endl;
return 0;
} | a.cc:1:3781: warning: extra tokens at end of #include directive
1 | #include <bits/stdc++.h> .h>
| ^
a.cc: In function 'int main()':
a.cc:17:15: error: 'i' was not declared in this scope
17 | }
| ^
|
s506241511 | p03777 | C++ |
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
char a,b;
cin>>a>>b;
int ans = 1;
if (!strcmp(&b, "H")) ans = 1; else ans = -1;
if (!strcmp(&a, "H")) ans *= 1; else ans *= -1;
if (ans > 0) cout<<"H"<<endl; else cout<<"D"<<endl;
}
| a.cc: In function 'int main()':
a.cc:13:10: error: 'strcmp' was not declared in this scope
13 | if (!strcmp(&b, "H")) ans = 1; else ans = -1;
| ^~~~~~
a.cc:6:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
5 | #include <algorithm>
+++ |+#include <cstring>
6 |
a.cc:14:10: error: 'strcmp' was not declared in this scope
14 | if (!strcmp(&a, "H")) ans *= 1; else ans *= -1;
| ^~~~~~
a.cc:14:10: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
|
s619715886 | p03777 | C++ | #include<stdio.h>
int main()
{
char a[2];
while(gets(a)!=NULL)
{
if(a[0]=='H')
printf("%c\n",a[1]);
else {
if(a[1]=='H')
printf("D\n");
else printf("H\n");
}
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:5:11: error: 'gets' was not declared in this scope; did you mean 'getw'?
5 | while(gets(a)!=NULL)
| ^~~~
| getw
|
s019254163 | p03777 | C++ | #include <iostream>
int main() {
char a,b;
scanf("%c%c",&a,&b);
if((a=='H' && b=='H') || (a=='D' && b=='D'){
printf("H");
}
else{
printf("D");
}
return 0;
} | a.cc: In function 'int main()':
a.cc:7:48: error: expected ';' before '{' token
7 | if((a=='H' && b=='H') || (a=='D' && b=='D'){
| ^
| ;
a.cc:10:5: error: expected primary-expression before 'else'
10 | else{
| ^~~~
a.cc:9:6: error: expected ')' before 'else'
9 | }
| ^
| )
10 | else{
| ~~~~
a.cc:7:7: note: to match this '('
7 | if((a=='H' && b=='H') || (a=='D' && b=='D'){
| ^
|
s133483230 | p03777 | C++ |
if a =="H":
if b=="H":
return "H"
else:
return "D"
else:
if b=="H":
return "D"
else:
return "H" | a.cc:2:9: error: expected unqualified-id before 'if'
2 | if a =="H":
| ^~
|
s750799326 | p03777 | Java | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
char a = sc.next();
char b = sc.next();
if (a == 'H') {
if (b == 'H') {
System.out.println("H");
} else {
System.out.println("D");
}
} else {
if (b == 'H') {
System.out.println("D");
} else {
System.out.println("H");
}
}
}
} | Main.java:7: error: incompatible types: String cannot be converted to char
char a = sc.next();
^
Main.java:8: error: incompatible types: String cannot be converted to char
char b = sc.next();
^
2 errors
|
s505548124 | p03777 | C++ | a, b = map(str, raw_input().split())
result = ''
if a == ‘H’:
if b== ‘H’:
result = ‘H’
else:
result = ‘D’
else:
if b==‘H’
result=‘D’
else:
result=‘H'
print result | a.cc:2:10: error: empty character constant
2 | result = ''
| ^~
a.cc:3:9: error: extended character ‘ is not valid in an identifier
3 | if a == ‘H’:
| ^
a.cc:3:9: error: extended character ’ is not valid in an identifier
a.cc:4:16: error: extended character ‘ is not valid in an identifier
4 | if b== ‘H’:
| ^
a.cc:4:16: error: extended character ’ is not valid in an identifier
a.cc:5:26: error: extended character ‘ is not valid in an identifier
5 | result = ‘H’
| ^
a.cc:5:26: error: extended character ’ is not valid in an identifier
a.cc:7:26: error: extended character ‘ is not valid in an identifier
7 | result = ‘D’
| ^
a.cc:7:26: error: extended character ’ is not valid in an identifier
a.cc:9:15: error: extended character ‘ is not valid in an identifier
9 | if b==‘H’
| ^
a.cc:9:15: error: extended character ’ is not valid in an identifier
a.cc:10:24: error: extended character ‘ is not valid in an identifier
10 | result=‘D’
| ^
a.cc:10:24: error: extended character ’ is not valid in an identifier
a.cc:12:24: error: extended character ‘ is not valid in an identifier
12 | result=‘H'
| ^
a.cc:12:26: warning: missing terminating ' character
12 | result=‘H'
| ^
a.cc:12:26: error: missing terminating ' character
a.cc:1:1: error: 'a' does not name a type
1 | a, b = map(str, raw_input().split())
| ^
|
s279245619 | p03777 | C++ | #include <cstdio>
using namespace std;
int main(){
char a=getchar(),b=getchar(),getchar();
putchar(a==b?'H’:'D');
} | a.cc:5:20: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes
5 | putchar(a==b?'H’:'D');
| ^~~~~~
a.cc:5:26: warning: missing terminating ' character
5 | putchar(a==b?'H’:'D');
| ^
a.cc:5:26: error: missing terminating ' character
5 | putchar(a==b?'H’:'D');
| ^~~
a.cc: In function 'int main()':
a.cc:4:43: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
4 | char a=getchar(),b=getchar(),getchar();
| ^~
a.cc:4:43: note: remove parentheses to default-initialize a variable
4 | char a=getchar(),b=getchar(),getchar();
| ^~
| --
a.cc:4:43: note: or replace parentheses with braces to value-initialize a variable
a.cc: At global scope:
a.cc:4:36: error: ambiguating new declaration of 'char getchar()'
4 | char a=getchar(),b=getchar(),getchar();
| ^~~~~~~
In file included from /usr/include/c++/14/cstdio:42,
from a.cc:1:
/usr/include/stdio.h:582:12: note: old declaration 'int getchar()'
582 | extern int getchar (void);
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:5:20: error: unable to find character literal operator 'operator""D' with 'int' argument
5 | putchar(a==b?'H’:'D');
| ^~~~~~
a.cc:5:26: error: expected ':' before '}' token
5 | putchar(a==b?'H’:'D');
| ^
| :
6 | }
| ~
a.cc:6:1: error: expected primary-expression before '}' token
6 | }
| ^
|
s978723839 | p03778 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> iint;
typedef pair<ll,ll> llll;
#define ALL(x) (x).begin(),(x).end()
const ll zero = 0;
const ll one = 1;
const ll INF = 9223372036854775807; //10^18
const int inINF = 2147483647; //10^9
const ll MOD = 1000000007; //10^9+7
const ll MOD2 = 998244353;
void Yes() {printf("Yes\n");}
void No() {printf("No\n");}
void YES() {printf("YES\n");}
void NO() {printf("NO\n");}
int main(){
int w, a, b;
cin >> w >> a >> b;
printf("%d\n", max(0, b-a-w+1, a-b-w+1));
} | In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:22:23: required from here
22 | printf("%d\n", max(0, b-a-w+1, a-b-w+1));
| ~~~^~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:306:17: error: '__comp' cannot be used as a function
306 | if (__comp(__a, __b))
| ~~~~~~^~~~~~~~~~
|
s506136958 | p03778 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int W; int A; int B;
cin>>W>>A>>B;
int L=max(A,B)
int R=min(A+W,B+W);
if(R-L>=0)
cout<<R-L<<endl;
else cout<<0<<endl;
} | a.cc: In function 'int main()':
a.cc:7:3: error: expected ',' or ';' before 'int'
7 | int R=min(A+W,B+W);
| ^~~
a.cc:8:6: error: 'R' was not declared in this scope
8 | if(R-L>=0)
| ^
|
s740468197 | p03778 | C++ | #include <bits/stdc++.h>
using namespace std;
#define inf 1072114514
#define llinf 4154118101919364364
#define mod 1000000007
#define pi 3.1415926535897932384
int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;} //最大公約数
int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;} //最小公倍数
int nCr(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;} //コンビネーション
int nHr(int a,int b){return nCr(a+b-1,b);} // 重複組み合わせ
int fact(int a){int i,r=1;for(i=1;i<=a;i++){r*=i;}return r;} //階乗
int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} // a~bまでの階乗
int dsum(int x){int r=0;while(x){r+=(x%10);x/=10;}return r;} //数字の各位の和
int dsumb(int x,int b){int r=0;while(x){r+=(x%b);x/=b;}return r;} // b進数の各位の和?
int sankaku(int x){return ((1+x)*x)/2;} //三角数 xまでの和
//以下long long ver
long long llmax(long long a,long long b){if(a>b){return a;}return b;}
long long llmin(long long a,long long b){if(a<b){return a;}return b;}
long long llzt(long long a,long long b){return llmax(a,b)-llmin(a,b);}
long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
long long llceil(long long a,long long b){if(a%b==0){return a/b;}return (a/b)+1;}
long long llgcd(long long a,long long b){long long c;while(b!=0){c=a%b;a=b;b=c;}return a;}
long long lllcm(long long a,long long b){long long c=llgcd(a,b);a/=c;return a*b;}
long long llnCr(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
long long llnHr(long long a,long long b){return llnCr(a+b-1,b);}
long long llfact(long long a){long long i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
long long llpow(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
long long lldsum(long long x){long long r=0;while(x){r+=(x%10);x/=10;}return r;}
long long lldsumb(long long x,long long b){long long r=0;while(x){r+=(x%b);x/=b;}return r;}
long long llsankaku(long long x){return ((1+x)*x)/2;}
//double
double dbmax(double a,double b){if(a>b){return a;}return b;}
double dbmin(double a,double b){if(a<b){return a;}return b;}
double dbzt(double a,double b){return dbmax(a,b)-dbmin(a,b);}
typedef pair<int, int> ii;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<ll,ll> pll;
#define forr(i,a,b) for(int i=(a); i<(b); i++)
#define clean(arr,val) memset(arr,val,sizeof(arr))
#define forn(i,n) forr(i,0,n)
#define PB push_back
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<pll> vpll;
/*CODE START HERE*/
int main() {
int w, a,b;
cin >> w >> a >> b;
int c = ads(b-a) - w
cout << ( c> 0 ? c : 0) << endl;
}
| a.cc: In function 'int main()':
a.cc:59:12: error: 'ads' was not declared in this scope; did you mean 'abs'?
59 | int c = ads(b-a) - w
| ^~~
| abs
|
s575285016 | p03778 | C++ | #include <bits/stdc++.h>
using namespace std;
#define inf 1072114514
#define llinf 4154118101919364364
#define mod 1000000007
#define pi 3.1415926535897932384
int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;} // 最大公約数
int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;} // 最小公倍数
int nCr(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;} // コンビネーション
int nHr(int a,int b){return nCr(a+b-1,b);} // 重複組み合わせ
int fact(int a){int i,r=1;for(i=1;i<=a;i++){r*=i;}return r;} // 階乗
int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} // a~bまでの階乗
int dsum(int x){int r=0;while(x){r+=(x%10);x/=10;}return r;} //数字の各位の和
int dsumb(int x,int b){int r=0;while(x){r+=(x%b);x/=b;}return r;} // b進数の各位の和?
int sankaku(int x){return ((1+x)*x)/2;} //三角数 xまでの和
//以下long long ver
long long llmax(long long a,long long b){if(a>b){return a;}return b;}
long long llmin(long long a,long long b){if(a<b){return a;}return b;}
long long llzt(long long a,long long b){return llmax(a,b)-llmin(a,b);}
long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
long long llceil(long long a,long long b){if(a%b==0){return a/b;}return (a/b)+1;}
long long llgcd(long long a,long long b){long long c;while(b!=0){c=a%b;a=b;b=c;}return a;}
long long lllcm(long long a,long long b){long long c=llgcd(a,b);a/=c;return a*b;}
long long llnCr(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
long long llnHr(long long a,long long b){return llnCr(a+b-1,b);}
long long llfact(long long a){long long i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
long long llpow(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
long long lldsum(long long x){long long r=0;while(x){r+=(x%10);x/=10;}return r;}
long long lldsumb(long long x,long long b){long long r=0;while(x){r+=(x%b);x/=b;}return r;}
long long llsankaku(long long x){return ((1+x)*x)/2;}
//double
double dbmax(double a,double b){if(a>b){return a;}return b;}
double dbmin(double a,double b){if(a<b){return a;}return b;}
double dbzt(double a,double b){return dbmax(a,b)-dbmin(a,b);}
typedef pair<int, int> ii;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<ll,ll> pll;
#define forr(i,a,b) for(int i=(a); i<(b); i++)
#define clean(arr,val) memset(arr,val,sizeof(arr))
#define forn(i,n) forr(i,0,n)
#define PB push_back
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<pll> vpll;
/*CODE START HERE*/
int main() {
int w, a,b;
cin >> w >> a >> b;
int c = ads(b-a) - w
cout << ( c> 0 ? c : 0) << endl;
}
| a.cc:16:66: error: extended character is not valid in an identifier
16 | int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} // a~bまでの階乗
| ^
a.cc:17:61: error: extended character is not valid in an identifier
17 | int dsum(int x){int r=0;while(x){r+=(x%10);x/=10;}return r;} //数字の各位の和
| ^
a.cc:17:61: error: extended character is not valid in an identifier
a.cc:18:66: error: extended character is not valid in an identifier
18 | int dsumb(int x,int b){int r=0;while(x){r+=(x%b);x/=b;}return r;} // b進数の各位の和?
| ^
a.cc:19:40: error: extended character is not valid in an identifier
19 | int sankaku(int x){return ((1+x)*x)/2;} //三角数 xまでの和
| ^
a.cc:16:66: error: '\U00003000' does not name a type
16 | int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} // a~bまでの階乗
| ^~
a.cc:17:61: error: '\U00003000\U00003000' does not name a type
17 | int dsum(int x){int r=0;while(x){r+=(x%10);x/=10;}return r;} //数字の各位の和
| ^~~~
a.cc:18:66: error: '\U00003000' does not name a type
18 | int dsumb(int x,int b){int r=0;while(x){r+=(x%b);x/=b;}return r;} // b進数の各位の和?
| ^~
a.cc:19:40: error: '\U00003000' does not name a type
19 | int sankaku(int x){return ((1+x)*x)/2;} //三角数 xまでの和
| ^~
a.cc: In function 'long long int llzt(long long int, long long int)':
a.cc:24:48: error: 'llmax' was not declared in this scope
24 | long long llzt(long long a,long long b){return llmax(a,b)-llmin(a,b);}
| ^~~~~
a.cc: In function 'int main()':
a.cc:59:12: error: 'ads' was not declared in this scope; did you mean 'abs'?
59 | int c = ads(b-a) - w
| ^~~
| abs
|
s634602918 | p03778 | C++ | #include <bits/stdc++.h>
using namespace std;
#define inf 1072114514
#define llinf 4154118101919364364
#define mod 1000000007
#define pi 3.1415926535897932384
int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;} // 最大公約数
int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;} // 最小公倍数
int nCr(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;} // コンビネーション
int nHr(int a,int b){return nCr(a+b-1,b);} // 重複組み合わせ
int fact(int a){int i,r=1;for(i=1;i<=a;i++){r*=i;}return r;} // 階乗
int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} // a~bまでの階乗
int dsum(int x){int r=0;while(x){r+=(x%10);x/=10;}return r;} //数字の各位の和
int dsumb(int x,int b){int r=0;while(x){r+=(x%b);x/=b;}return r;} // b進数の各位の和?
int sankaku(int x){return ((1+x)*x)/2;} //三角数 xまでの和
//以下long long ver
long long llmax(long long a,long long b){if(a>b){return a;}return b;}
long long llmin(long long a,long long b){if(a<b){return a;}return b;}
long long llzt(long long a,long long b){return llmax(a,b)-llmin(a,b);}
long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
long long llceil(long long a,long long b){if(a%b==0){return a/b;}return (a/b)+1;}
long long llgcd(long long a,long long b){long long c;while(b!=0){c=a%b;a=b;b=c;}return a;}
long long lllcm(long long a,long long b){long long c=llgcd(a,b);a/=c;return a*b;}
long long llnCr(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
long long llnHr(long long a,long long b){return llnCr(a+b-1,b);}
long long llfact(long long a){long long i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
long long llpow(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
long long lldsum(long long x){long long r=0;while(x){r+=(x%10);x/=10;}return r;}
long long lldsumb(long long x,long long b){long long r=0;while(x){r+=(x%b);x/=b;}return r;}
long long llsankaku(long long x){return ((1+x)*x)/2;}
//double
double dbmax(double a,double b){if(a>b){return a;}return b;}
double dbmin(double a,double b){if(a<b){return a;}return b;}
double dbzt(double a,double b){return dbmax(a,b)-dbmin(a,b);}
typedef pair<int, int> ii;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<ll,ll> pll;
#define forr(i,a,b) for(int i=(a); i<(b); i++)
#define clean(arr,val) memset(arr,val,sizeof(arr))
#define forn(i,n) forr(i,0,n)
#define PB push_back
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<pll> vpll;
/*CODE START HERE*/
int main() {
int w, a,b;
cin >> w >> a >> b;
int c = ads(b-a) - w
cout << ( c> 0 ? c : 0) << endl;
}
| a.cc:14:43: error: extended character is not valid in an identifier
14 | int nHr(int a,int b){return nCr(a+b-1,b);} // 重複組み合わせ
| ^
a.cc:14:43: error: extended character is not valid in an identifier
a.cc:14:43: error: extended character is not valid in an identifier
a.cc:14:43: error: extended character is not valid in an identifier
a.cc:16:66: error: extended character is not valid in an identifier
16 | int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} // a~bまでの階乗
| ^
a.cc:17:61: error: extended character is not valid in an identifier
17 | int dsum(int x){int r=0;while(x){r+=(x%10);x/=10;}return r;} //数字の各位の和
| ^
a.cc:17:61: error: extended character is not valid in an identifier
a.cc:18:66: error: extended character is not valid in an identifier
18 | int dsumb(int x,int b){int r=0;while(x){r+=(x%b);x/=b;}return r;} // b進数の各位の和?
| ^
a.cc:19:40: error: extended character is not valid in an identifier
19 | int sankaku(int x){return ((1+x)*x)/2;} //三角数 xまでの和
| ^
a.cc:14:43: error: '\U00003000\U00003000\U00003000\U00003000' does not name a type
14 | int nHr(int a,int b){return nCr(a+b-1,b);} // 重複組み合わせ
| ^~~~~~~~
a.cc:16:66: error: '\U00003000' does not name a type
16 | int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} // a~bまでの階乗
| ^~
a.cc:17:61: error: '\U00003000\U00003000' does not name a type
17 | int dsum(int x){int r=0;while(x){r+=(x%10);x/=10;}return r;} //数字の各位の和
| ^~~~
a.cc:18:66: error: '\U00003000' does not name a type
18 | int dsumb(int x,int b){int r=0;while(x){r+=(x%b);x/=b;}return r;} // b進数の各位の和?
| ^~
a.cc:19:40: error: '\U00003000' does not name a type
19 | int sankaku(int x){return ((1+x)*x)/2;} //三角数 xまでの和
| ^~
a.cc: In function 'long long int llzt(long long int, long long int)':
a.cc:24:48: error: 'llmax' was not declared in this scope
24 | long long llzt(long long a,long long b){return llmax(a,b)-llmin(a,b);}
| ^~~~~
a.cc: In function 'int main()':
a.cc:59:12: error: 'ads' was not declared in this scope; did you mean 'abs'?
59 | int c = ads(b-a) - w
| ^~~
| abs
|
s483943676 | p03778 | C++ | #include <bits/stdc++.h>
using namespace std;
#define inf 1072114514
#define llinf 4154118101919364364
#define mod 1000000007
#define pi 3.1415926535897932384
int max(int a,int b){if(a>b){return a;}return b;} // max関数
int min(int a,int b){if(a<b){return a;}return b;} // min
int zt(int a,int b){return max(a,b)-min(a,b);} //差の絶対値
int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
int ceil(int a,int b){if(a%b==0){return a/b;}return (a/b)+1;} // 商の繰り上げ
int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;} // 最大公約数
int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;} // 最小公倍数
int nCr(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;} // コンビネーション
int nHr(int a,int b){return nCr(a+b-1,b);} // 重複組み合わせ
int fact(int a){int i,r=1;for(i=1;i<=a;i++){r*=i;}return r;} // 階乗
int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} // a~bまでの階乗
int dsum(int x){int r=0;while(x){r+=(x%10);x/=10;}return r;} //数字の各位の和
int dsumb(int x,int b){int r=0;while(x){r+=(x%b);x/=b;}return r;} // b進数の各位の和?
int sankaku(int x){return ((1+x)*x)/2;} //三角数 xまでの和
//以下long long ver
long long llmax(long long a,long long b){if(a>b){return a;}return b;}
long long llmin(long long a,long long b){if(a<b){return a;}return b;}
long long llzt(long long a,long long b){return llmax(a,b)-llmin(a,b);}
long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
long long llceil(long long a,long long b){if(a%b==0){return a/b;}return (a/b)+1;}
long long llgcd(long long a,long long b){long long c;while(b!=0){c=a%b;a=b;b=c;}return a;}
long long lllcm(long long a,long long b){long long c=llgcd(a,b);a/=c;return a*b;}
long long llnCr(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
long long llnHr(long long a,long long b){return llnCr(a+b-1,b);}
long long llfact(long long a){long long i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
long long llpow(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
long long lldsum(long long x){long long r=0;while(x){r+=(x%10);x/=10;}return r;}
long long lldsumb(long long x,long long b){long long r=0;while(x){r+=(x%b);x/=b;}return r;}
long long llsankaku(long long x){return ((1+x)*x)/2;}
//double
double dbmax(double a,double b){if(a>b){return a;}return b;}
double dbmin(double a,double b){if(a<b){return a;}return b;}
double dbzt(double a,double b){return dbmax(a,b)-dbmin(a,b);}
typedef pair<int, int> ii;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<ll,ll> pll;
#define forr(i,a,b) for(int i=(a); i<(b); i++)
#define clean(arr,val) memset(arr,val,sizeof(arr))
#define forn(i,n) forr(i,0,n)
#define PB push_back
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<pll> vpll;
/*CODE START HERE*/
int main() {
int w, a,b;
cin >> w >> a >> b;
int c = ads(b-a) - w
cout << ( c> 0 ? c : 0) << endl;
}
| a.cc:13:62: error: extended character is not valid in an identifier
13 | int ceil(int a,int b){if(a%b==0){return a/b;}return (a/b)+1;} // 商の繰り上げ
| ^
a.cc:13:62: error: extended character is not valid in an identifier
a.cc:13:62: error: extended character is not valid in an identifier
a.cc:17:43: error: extended character is not valid in an identifier
17 | int nHr(int a,int b){return nCr(a+b-1,b);} // 重複組み合わせ
| ^
a.cc:17:43: error: extended character is not valid in an identifier
a.cc:17:43: error: extended character is not valid in an identifier
a.cc:17:43: error: extended character is not valid in an identifier
a.cc:19:66: error: extended character is not valid in an identifier
19 | int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} // a~bまでの階乗
| ^
a.cc:20:61: error: extended character is not valid in an identifier
20 | int dsum(int x){int r=0;while(x){r+=(x%10);x/=10;}return r;} //数字の各位の和
| ^
a.cc:20:61: error: extended character is not valid in an identifier
a.cc:21:66: error: extended character is not valid in an identifier
21 | int dsumb(int x,int b){int r=0;while(x){r+=(x%b);x/=b;}return r;} // b進数の各位の和?
| ^
a.cc:22:40: error: extended character is not valid in an identifier
22 | int sankaku(int x){return ((1+x)*x)/2;} //三角数 xまでの和
| ^
a.cc:13:62: error: '\U00003000\U00003000\U00003000' does not name a type
13 | int ceil(int a,int b){if(a%b==0){return a/b;}return (a/b)+1;} // 商の繰り上げ
| ^~~~~~
a.cc:17:43: error: '\U00003000\U00003000\U00003000\U00003000' does not name a type
17 | int nHr(int a,int b){return nCr(a+b-1,b);} // 重複組み合わせ
| ^~~~~~~~
a.cc:19:66: error: '\U00003000' does not name a type
19 | int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} // a~bまでの階乗
| ^~
a.cc:20:61: error: '\U00003000\U00003000' does not name a type
20 | int dsum(int x){int r=0;while(x){r+=(x%10);x/=10;}return r;} //数字の各位の和
| ^~~~
a.cc:21:66: error: '\U00003000' does not name a type
21 | int dsumb(int x,int b){int r=0;while(x){r+=(x%b);x/=b;}return r;} // b進数の各位の和?
| ^~
a.cc:22:40: error: '\U00003000' does not name a type
22 | int sankaku(int x){return ((1+x)*x)/2;} //三角数 xまでの和
| ^~
a.cc: In function 'long long int llzt(long long int, long long int)':
a.cc:27:48: error: 'llmax' was not declared in this scope; did you mean 'max'?
27 | long long llzt(long long a,long long b){return llmax(a,b)-llmin(a,b);}
| ^~~~~
| max
a.cc: In function 'int main()':
a.cc:62:12: error: 'ads' was not declared in this scope; did you mean 'abs'?
62 | int c = ads(b-a) - w
| ^~~
| abs
|
s107706838 | p03778 | C++ | #include <bits/stdc++.h>
using namespace std;
int a, b, w, x, y, hasil;
int main () {
cin >> w >> a >> b;
if(a>b){
y=b+w;
if (y>b){
cout << 0 << endl;
}else{
hasil=a-y;
cout << hasil << endl;
}else if (b>a)
x=a+w;
if (x>a){
cout << 0 << endl;
}else{
hasil=b-x;
cout << hasil << endl;
}
}
| a.cc: In function 'int main()':
a.cc:15:2: error: expected '}' before 'else'
15 | }else if (b>a)
| ^~~~
a.cc:8:8: note: to match this '{'
8 | if(a>b){
| ^
|
s067338262 | p03778 | C++ | #include <bits/stdc++.h>
using namespace std;
int a, b, w, x, y, hasil;
int main () {
cin >> a >> b >> w;
a+w=x;
hasil=b-x;
cout << hasil << endl;
}
| a.cc: In function 'int main()':
a.cc:8:2: error: lvalue required as left operand of assignment
8 | a+w=x;
| ~^~
|
s770558935 | p03778 | C++ | #include<bits/stdc++.h>
using namespace std;
int a, b, w;
int main () {
cin >> a >> w >> b;
if (w +a>=b) {
cout<< (b+w<=a) <<endl;
}
else {
cout<< 0 <<endl;
}
else {
cout<< b-a-w <<endl;
}
} | a.cc: In function 'int main()':
a.cc:14:41: error: 'else' without a previous 'if'
14 | else {
| ^~~~
|
s674420151 | p03778 | C++ | using namespace std;
int W,a,b,FV,SV,zero;
int main() {
cin>>W>>a>>b;
zero=0;
FV=b-(W+a);
SV=a-(W+b);
{if(FV>zero)
cout<<FV<<endl;
else if(SV>zero)
cout<<SV<<endl;
else
cout<<zero<<endl;
}
}
| a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope
6 | cin>>W>>a>>b;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | using namespace std;
a.cc:11:6: error: 'cout' was not declared in this scope
11 | cout<<FV<<endl;
| ^~~~
a.cc:11:6: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:11:16: error: 'endl' was not declared in this scope
11 | cout<<FV<<endl;
| ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
+++ |+#include <ostream>
1 | using namespace std;
a.cc:13:6: error: 'cout' was not declared in this scope
13 | cout<<SV<<endl;
| ^~~~
a.cc:13:6: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:13:16: error: 'endl' was not declared in this scope
13 | cout<<SV<<endl;
| ^~~~
a.cc:13:16: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:15:6: error: 'cout' was not declared in this scope
15 | cout<<zero<<endl;
| ^~~~
a.cc:15:6: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:15:18: error: 'endl' was not declared in this scope
15 | cout<<zero<<endl;
| ^~~~
a.cc:15:18: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
|
s076050413 | p03778 | C++ | using namespace std;
int W,a,b,FV,SV,zero;
int main() {
zero=0;
FV=b-(W+a);
SV=a-(W+b);
{if(FV>SV)
cout<<FV<<endl;
else if(FV<SV)
cout<<SV<<endl;
else
cout<<zero<<endl;
}
} | a.cc: In function 'int main()':
a.cc:10:6: error: 'cout' was not declared in this scope
10 | cout<<FV<<endl;
| ^~~~
a.cc:1:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | using namespace std;
a.cc:10:16: error: 'endl' was not declared in this scope
10 | cout<<FV<<endl;
| ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
+++ |+#include <ostream>
1 | using namespace std;
a.cc:12:6: error: 'cout' was not declared in this scope
12 | cout<<SV<<endl;
| ^~~~
a.cc:12:6: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:12:16: error: 'endl' was not declared in this scope
12 | cout<<SV<<endl;
| ^~~~
a.cc:12:16: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:14:6: error: 'cout' was not declared in this scope
14 | cout<<zero<<endl;
| ^~~~
a.cc:14:6: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:14:18: error: 'endl' was not declared in this scope
14 | cout<<zero<<endl;
| ^~~~
a.cc:14:18: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
|
s492666727 | p03778 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int w, a, b;
cin>>W>>a>>b;
if(b<a)
swap(a,b);
if(b<=a+W)
cout<<0<<endl;
else
cout<<(b-a-W)<<endl;
}
| a.cc: In function 'int main()':
a.cc:6:14: error: 'W' was not declared in this scope
6 | cin>>W>>a>>b;
| ^
|
s390308091 | p03778 | C++ | #include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define check cin >>
#define say cout <<
#define nicely << endl
#define initialize_playboy_mode ios_base::sync_with_stdio(0);
#define breakup_with_gf cin.tie(0);
#define messed_up cout << -1 << endl;
#define wife first
#define spare second
#define mgod main
#define wan 1
typedef int single;
typedef long long ll;
typedef pair<ll, ll> ii;
typedef vector<ll> vi;
typedef vector<ii> vii;
class Riajuu
{
public:
vector<int> girls;
int testcount=1;
void hears(int &x)
{
cin>>x;
}
void count_girls()
{
cin>>testcount;
}
bool stillRiajuu()
{
girls.clear();
testcount--;
if(testcount>=0) return true;
else return false;
}
void remove_girls()
{
girls.clear();
}
void check_girls(int x){
for(int i=0;i<x;i++){
int j; cin >> j;
girls.push_back(j);
}
}
} MGod;
void flirt() {
single w,a,b; cin >> w >> a >> b;
if(a>b) swap(a,b);
cout << max(0,b-a-w);
return
}
single mgod() {
initialize_playboy_mode;
breakup_with_gf;
//MGod.count_girls();
while(MGod.stillRiajuu()) flirt();
}
| a.cc: In function 'void flirt()':
a.cc:63:1: error: expected primary-expression before '}' token
63 | }
| ^
a.cc:62:11: error: expected ';' before '}' token
62 | return
| ^
| ;
63 | }
| ~
|
s688351839 | p03778 | Java | import java.util.Scanner;
public class main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int w = sc.nextInt();
int a = sc.nextInt();
int b = sc.nextInt();
if(a + w <= b)System.out.println(b - (a + w));
else if(b + w <= a) System.out.println(a - (b + w));
else System.out.println(0);
}
}
| Main.java:3: error: class main is public, should be declared in a file named main.java
public class main {
^
1 error
|
s243545165 | p03778 | C++ | #include<bits/stdc++.h>
#define int long long
#define vi vector<int>
#define pb push_back
#define log(x,b) (log(b)/log(x))
#define rep(i,x,y) for(int i=(x);i<(y);i++)
using namespace std;
const int mod=1e9+7;
int32_t main()
{
int w,a,b;
cin>>w>>a>>b;
if(b<a)swap(a,b);
if(a<=b && b<=a+w)cout<<0<<endl;
else {
cout<<cout<<b-(a+w)<<endl;
}
return 0;
}
| a.cc: In function 'int32_t main()':
a.cc:17:13: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::ostream' {aka 'std::basic_ostream<char>'})
17 | cout<<cout<<b-(a+w)<<endl;
| ~~~~^~~~~~
| | |
| | basic_ostream<[...]>
| basic_ostream<[...]>
a.cc:17:13: note: candidate: 'operator<<(int, int)' (built-in)
17 | cout<<cout<<b-(a+w)<<endl;
| ~~~~^~~~~~
a.cc:17:13: note: no known conversion for argument 2 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int'
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
from a.cc:1:
/usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'}
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]'
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ^~~~~~~~
/usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'std::ios_base& (*)(std::ios_base&)'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
174 | operator<<(long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'long int'
174 | operator<<(long __n)
| ~~~~~^~~
/usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
178 | operator<<(unsigned long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'long unsigned int'
178 | operator<<(unsigned long __n)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
182 | operator<<(bool __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'bool'
182 | operator<<(bool __n)
| ~~~~~^~~
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]'
96 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'short int'
97 | operator<<(short __n)
| ~~~~~~^~~
/usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
189 | operator<<(unsigned short __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'short unsigned int'
189 | operator<<(unsigned short __n)
| ~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]'
110 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int'
111 | operator<<(int __n)
| ~~~~^~~
/usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
200 | operator<<(unsigned int __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'unsigned int'
200 | operator<<(unsigned int __n)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
211 | operator<<(long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'long long int'
211 | operator<<(long long __n)
| ~~~~~~~~~~^~~
/usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
215 | operator<<(unsigned long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'long long unsigned int'
215 | operator<<(unsigned long long __n)
| ~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
231 | operator<<(double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'double'
231 | operator<<(double __f)
| ~~~~~~~^~~
/usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
235 | operator<<(float __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'float'
235 | operator<<(float __f)
| ~~~~~~^~~
/usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
243 | operator<<(long double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'long double'
243 | operator<<(long double __f)
| ~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
301 | operator<<(const void* __p)
| ^~~~~~~~
/usr/include/c++/14/ostr |
s303589109 | p03778 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,c;
cin>>a>>b>>;
cout<<c-a*b<<endl;
} | a.cc: In function 'int main()':
a.cc:5:14: error: expected primary-expression before ';' token
5 | cin>>a>>b>>;
| ^
|
s187825002 | p03778 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll=long long;
using ld=long double;
using st=string;
using ch=char;
typedef pair<ll,ll> P;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<P> vP;
typedef vector<ch> vc;
typedef vector<vc> vvc;
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,n) FOR(i,0,n)
#define ROF(i,a,b) for(ll i=a;i>=b;i--)
#define per(i,a) ROF(i,a,0)
const ll MOD=1000000007;
const ll MOD2=998244353;
const ld PI=acos(-1);
const ll INF=1e18;
st abc="abcdefghijklmnopqrstuvwxyz";
st ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
struct edge{ll to,cost;};
int main() {
ll w,a,b;
cin >> w >> a >> b;
cout << max(b-a,max(abs(a+w-b),abs(b+w^a))+1)
} | a.cc: In function 'int main()':
a.cc:28:48: error: expected ';' before '}' token
28 | cout << max(b-a,max(abs(a+w-b),abs(b+w^a))+1)
| ^
| ;
29 | }
| ~
|
s038440848 | p03778 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1e16;
const ll mod = 1000000007;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
ll w, a, b;
cin >> w >> a >> b;
chmin(a, b);
if (b <= a+w) cout << 0 << endl;
else cout << abs(a+w-b) << endl;
} | a.cc: In function 'int main()':
a.cc:11:3: error: 'chmin' was not declared in this scope
11 | chmin(a, b);
| ^~~~~
|
s773323486 | p03778 | C++ | def main():
w,a,b = list(map(int,input().split()))
if (a+w)<=b or b+w<=a:
if abs(a+w-b)<=abs(b+w-a):
print(abs(a+w-b))
else:
print(abs(b+w-a))
else:
print(0)
main() | a.cc:1:1: error: 'def' does not name a type
1 | def main():
| ^~~
|
s741292255 | p03778 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int W,A,B;
cin>>W>>A>>B;
cout<<max(max(A,B)-(min(A,B)+w),0)<<endl;
} | a.cc: In function 'int main()':
a.cc:7:32: error: 'w' was not declared in this scope
7 | cout<<max(max(A,B)-(min(A,B)+w),0)<<endl;
| ^
|
s707445598 | p03778 | C++ | #include <bits/stdc++.h>
#define pii pair<int, int>
using namespace std;
int W, A, B;
int main() {
ios_base::sync_with_stdio(0);
cin >> W >> A >> B;
if(A > B) swap(A, B);
cout << (B - (A + W)) > 0 ? (B - (A + W)) : 0 << "\n";
} | a.cc: In function 'int main()':
a.cc:11:25: error: no match for 'operator>' (operand types are 'std::basic_ostream<char>' and 'int')
11 | cout << (B - (A + W)) > 0 ? (B - (A + W)) : 0 << "\n";
| ~~~~~~~~~~~~~~~~~~~~~ ^ ~
| | |
| | int
| std::basic_ostream<char>
a.cc:11:25: note: candidate: 'operator>(int, int)' (built-in)
11 | cout << (B - (A + W)) > 0 ? (B - (A + W)) : 0 << "\n";
| ~~~~~~~~~~~~~~~~~~~~~~^~~
a.cc:11:25: note: no known conversion for argument 1 from 'std::basic_ostream<char>' to 'int'
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
from a.cc:1:
/usr/include/c++/14/bits/regex.h:1176:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator>(const sub_match<_BiIter>&, const sub_match<_BiIter>&)'
1176 | operator>(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1176:5: note: template argument deduction/substitution failed:
a.cc:11:27: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
11 | cout << (B - (A + W)) > 0 ? (B - (A + W)) : 0 << "\n";
| ^
/usr/include/c++/14/bits/regex.h:1236:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator>(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)'
1236 | operator>(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1236:5: note: template argument deduction/substitution failed:
a.cc:11:27: note: 'std::basic_ostream<char>' is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>'
11 | cout << (B - (A + W)) > 0 ? (B - (A + W)) : 0 << "\n";
| ^
/usr/include/c++/14/bits/regex.h:1329:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator>(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)'
1329 | operator>(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1329:5: note: template argument deduction/substitution failed:
a.cc:11:27: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
11 | cout << (B - (A + W)) > 0 ? (B - (A + W)) : 0 << "\n";
| ^
/usr/include/c++/14/bits/regex.h:1403:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)'
1403 | operator>(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1403:5: note: template argument deduction/substitution failed:
a.cc:11:27: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
11 | cout << (B - (A + W)) > 0 ? (B - (A + W)) : 0 << "\n";
| ^
/usr/include/c++/14/bits/regex.h:1497:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)'
1497 | operator>(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1497:5: note: template argument deduction/substitution failed:
a.cc:11:27: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
11 | cout << (B - (A + W)) > 0 ? (B - (A + W)) : 0 << "\n";
| ^
/usr/include/c++/14/bits/regex.h:1573:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)'
1573 | operator>(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1573:5: note: template argument deduction/substitution failed:
a.cc:11:27: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
11 | cout << (B - (A + W)) > 0 ? (B - (A + W)) : 0 << "\n";
| ^
/usr/include/c++/14/bits/regex.h:1673:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)'
1673 | operator>(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1673:5: note: template argument deduction/substitution failed:
a.cc:11:27: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
11 | cout << (B - (A + W)) > 0 ? (B - (A + W)) : 0 << "\n";
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_pair.h:1058:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator>(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1058 | operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1058:5: note: template argument deduction/substitution failed:
a.cc:11:27: note: 'std::basic_ostream<char>' is not derived from 'const std::pair<_T1, _T2>'
11 | cout << (B - (A + W)) > 0 ? (B - (A + W)) : 0 << "\n";
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:462:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
462 | operator>(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:462:5: note: template argument deduction/substitution failed:
a.cc:11:27: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
11 | cout << (B - (A + W)) > 0 ? (B - (A + W)) : 0 << "\n";
| ^
/usr/include/c++/14/bits/stl_iterator.h:507:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
507 | operator>(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:507:5: note: template argument deduction/substitution failed:
a.cc:11:27: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
11 | cout << (B - (A + W)) > 0 ? (B - (A + W)) : 0 << "\n";
| ^
/usr/include/c++/14/bits/stl_iterator.h:1714:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1714 | operator>(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1714:5: note: template argument deduction/substitution failed:
a.cc:11:27: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>'
11 | cout << (B - (A + W)) > 0 ? (B - (A + W)) : 0 << "\n";
| ^
/usr/include/c++/14/bits/stl_iterator.h:1774:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1774 | operator>(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1774:5: note: template argument deduction/substitution failed:
a.cc:11:27: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>'
11 | cout << (B - (A + W)) > 0 ? (B - (A + W)) : 0 << "\n";
| ^
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/string_view:695:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
695 | operator> (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:695:5: note: template argument deduction/substitution failed:
a.cc:11:27: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
11 | cout << (B - (A + W)) > 0 ? (B - (A + W)) : 0 << "\n";
| ^
/usr/include/c++/14/string_view:702:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
702 | operator> (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:702:5: note: template argument deduction/substitution failed:
a.cc:11:27: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
11 | cout << (B - (A + W)) > 0 ? (B - (A + W)) : 0 << "\n";
| ^
/usr/include/c++/14/string_view:710:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)'
710 | operator> (__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:710:5: note: template argument deduction/substitution failed:
a.cc:11:27: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int'
11 | cout << (B - (A + W)) > 0 ? (B - (A + W)) : 0 << "\n";
| |
s357577423 | p03778 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int W,a,b;
cin >> W >> a >> b;
if (a<=B && b<=a+W) cout << 0 << endl;
else if (a<=b+W && b+W<=a+W) cout << 0 << endl;
else cout << max(b-a-W,a-b-W) << endl;
} | a.cc: In function 'int main()':
a.cc:7:10: error: 'B' was not declared in this scope
7 | if (a<=B && b<=a+W) cout << 0 << endl;
| ^
|
s909040684 | p03778 | C++ | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define rep(i, n) for(int i = 0; i < n; i++)
#define sort(v) sort((v).begin(), (v).end())
using vi = vector<int>;
const int MOD = 1e9+7;
bool IsPrime(int num){
if (num < 2) return false;
else if (num == 2) return true;
else if (num % 2 == 0) return false; // 偶数はあらかじめ除く
double sqrtNum = sqrt(num);
for (int i = 3; i <= sqrtNum; i += 2) { if (num % i == 0) return false; }
return true;
}
int main() {
int W,a,b;
cin >> W>>a>>b;
if(b<a+W&&b>a) cout << 0 << endl;
else if(b+W <a+W && b+W >a;) cout << 0 << endl;
else if(a==b)cout << 0 << endl;
else if(b >= a+W) cout << b-a-W+1 <<endl;
else if(a >= b+W) cout << a-b+W+1<< endl;
} | a.cc:25:21: error: extended character is not valid in an identifier
25 | else if(b >= a+W) cout << b-a-W+1 <<endl;
| ^
a.cc: In function 'int main()':
a.cc:23:36: error: expected primary-expression before ')' token
23 | else if(b+W <a+W && b+W >a;) cout << 0 << endl;
| ^
a.cc:25:21: error: '\U00003000a' was not declared in this scope
25 | else if(b >= a+W) cout << b-a-W+1 <<endl;
| ^~~
|
s435803177 | p03778 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define INF 1e9
#define PI 3.14159265359
#define MOD 1000000007
#define ALL(v) v.begin(),v.end()
#define ALLR(v) v.rbegin(),v.rend()
typedef long long ll;
const int dx[4] = {1,0,-1,0};
const int dy[4] = {0,1,0,-1};
//isPrime
//modpow modinv
//getDigit
int main() {
cout << fixed << setprecision(10);
int w,a,b;
cin >> w >> a >> b;
if(a+w<b){
cout << b-(a+w) << endl;
}else if(b+w<a){
cout << a-(b+w) << endl;
}else{
cout < 0 << endl;
}
}
| a.cc: In function 'int main()':
a.cc:24:14: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
24 | cout < 0 << endl;
| ~~^~~~~~~
|
s219951402 | p03778 | C++ | #include <iostream>
#include <algorithm>
#include <cmath>
#include <queue>
#include <utility>
#include <map>
#include <climits>
#include <vector>
#include <set>
#include <string>
#include <numeric>
#define FAST_IO ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr)
#define int long long
using namespace std;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<pair<int, int>> vii;
const int N = 2 * (1e5 + 1);
const int INF = 1e9 + 5;
const long long MOD = 1e9 + 7;
int32_t main() {
FAST_IO;
int W, a, b;
cin >> W >> a >> b;
cout << max(abs(a-b)-W, 0);
return 0;
}
| a.cc: In function 'int32_t main()':
a.cc:27:16: error: no matching function for call to 'max(long long int, int)'
27 | cout << max(abs(a-b)-W, 0);
| ~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:27:16: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
27 | cout << max(abs(a-b)-W, 0);
| ~~~^~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:27:16: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int'
27 | cout << max(abs(a-b)-W, 0);
| ~~~^~~~~~~~~~~~~~~
|
s874528962 | p03778 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int a,b,c;
cin >> a>>b >>c;
if(-min(b,c)-w+max(b,c) < 0){
cout << 0 <<endl;
}
else{
cout << -min(b,c)-w+max(b,c) <<endl;
}
}
| a.cc: In function 'int main()':
a.cc:9:14: error: 'w' was not declared in this scope
9 | if(-min(b,c)-w+max(b,c) < 0){
| ^
|
s935129006 | p03778 | C++ | #Include<iostream>
using namespace std;
int main(){
int w,a,b,ans;
cin >> w >> a >> b;
if(a>b){
ans=a-b-w;
}
else{
ans=b-a-w;
}
if(ans>0){
cout << ans << endl;
}
else{
cout << "0" << endl;
}
}
| a.cc:1:2: error: invalid preprocessing directive #Include; did you mean #include?
1 | #Include<iostream>
| ^~~~~~~
| include
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
6 | cin >> w >> a >> b;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | #Include<iostream>
a.cc:15:7: error: 'cout' was not declared in this scope
15 | cout << ans << endl;
| ^~~~
a.cc:15:7: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:15:22: error: 'endl' was not declared in this scope
15 | cout << ans << endl;
| ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
+++ |+#include <ostream>
1 | #Include<iostream>
a.cc:18:7: error: 'cout' was not declared in this scope
18 | cout << "0" << endl;
| ^~~~
a.cc:18:7: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:18:22: error: 'endl' was not declared in this scope
18 | cout << "0" << endl;
| ^~~~
a.cc:18:22: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
|
s478679601 | p03778 | C++ | include<iostream>
using namespace std;
int main(){
int w,a,b;
cin >> w >> a >> b;
int ans;
if(b > (a + w)){
ans = b - (a + w);
}
else if(a > (b + w)){
ans = a - (b + w);
}
else{
ans = 0;
}
cout << ans << endl;
return 0;
} | a.cc:1:1: error: 'include' does not name a type
1 | include<iostream>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
6 | cin >> w >> a >> b;
| ^~~
a.cc:18:3: error: 'cout' was not declared in this scope
18 | cout << ans << endl;
| ^~~~
a.cc:18:18: error: 'endl' was not declared in this scope
18 | cout << ans << endl;
| ^~~~
|
s515809686 | p03778 | C++ | include<iostream>
using namespace std;
int main(){
int w,a,b;
cin >> w >> a >> b;
int ans;
if(b > (a + w)){
ans = b - (a + w);
}
else if(a > (b + w)){
ans = a - (b + w);
}
else{
ans = 0;
}
cout << ans << endl;
return 0;
} | a.cc:1:1: error: 'include' does not name a type
1 | include<iostream>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
6 | cin >> w >> a >> b;
| ^~~
a.cc:18:3: error: 'cout' was not declared in this scope
18 | cout << ans << endl;
| ^~~~
a.cc:18:18: error: 'endl' was not declared in this scope
18 | cout << ans << endl;
| ^~~~
|
s708053025 | p03778 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for(ll i=0;i<(n);++i)
#define all(a) (a).begin(),(a).end()
#define dunk(a) cout << (a) << endl
#define rall(a) (a).rbegin(),(a).rend()
const int INF = 2e9;
using namespace std;
using Graph = vector<vector<int>>;
typedef pair<int,int> P;
typedef long long ll;
int main(){
int w, a, b; cin >> w >> a >> b;
cout << max(abs(a-b) - w,0) << endl; | a.cc: In function 'int main()':
a.cc:15:41: error: expected '}' at end of input
15 | cout << max(abs(a-b) - w,0) << endl;
| ^
a.cc:12:11: note: to match this '{'
12 | int main(){
| ^
|
s100414825 | p03778 | C++ | import java.util.*;
public class Main {
public static void main(String[] args) throws Exception {
// Your code here!
Scanner sc = new Scanner(System.in);
int W = sc.nextInt(),a = sc.nextInt(),b = sc.nextInt();
int bigger = Math.max(a,b);
int smaller = Math.min(a,b);
if(bigger - smaller - W > 0){
System.out.println(bigger - smaller - W);
}else{
System.out.println(0);
}
}
}
| a.cc:1:1: error: 'import' does not name a type
1 | import java.util.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
3 | public class Main {
| ^~~~~~
|
s294607866 | p03778 | C++ | #include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define pi 3.1415926535897932384626433832795028841971693993751058209749445923078164062
const int INF = 1e9;
#define ll long long
#define pb push_back
#define pf push_front
#define mp make_pair
#define mt make_tuple
#define ub upper_bound
#define lb lower_bound
#define popb pop_back()
#define popf pop_front()
#define ff first
#define ss second
#define vl vector<ll>
#define vi vector<int>
#define vs vector<string>
#define vll vector< pair<ll,ll> >
#define vii vector< pair<int,int> >
#define viii vector< tuple <int,int,int> >
#define vlll vector< tuple <ll,ll,ll> >
#define vvl vector<vector<ll>>
#define vv vector<vector<int>>
#define all(v) v.begin(),v.end()
#define sqrt sqrtl
#define cbrt cbrtl
#define pll pair<ll,ll>
#define pii pair<int,int>
#define mapcl map<char,ll>
#define mapci map<char,int>
#define mapll map<ll,ll>
#define mapii map<int,int>
#define seti set<int>
ifstream fin("input.txt");
ofstream fout("output.txt");
#define FOR(i, l, r) for (int i = int(l); i < int(r); ++i)
#define print(a) for(auto x : a) cout << x << " "; cout << "\n"
#define print1(a) for(auto x : a) cout << x.ff << " " << x.ss << "\n"
#define print2(a,x,y) for(int i = x; i < y; i++) cout<< a[i]<< " "; cout << "\n"
ll fast_exp(ll base, ll exp) {ll res=1;while(exp>0) {if(exp%2==1) res=(res*base)%MOD;base=(base*base)%MOD;exp/=2;}return res%MOD;}
int gcd(int a,int b){while (a&&b)a>b?a%=b:b%=a;return a+b;}
int val(char c){if (c >= '0' && c <= '9')return (int)c - '0';else return (int)c - 'A' + 10;}
ll pows(int a , int b){ll res=1;for(int i=0; i<b; ++i){res*=a;}return res;}
ll logx(ll base, ll num){int cnt=0;while(num!=1){num/=base; ++cnt;}return cnt;}
ll divisibles(ll a, ll b, ll m){if(a%m==0)return (b/m)-(a/m)+1;else return (b/m)-(a/m);}// in [a,b]
string bitstring(int n, int size){string s;while(n){s+=(n%2)+'0';n/=2;}while(s.size()<size){s+='0';}reverse(all(s));return s;}
// dsu start
vi root(200001,0);
vi size(200001,1);
int find(int x){while(x!=root[x])x = root[x];return x;}
bool same(int a,int b){return find(a)==find(b);}
void unite(int a, int b){a = find(a);b = find(b);if(size[a]<size[b])swap(a,b);size[a] += size[b];root[b] = a;}
// dsu end
vi vis(200001,0);
vi adj[200001];
int main()
{
std::ios::sync_with_stdio(false);
//string bitstring = std::bitset< 3 >( 7 ).to_string(); <bits> (num)
//srand(time(0));
//cin.tie(NULL);
//cout.tie(NULL);
int w,a,b;
cin>>w>>a>>b;
int ax = a+w;
int bx = b+w;
if(ax>=b && a<b)
cout<<0<<"\n";
else if(ax<b)
{
cout<<b-ax<<"\n";
}
else if(bx>=a55 1)
cout<<0<<"\n";
else if(bx<a)
cout<<a-bx<<"\n";
} | a.cc: In function 'void unite(int, int)':
a.cc:58:53: error: reference to 'size' is ambiguous
58 | void unite(int a, int b){a = find(a);b = find(b);if(size[a]<size[b])swap(a,b);size[a] += size[b];root[b] = a;}
| ^~~~
In file included from /usr/include/c++/14/string:53,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
from a.cc:1:
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
272 | size(const _Tp (&)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
262 | size(const _Container& __cont) noexcept(noexcept(__cont.size()))
| ^~~~
a.cc:55:4: note: 'std::vector<int> size'
55 | vi size(200001,1);
| ^~~~
a.cc:58:61: error: reference to 'size' is ambiguous
58 | void unite(int a, int b){a = find(a);b = find(b);if(size[a]<size[b])swap(a,b);size[a] += size[b];root[b] = a;}
| ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
272 | size(const _Tp (&)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
262 | size(const _Container& __cont) noexcept(noexcept(__cont.size()))
| ^~~~
a.cc:55:4: note: 'std::vector<int> size'
55 | vi size(200001,1);
| ^~~~
a.cc:58:79: error: reference to 'size' is ambiguous
58 | void unite(int a, int b){a = find(a);b = find(b);if(size[a]<size[b])swap(a,b);size[a] += size[b];root[b] = a;}
| ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
272 | size(const _Tp (&)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
262 | size(const _Container& __cont) noexcept(noexcept(__cont.size()))
| ^~~~
a.cc:55:4: note: 'std::vector<int> size'
55 | vi size(200001,1);
| ^~~~
a.cc:58:90: error: reference to 'size' is ambiguous
58 | void unite(int a, int b){a = find(a);b = find(b);if(size[a]<size[b])swap(a,b);size[a] += size[b];root[b] = a;}
| ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
272 | size(const _Tp (&)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
262 | size(const _Container& __cont) noexcept(noexcept(__cont.size()))
| ^~~~
a.cc:55:4: note: 'std::vector<int> size'
55 | vi size(200001,1);
| ^~~~
a.cc: In function 'int main()':
a.cc:82:17: error: 'a55' was not declared in this scope
82 | else if(bx>=a55 1)
| ^~~
a.cc:82:20: error: expected ')' before numeric constant
82 | else if(bx>=a55 1)
| ~ ^~
| )
|
s852123796 | p03778 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int w,a,b;
cin >> w >> a >> b;
if((b>=a&&b<=a+w)||(b+w>=a&&b+w<=a+w))cout << 0 << endl;
else cout << min(abs(b-a-w),abs(a-b-w) << endl;
} | a.cc: In function 'int main()':
a.cc:8:44: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
8 | else cout << min(abs(b-a-w),abs(a-b-w) << endl;
| ~~~~~~~~~~~^~~~~~~
|
s851212069 | p03778 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int w,a,b;
cin >> w >> a >> b;
if(a < b && a+w<b)
cout << b-a-w << endl;
if else(b < a && b+w<a)
cout << a-b-w << endl;
else
cout << 0 << endl;
}
| a.cc: In function 'int main()':
a.cc:8:6: error: expected '(' before 'else'
8 | if else(b < a && b+w<a)
| ^~~~
| (
a.cc:10:3: error: 'else' without a previous 'if'
10 | else
| ^~~~
|
s641092076 | p03778 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int W,a,b;
cin >> W >> a >> b;
if(a+W>=b || b+W>=a ){
cout << 0 << endl:
return 0;
}
else cout << min(abs(b-a-W),abs(a-b-W)) << endl;
}
| a.cc: In function 'int main()':
a.cc:9:22: error: expected ';' before ':' token
9 | cout << 0 << endl:
| ^
| ;
|
s201833399 | p03778 | C++ | #include <iostream>
using namespace std;
int main (){
int a,b,w;
cin >> w >> a >> b;
if (b >= a && b <= a+w) {cout<<0; return 0;}
if (b >= a + w)) cout<<b - (a + w);
else cout<<a - (b + w);
}
| a.cc: In function 'int main()':
a.cc:9:18: error: expected primary-expression before ')' token
9 | if (b >= a + w)) cout<<b - (a + w);
| ^
|
s993663278 | p03778 | C++ | #include <iostream>
using namespace std;
int main (){
int a,b,w;
cin >> w >> a >> b;
if (b >= a && b <= a+w) {cout<<0; return o;}
if (b >= a + w)) cout<<b - (a + w);
else cout<<a - (b + w);
}
| a.cc: In function 'int main()':
a.cc:7:44: error: 'o' was not declared in this scope
7 | if (b >= a && b <= a+w) {cout<<0; return o;}
| ^
a.cc:9:18: error: expected primary-expression before ')' token
9 | if (b >= a + w)) cout<<b - (a + w);
| ^
|
s403145039 | p03778 | C++ | #include <iostream>
using namespace std;
int main (){
int a,b,w;
cin >> w >> a >> b;
if (b >= a + w)) cout<<b - (a + w);
else cout<<a - (b + w);
}
| a.cc: In function 'int main()':
a.cc:7:18: error: expected primary-expression before ')' token
7 | if (b >= a + w)) cout<<b - (a + w);
| ^
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.