submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3 values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s691718576 | p00586 | C++ | #include <iostream>
int main(){
int A << std::cin;
int B << std::cin;
std::cout << A+B << std::endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:4:11: error: expected initializer before '<<' token
4 | int A << std::cin;
| ^~
a.cc:5:11: error: expected initializer before '<<' token
5 | int B << std::cin;
| ^~
a.cc:6:18: error: 'A' was not declared in this scope
6 | std::cout << A+B << std::endl;
| ^
a.cc:6:20: error: 'B' was not declared in this scope
6 | std::cout << A+B << std::endl;
| ^
|
s563083387 | p00586 | C++ | #include <iostream>
using namespace std;
int main(){
int x,y;
while((cin >> x >> y) != EOF){
cout << x + y << endl;
}
} | a.cc: In function 'int main()':
a.cc:9:23: error: no match for 'operator!=' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'int')
9 | while((cin >> x >> y) != EOF){
| ~~~~~~~~~~~~~~~ ^~
| |
| std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}
a.cc:9:23: note: candidate: 'operator!=(int, int)' (built-in)
9 | while((cin >> x >> y) != EOF){
| ^
a.cc:9:23: note: no known conversion for argument 1 from 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} to 'int'
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:1:
/usr/include/c++/14/bits/postypes.h:197:5: note: candidate: 'template<class _StateT> bool std::operator!=(const fpos<_StateT>&, const fpos<_StateT>&)'
197 | operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/postypes.h:197:5: note: template argument deduction/substitution failed:
In file included from /usr/include/c++/14/cstdio:42,
from /usr/include/c++/14/ext/string_conversions.h:45,
from /usr/include/c++/14/bits/basic_string.h:4154,
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:
a.cc:9:26: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::fpos<_StateT>'
9 | while((cin >> x >> y) != EOF){
| ^~~
In file included from /usr/include/c++/14/string:43:
/usr/include/c++/14/bits/allocator.h:243:5: note: candidate: 'template<class _T1, class _T2> bool std::operator!=(const allocator<_CharT>&, const allocator<_T2>&)'
243 | operator!=(const allocator<_T1>&, const allocator<_T2>&)
| ^~~~~~~~
/usr/include/c++/14/bits/allocator.h:243:5: note: template argument deduction/substitution failed:
a.cc:9:26: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::allocator<_CharT>'
9 | while((cin >> x >> y) != EOF){
| ^~~
In file included from /usr/include/c++/14/string:48:
/usr/include/c++/14/bits/stl_iterator.h:455:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
455 | operator!=(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:455:5: note: template argument deduction/substitution failed:
a.cc:9:26: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
9 | while((cin >> x >> y) != EOF){
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:500:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
500 | operator!=(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:500:5: note: template argument deduction/substitution failed:
a.cc:9:26: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
9 | while((cin >> x >> y) != EOF){
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1686:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1686 | operator!=(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1686:5: note: template argument deduction/substitution failed:
a.cc:9:26: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
9 | while((cin >> x >> y) != EOF){
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1753:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1753 | operator!=(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1753:5: note: template argument deduction/substitution failed:
a.cc:9:26: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
9 | while((cin >> x >> y) != EOF){
| ^~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/string:51:
/usr/include/c++/14/bits/stl_pair.h:1052:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator!=(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1052 | operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1052:5: note: template argument deduction/substitution failed:
a.cc:9:26: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::pair<_T1, _T2>'
9 | while((cin >> x >> y) != EOF){
| ^~~
In file included from /usr/include/c++/14/bits/basic_string.h:47:
/usr/include/c++/14/string_view:651:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
651 | operator!=(basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:651:5: note: template argument deduction/substitution failed:
a.cc:9:26: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
9 | while((cin >> x >> y) != EOF){
| ^~~
/usr/include/c++/14/string_view:658: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> >)'
658 | operator!=(basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:658:5: note: template argument deduction/substitution failed:
a.cc:9:26: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
9 | while((cin >> x >> y) != EOF){
| ^~~
/usr/include/c++/14/string_view:666: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>)'
666 | operator!=(__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:666:5: note: template argument deduction/substitution failed:
a.cc:9:26: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int'
9 | while((cin >> x >> y) != EOF){
| ^~~
/usr/include/c++/14/bits/basic_string.h:3833: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>&)'
3833 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3833:5: note: template argument deduction/substitution failed:
a.cc:9:26: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
9 | while((cin >> x >> y) != EOF){
| ^~~
/usr/include/c++/14/bits/basic_string.h:3847:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3847 | operator!=(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3847:5: note: template argument deduction/substitution failed:
a.cc:9:26: note: mismatched types 'const _CharT*' and 'std::basic_istream<char>'
9 | while((cin >> x >> y) != EOF){
| ^~~
/usr/include/c++/14/bits/basic_string.h:3860:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
3860 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3860:5: note: template argument deduction/substitution failed:
a.cc:9:26: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
9 | while((cin >> x >> y) != EOF){
| ^~~
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:2613:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator!=(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)'
2613 | operator!=(const tuple<_TElements...>& __t,
| ^~~~~~~~
/usr/include/c++/14/tuple:2613:5: note: template argument deduction/substitution failed:
a.cc:9:26: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::tuple<_UTypes ...>'
9 | while((cin >> x >> y) != EOF){
| ^~~
In file included from /usr/include/c++/14/bits/ |
s713716354 | p00586 | C++ | #include <iostream>
using namespace std;
int main(){
int x,y;
while((cin >> x >> y) != EOF){
cout << x + y << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:8:23: error: no match for 'operator!=' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'int')
8 | while((cin >> x >> y) != EOF){
| ~~~~~~~~~~~~~~~ ^~
| |
| std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}
a.cc:8:23: note: candidate: 'operator!=(int, int)' (built-in)
8 | while((cin >> x >> y) != EOF){
| ^
a.cc:8:23: note: no known conversion for argument 1 from 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} to 'int'
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:1:
/usr/include/c++/14/bits/postypes.h:197:5: note: candidate: 'template<class _StateT> bool std::operator!=(const fpos<_StateT>&, const fpos<_StateT>&)'
197 | operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/postypes.h:197:5: note: template argument deduction/substitution failed:
In file included from /usr/include/c++/14/cstdio:42,
from /usr/include/c++/14/ext/string_conversions.h:45,
from /usr/include/c++/14/bits/basic_string.h:4154,
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:
a.cc:8:26: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::fpos<_StateT>'
8 | while((cin >> x >> y) != EOF){
| ^~~
In file included from /usr/include/c++/14/string:43:
/usr/include/c++/14/bits/allocator.h:243:5: note: candidate: 'template<class _T1, class _T2> bool std::operator!=(const allocator<_CharT>&, const allocator<_T2>&)'
243 | operator!=(const allocator<_T1>&, const allocator<_T2>&)
| ^~~~~~~~
/usr/include/c++/14/bits/allocator.h:243:5: note: template argument deduction/substitution failed:
a.cc:8:26: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::allocator<_CharT>'
8 | while((cin >> x >> y) != EOF){
| ^~~
In file included from /usr/include/c++/14/string:48:
/usr/include/c++/14/bits/stl_iterator.h:455:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
455 | operator!=(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:455:5: note: template argument deduction/substitution failed:
a.cc:8:26: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
8 | while((cin >> x >> y) != EOF){
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:500:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
500 | operator!=(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:500:5: note: template argument deduction/substitution failed:
a.cc:8:26: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
8 | while((cin >> x >> y) != EOF){
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1686:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1686 | operator!=(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1686:5: note: template argument deduction/substitution failed:
a.cc:8:26: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
8 | while((cin >> x >> y) != EOF){
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1753:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1753 | operator!=(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1753:5: note: template argument deduction/substitution failed:
a.cc:8:26: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
8 | while((cin >> x >> y) != EOF){
| ^~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/string:51:
/usr/include/c++/14/bits/stl_pair.h:1052:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator!=(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1052 | operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1052:5: note: template argument deduction/substitution failed:
a.cc:8:26: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::pair<_T1, _T2>'
8 | while((cin >> x >> y) != EOF){
| ^~~
In file included from /usr/include/c++/14/bits/basic_string.h:47:
/usr/include/c++/14/string_view:651:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
651 | operator!=(basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:651:5: note: template argument deduction/substitution failed:
a.cc:8:26: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
8 | while((cin >> x >> y) != EOF){
| ^~~
/usr/include/c++/14/string_view:658: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> >)'
658 | operator!=(basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:658:5: note: template argument deduction/substitution failed:
a.cc:8:26: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
8 | while((cin >> x >> y) != EOF){
| ^~~
/usr/include/c++/14/string_view:666: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>)'
666 | operator!=(__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:666:5: note: template argument deduction/substitution failed:
a.cc:8:26: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int'
8 | while((cin >> x >> y) != EOF){
| ^~~
/usr/include/c++/14/bits/basic_string.h:3833: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>&)'
3833 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3833:5: note: template argument deduction/substitution failed:
a.cc:8:26: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
8 | while((cin >> x >> y) != EOF){
| ^~~
/usr/include/c++/14/bits/basic_string.h:3847:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3847 | operator!=(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3847:5: note: template argument deduction/substitution failed:
a.cc:8:26: note: mismatched types 'const _CharT*' and 'std::basic_istream<char>'
8 | while((cin >> x >> y) != EOF){
| ^~~
/usr/include/c++/14/bits/basic_string.h:3860:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
3860 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3860:5: note: template argument deduction/substitution failed:
a.cc:8:26: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
8 | while((cin >> x >> y) != EOF){
| ^~~
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:2613:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator!=(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)'
2613 | operator!=(const tuple<_TElements...>& __t,
| ^~~~~~~~
/usr/include/c++/14/tuple:2613:5: note: template argument deduction/substitution failed:
a.cc:8:26: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::tuple<_UTypes ...>'
8 | while((cin >> x >> y) != EOF){
| ^~~
In file included from /usr/include/c++/14/bits/ |
s610717287 | p00586 | C++ | #include <studio.h>
int main(){
int x,y;
while(scanf("%d %d",x, y) != EOF){
printf("%d\n", x + y);
}
} | a.cc:1:10: fatal error: studio.h: No such file or directory
1 | #include <studio.h>
| ^~~~~~~~~~
compilation terminated.
|
s827792577 | p00586 | C++ | #include <studio.h>
int main(){
int x,y;
while(scanf("%d %d",&x, &y) != EOF){
printf("%d\n", x + y);
}
} | a.cc:1:10: fatal error: studio.h: No such file or directory
1 | #include <studio.h>
| ^~~~~~~~~~
compilation terminated.
|
s482956701 | p00586 | C++ | #include <studio.h>
int main(){
int x,y;
while(scanf("%d %d",&x, &y) != EOF){
printf("%d\n", x + y);
}
return 0;
} | a.cc:1:10: fatal error: studio.h: No such file or directory
1 | #include <studio.h>
| ^~~~~~~~~~
compilation terminated.
|
s600501027 | p00586 | C++ | #include<cstdio>
using namespace std;
int main(void)
{
int a,b;
while(scanf("%d %d",&a,&b)!=EOF){
printf("%d\n",a+b);
}
return 0; | a.cc: In function 'int main()':
a.cc:9:14: error: expected '}' at end of input
9 | return 0;
| ^
a.cc:4:1: note: to match this '{'
4 | {
| ^
|
s417506882 | p00586 | C++ | while a = gets.split(nil)
sum = a[0].to_i + a[1].to_i
puts sum
end | a.cc:1:1: error: expected unqualified-id before 'while'
1 | while a = gets.split(nil)
| ^~~~~
|
s941173577 | p00586 | C++ | #include<stdio.h>
int main(){
int a,b;
while (scanf_s("%d%d", &a, &b)!=EOF){
printf("%d\n", a + b);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:5:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
5 | while (scanf_s("%d%d", &a, &b)!=EOF){
| ^~~~~~~
| scanf
|
s411090869 | p00586 | C++ | #include<iostream>
using namespace std;
int main(){
int a, b;
while( cin>>a>>b; ){
cout<<a+b<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:6:21: error: expected ')' before ';' token
6 | while( cin>>a>>b; ){
| ~ ^
| )
a.cc:6:23: error: expected primary-expression before ')' token
6 | while( cin>>a>>b; ){
| ^
|
s202131729 | p00586 | C++ | #include <cstdio>
using namespace std;
int main() {
int a, b;
while (2 == scanf("%d %d", &a, &b)) {
printf("%d
", a + b);
}
} | a.cc:8:16: warning: missing terminating " character
8 | printf("%d
| ^
a.cc:8:16: error: missing terminating " character
8 | printf("%d
| ^~~
a.cc:9:1: warning: missing terminating " character
9 | ", a + b);
| ^
a.cc:9:1: error: missing terminating " character
9 | ", a + b);
| ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:10:5: error: expected primary-expression before '}' token
10 | }
| ^
|
s488331123 | p00586 | C++ | #include <cstdio>
using namespace std;
int main() {
int a, b;
while (2 == scanf("%d %d", &a, &b)) {
printf("%d
", a + b);
}
} | a.cc:8:16: warning: missing terminating " character
8 | printf("%d
| ^
a.cc:8:16: error: missing terminating " character
8 | printf("%d
| ^~~
a.cc:9:1: warning: missing terminating " character
9 | ", a + b);
| ^
a.cc:9:1: error: missing terminating " character
9 | ", a + b);
| ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:10:5: error: expected primary-expression before '}' token
10 | }
| ^
|
s949646341 | p00586 | C++ | main(){int a,b;while(~scanf("%d %d",&a,&b)){printf("%d\n",a+b);}} | a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
1 | main(){int a,b;while(~scanf("%d %d",&a,&b)){printf("%d\n",a+b);}}
| ^~~~
a.cc: In function 'int main()':
a.cc:1:23: error: 'scanf' was not declared in this scope
1 | main(){int a,b;while(~scanf("%d %d",&a,&b)){printf("%d\n",a+b);}}
| ^~~~~
a.cc:1:45: error: 'printf' was not declared in this scope
1 | main(){int a,b;while(~scanf("%d %d",&a,&b)){printf("%d\n",a+b);}}
| ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
+++ |+#include <cstdio>
1 | main(){int a,b;while(~scanf("%d %d",&a,&b)){printf("%d\n",a+b);}}
|
s319738784 | p00586 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
cin >> a >> b;
cout << a+b << endl;
} | a.cc: In function 'int main()':
a.cc:5:10: error: 'a' was not declared in this scope
5 | cin >> a >> b;
| ^
a.cc:5:15: error: 'b' was not declared in this scope
5 | cin >> a >> b;
| ^
|
s812825383 | p00586 | C++ | main(int a,b){for(;~scanf("%d%d",&a,&b);)printf("%d\n",a+b);} | a.cc:1:12: error: 'b' has not been declared
1 | main(int a,b){for(;~scanf("%d%d",&a,&b);)printf("%d\n",a+b);}
| ^
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
1 | main(int a,b){for(;~scanf("%d%d",&a,&b);)printf("%d\n",a+b);}
| ^~~~
a.cc:1:1: warning: second argument of 'int main(int, int)' should be 'char **' [-Wmain]
a.cc: In function 'int main(int, int)':
a.cc:1:38: error: 'b' was not declared in this scope
1 | main(int a,b){for(;~scanf("%d%d",&a,&b);)printf("%d\n",a+b);}
| ^
a.cc:1:21: error: 'scanf' was not declared in this scope
1 | main(int a,b){for(;~scanf("%d%d",&a,&b);)printf("%d\n",a+b);}
| ^~~~~
a.cc:1:42: error: 'printf' was not declared in this scope
1 | main(int a,b){for(;~scanf("%d%d",&a,&b);)printf("%d\n",a+b);}
| ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
+++ |+#include <cstdio>
1 | main(int a,b){for(;~scanf("%d%d",&a,&b);)printf("%d\n",a+b);}
|
s336713800 | p00586 | C++ | #include <iostream>
int main()
{
while(c != EOF)
{int a,b;
std::cin >> a;
std::cin >> b;
std::cout << a + b << std::endl;
return 0;
}
} | a.cc: In function 'int main()':
a.cc:5:7: error: 'c' was not declared in this scope
5 | while(c != EOF)
| ^
|
s887553564 | p00586 | C++ | include <iostream>
using namespace std;
int main(){
int a, b;
cin >> a >> b;
cout << a+b << 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:7:1: error: 'cin' was not declared in this scope
7 | cin >> a >> b;
| ^~~
a.cc:8:1: error: 'cout' was not declared in this scope
8 | cout << a+b << endl;
| ^~~~
a.cc:8:16: error: 'endl' was not declared in this scope
8 | cout << a+b << endl;
| ^~~~
|
s030322398 | p00586 | C++ | #include<iostream>
using namespace std;
int main ()
{
while(cin >> a >> b)
cout << a + b << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:6:18: error: 'a' was not declared in this scope
6 | while(cin >> a >> b)
| ^
a.cc:6:23: error: 'b' was not declared in this scope
6 | while(cin >> a >> b)
| ^
|
s639281046 | p00586 | C++ | out=[]
while True:
try:
k=list(map(int,input().split(" ")))
out.append(k[0]+k[1])
except:
break
for i in out:
print(i) | a.cc:1:1: error: 'out' does not name a type
1 | out=[]
| ^~~
|
s637786369 | p00586 | C++ | trf6tf67tf7itf7tfyitgytfygvytrdtrdtesrfdresfdrewrfdrrdzra | a.cc:1:1: error: 'trf6tf67tf7itf7tfyitgytfygvytrdtrdtesrfdresfdrewrfdrrdzra' does not name a type
1 | trf6tf67tf7itf7tfyitgytfygvytrdtrdtesrfdresfdrewrfdrrdzra
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
s863728847 | p00586 | C++ | #include<iostream>
#include <cstdio>
using namespace std;
int main() {
int a, b;
while (scanf("%d %d", &a, &b) != EOF) {
printf("%d\n", a + b);
return 0;
} | a.cc: In function 'int main()':
a.cc:11:2: error: expected '}' at end of input
11 | }
| ^
a.cc:6:12: note: to match this '{'
6 | int main() {
| ^
|
s852041957 | p00586 | C++ | #include <iostream>
using namespace std;
int main(){
while(cin){
int a,b;
cin>>a>>b;
cout<<a+b<<endl;
}
return 0;
}
} | a.cc:16:1: error: expected declaration before '}' token
16 | }
| ^
|
s789230496 | p00586 | C++ | #include <bits/stdc++.h>
#include <cstdio>
int main(int args, char **ppArgs)
{
__asm volatile
(
"sub $(12 + 8 + 8 + 4), %esp \n\t" // (arg[0:2], a, b, "%d %d\0\0\0", "%d\n")
"movl $0x25206425, (12 + 8 + 0)(%esp) \n\t"
"movl $0x00000064, (12 + 8 + 4)(%esp) \n\t" // "%d %d"
"movl $0x000A6425, (12 + 8 + 8 + 0)(%esp) \n\t" // "%d\n"
"L_Input: \n\t"
"lea (12 + 8)(%esp), %eax \n\t"
"movl %eax, 0(%esp) \n\t"
"sub $4, %eax \n\t"
"movl %eax, 4(%esp) \n\t"
"sub $4, %eax \n\t"
"movl %eax, 8(%esp) \n\t"
"call _scanf \n\t"
"cmp $0xFFFFFFFF, %eax \n\t"
"jz L_Exit \n\t"
"L_Print: \n\t"
"lea (12 + 8 + 8)(%esp), %eax \n\t"
"movl %eax, 0(%esp) \n\t"
"movl (12 + 0)(%esp), %eax \n\t"
"movl (12 + 4)(%esp), %ebx \n\t"
"add %ebx, %eax \n\t"
"movl %eax, 4(%esp) \n\t"
"call _printf \n\t"
"jmp L_Input \n\t"
"L_Exit: \n\t"
"add $(12 + 8 + 8 + 4), %esp \n\t"
);
} | /usr/bin/ld: /tmp/ccNweUs1.o: in function `L_Input':
a.cc:(.text+0x43): undefined reference to `_scanf'
/usr/bin/ld: /tmp/ccNweUs1.o: in function `L_Print':
a.cc:(.text+0x67): undefined reference to `_printf'
collect2: error: ld returned 1 exit status
|
s857871547 | p00586 | C++ | #include <cardio>
int main(){
int a, b;
while(scanf("%d%d",&a,&b) != EOF){
printf("%d\n",a+b);
}
return 0;
} | a.cc:1:10: fatal error: cardio: No such file or directory
1 | #include <cardio>
| ^~~~~~~~
compilation terminated.
|
s062829472 | p00586 | C++ | #include <iostream>
int main(void){
int a,b;
while(cin){
std::cin >> a >> b;
std::cout << a+b << endl;
}
} | a.cc: In function 'int main()':
a.cc:5:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
5 | while(cin){
| ^~~
| std::cin
In file included 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:7:25: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
7 | std::cout << a+b << endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s614115808 | p00586 | C++ | #include <iostream>
#include <string>
#include <cstdio>
using namespace std;
int main() {
string a, b;
while(true) {
cin >> a;
if(a == EOF) break;
cin >> b;
cout << (int)a + (int)b << endl;
}
} | a.cc: In function 'int main()':
a.cc:10:10: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
10 | if(a == EOF) break;
| ~ ^~
| |
| std::string {aka std::__cxx11::basic_string<char>}
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:1:
/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:
In file included from /usr/include/c++/14/cstdio:42,
from /usr/include/c++/14/ext/string_conversions.h:45,
from /usr/include/c++/14/bits/basic_string.h:4154,
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:
a.cc:10:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>'
10 | if(a == EOF) break;
| ^~~
In file included from /usr/include/c++/14/string:43:
/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:10:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>'
10 | if(a == EOF) break;
| ^~~
In file included from /usr/include/c++/14/string:48:
/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:10:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
10 | if(a == EOF) break;
| ^~~
/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:10:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
10 | if(a == EOF) break;
| ^~~
/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:10:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
10 | if(a == EOF) break;
| ^~~
/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:10:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
10 | if(a == EOF) break;
| ^~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/string:51:
/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:10:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>'
10 | if(a == EOF) break;
| ^~~
In file included from /usr/include/c++/14/bits/basic_string.h:47:
/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:10:13: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
10 | if(a == EOF) break;
| ^~~
/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:10:13: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
10 | if(a == EOF) break;
| ^~~
/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:10:13: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int'
10 | if(a == EOF) break;
| ^~~
/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:10:13: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
10 | if(a == EOF) break;
| ^~~
/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:10:13: note: mismatched types 'const _CharT*' and 'int'
10 | if(a == EOF) break;
| ^~~
/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:10:13: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>'
10 | if(a == EOF) break;
| ^~~
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:10:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::tuple<_UTypes ...>'
10 | if(a == EOF) break;
| ^~~
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:10:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::istreambuf_iterator<_CharT, _Traits>'
10 | if(a == EOF) break;
| ^~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/c++allocator.h:33,
from /usr/include/c++/14/bits/allocator.h:46:
/usr/include/c++/14/bits/new_allocator.h:215:9: |
s623843793 | p00586 | C++ | #include<cstdio>
#include<iostream>
#include<cstring>
#include<algorithm>
#include<math.h>
using namespace std;
//基?框架
const double eps = 1e-6;
const double pi = acos(-1.0);
struct Point
{
double x, y;
Point() {}
Point(double x, double y) :x(x), y(y) {}
};
typedef Point Vector;
Vector operator + (Vector a, Vector b)
{
return Vector(a.x + b.x, a.y + b.y);
}
Vector operator - (Vector a, Vector b)
{
return Vector(a.x - b.x, a.y - b.y);
}
Vector operator * (Vector a, double p)
{
return Vector(a.x*p, a.y*p);
}
Vector operator / (Vector a, double p)
{
return Vector(a.x / p, a.y / p);
}
int dcmp(double x)//三?函数(>0,<0,=0)
{
if (fabs(x)<eps)return 0;
else if (x>0)return 1;
return -1;
}
bool operator == (const Point &a, const Point &b)
{
return dcmp(a.x - b.x) == 0 && dcmp(a.y - b.y) == 0;
}
//各??算
double Dot(Vector a, Vector b)//内?
{
return a.x*b.x + a.y*b.y;
}
double Length(Vector a)//模
{
return sqrt(Dot(a, a));
}
double Angle(Vector a, Vector b)//?角,弧度制
{
return acos(Dot(a, b) / Length(a) / Length(b));
}
double Cross(Vector a, Vector b)//外?
{
return a.x*b.y - a.y*b.x;
}
Vector Rotate(Vector a, double rad)//逆??旋?
{
return Vector(a.x*cos(rad) - a.y*sin(rad), a.x*sin(rad) + a.y*cos(rad));
}
double Distance(Point a, Point b)//?点?距?
{
return sqrt((a.x - b.x)*(a.x - b.x) + (a.y - b.y)*(a.y - b.y));
}
double Area(Point a, Point b, Point c)//三角形面?
{
return fabs(Cross(b - a, c - a) / 2);
}
Point GetLineIntersection(Point P, Vector v, Point Q, Vector w)//?直?的交点
{
Vector u = P - Q;
double t = Cross(w, u) / Cross(v, w);
return P + v*t;
}
//???用
bool Intersect(Point A, Point B, Point C, Point D)//?段相交(不包括端点)
{
double t1 = Cross(C - A, D - A)*Cross(C - B, D - B);
double t2 = Cross(A - C, B - C)*Cross(A - D, B - D);
return dcmp(t1) < 0 && dcmp(t2) < 0;
}
bool StrictIntersect(Point A, Point B, Point C, Point D) //?段相交(包括端点)
{
return
dcmp(max(A.x, B.x) - min(C.x, D.x)) >= 0
&& dcmp(max(C.x, D.x) - min(A.x, B.x)) >= 0
&& dcmp(max(A.y, B.y) - min(C.y, D.y)) >= 0
&& dcmp(max(C.y, D.y) - min(A.y, B.y)) >= 0
&& dcmp(Cross(C - A, D - A)*Cross(C - B, D - B)) <= 0
&& dcmp(Cross(A - C, B - C)*Cross(A - D, B - D)) <= 0;
}
double DistanceToLine(Point A, Point M, Point N)//点A到直?MN的距?,Error:MN=0
{
return fabs(Cross(A - M, A - N) / Distance(M, N));
}
bool OnSegment(Point P1, Point P2, Point P3)//判断P2是否在?段P1P3上
{
return
P2.x >= min(P1.x, P3.x) && P2.x <= max(P1.x, P2.x)
&& P2.y >= min(P1.y, P3.y) && P2.y <= max(P1.y, P2.y)
&& dcmp(Cross(P2 - P1, P3 - P1) == 0);
}
Point TriCenter(Point A, Point B, Point C) //求三角形的内心
{
double a = Distance(B, C), b = Distance(A, C), c = Distance(A, B);
return Point((a*A.x + b*B.x + c*C.x) / (a + b + c), (a*A.y + b*B.y + c*C.y) / (a + b + c));
}
//判断点是否在多?形内
/*模板?明:P[]?多?形的所有?点,下??0~n-1,n?多?形?数*/
Point P[1005];
int n;
bool InsidePolygon (Point A) //判断点是否在凸多?形内(角度和判?法)
{
double alpha = 0;
for (int i = 0; i < n; i++)
alpha += fabs(Angle(P[i] - A, P[(i + 1) % n] - A));
return dcmp(alpha - 2 * pi) == 0;
}
//求多?形面?
/*模板?明:P[]?多?形的所有?点,下??0~n-1,n?多?形?数*/
Point P[1005];
int n;
double PolygonArea()//求多?形面?(叉?和?算法)
{
double sum = 0;
Point O = Point(0, 0);
for (int i = 0; i < n; i++)
sum += Cross(P[i] - O, P[(i + 1) % n] - O);
if (sum < 0)sum = -sum;
return sum;
}
//求凸包
/*模板?明:n?所有点的个数,top???,P[]?所有点,下??0~n-1,result[]?凸包上的点,下??0~top,包含凸包?上的点*/
int n, top;
Point P[10005], result[10005];
bool cmp(Point A, Point B)
{
double ans = Cross(A - P[0], B - P[0]);
if (dcmp(ans) == 0)
return dcmp(Distance(P[0], A) - Distance(P[0], B)) < 0;
else
return ans > 0;
}
void Graham()//Graham凸包?描算法
{
for (int i = 1; i < n; i++)//?找起点
if (P[i].y < P[0].y || (dcmp(P[i].y - P[0].y) == 0 && P[i].x < P[0].x))
swap(P[i], P[0]);
sort(P + 1, P + n, cmp);//?角排序,中心?起点
result[0] = P[0];
result[1] = P[1];
top = 1;
for (int i = 2; i < n; i++)
{
while (Cross(result[top]-result[top-1],P[i]-result[top-1])<0 && top>=1)
top--;
result[++top] = P[i];
}
}
//求多?形的内核
/*模板?明:n?多?形的?数,m?平面分?的个数,a[]?多?形的?点,下??1~n,p?分?,下??0~n-1*/
int n, m;
Point a[1005], p[1005], tmp[1005];
void cut(Point A, Point B)//求半平面交
{
int dn = 0;
double t1, t2;
for (int i = 0; i < m; i++)
{
t1 = Cross(B - A, p[i] - A);
t2 = Cross(B - A, p[(i + 1) % m] - A);
if (dcmp(t1) >= 0)
tmp[dn++] = p[i];
if (dcmp(t1)*dcmp(t2) < 0)
tmp[dn++] = GetLineIntersection(A, B - A, p[i], p[(i + 1) % m] - p[i]);
}
m = 0;
for (int i = 0; i < dn; i++)p[m++] = tmp[i];
}
int Core()//求多?形的核的?数,0表示不存在核,Error:点?逆??排列
{
m = 0;
p[m++] = Point(1e9, 1e9);
p[m++] = Point(-1e9, 1e9);
p[m++] = Point(-1e9, -1e9);
p[m++] = Point(1e9, -1e9);
a[n + 1] = a[1];
for (int i = 1; i <= n ; i++)
{
cut(a[i + 1], a[i]);//不能写反!并且要保????
if (!m)break;
}
return m;
}
int main()
{
long long a, b;
while (cin >> a >> b)cout << a + b << endl;
return 0;
} | a.cc:130:7: error: redefinition of 'Point P [1005]'
130 | Point P[1005];
| ^
a.cc:116:7: note: 'Point P [1005]' previously declared here
116 | Point P[1005];
| ^
a.cc:131:5: error: redefinition of 'int n'
131 | int n;
| ^
a.cc:117:5: note: 'int n' previously declared here
117 | int n;
| ^
a.cc:144:5: error: redefinition of 'int n'
144 | int n, top;
| ^
a.cc:117:5: note: 'int n' previously declared here
117 | int n;
| ^
a.cc:145:7: error: conflicting declaration 'Point P [10005]'
145 | Point P[10005], result[10005];
| ^
a.cc:116:7: note: previous declaration as 'Point P [1005]'
116 | Point P[1005];
| ^
a.cc:173:5: error: redefinition of 'int n'
173 | int n, m;
| ^
a.cc:117:5: note: 'int n' previously declared here
117 | int n;
| ^
|
s735156135 | p00586 | C++ | using namespace std;
int main(){
int a,b;
while(cin>>a>>b){
cout<<a+b<<endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:4:11: error: 'cin' was not declared in this scope
4 | while(cin>>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:5:9: error: 'cout' was not declared in this scope
5 | cout<<a+b<<endl;
| ^~~~
a.cc:5:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:5:20: error: 'endl' was not declared in this scope
5 | cout<<a+b<<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;
|
s643382389 | p00586 | C++ | #include <iostream>
using namespace std;
int main()
{
int a,b;
while(cin >> a >> b;)
{
cout << a+b << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:7:24: error: expected ')' before ';' token
7 | while(cin >> a >> b;)
| ~ ^
| )
a.cc:7:25: error: expected primary-expression before ')' token
7 | while(cin >> a >> b;)
| ^
|
s469957560 | p00586 | C++ | #include <iostream>
using namespace std;
int main(){
int a,b;
while{cin>>a>>b;
cout << a+b << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:7:6: error: expected '(' before '{' token
7 | while{cin>>a>>b;
| ^
| (
a.cc:7:6: error: expected primary-expression before '{' token
a.cc:7:6: error: expected ')' before '{' token
7 | while{cin>>a>>b;
| ^
| )
|
s657453963 | p00586 | C++ | a;main(b){while(~scanf("%d%d",&a,&b))printf("%d\n",a+b);} | a.cc:1:1: error: 'a' does not name a type
1 | a;main(b){while(~scanf("%d%d",&a,&b))printf("%d\n",a+b);}
| ^
a.cc:1:7: error: expected constructor, destructor, or type conversion before '(' token
1 | a;main(b){while(~scanf("%d%d",&a,&b))printf("%d\n",a+b);}
| ^
|
s315364234 | p00586 | C++ | #include <iostream>using namespace std;int main(){ int a,b; cin >> a >> b; cout << a+b << endl; return 0;} | a.cc:1:26: warning: extra tokens at end of #include directive
1 | #include <iostream>using namespace std;int main(){ int a,b; cin >> a >> b; cout << a+b << endl; return 0;}
| ^~~~~~~~~
a.cc:1:10: fatal error: iostream>usin: No such file or directory
1 | #include <iostream>using namespace std;int main(){ int a,b; cin >> a >> b; cout << a+b << endl; return 0;}
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s621929356 | p00586 | C++ | #include<iostream>using namespace std;int main(){ int a,b; while(cin>>a>>b) cout<<a+b<<endl; return 0;} | a.cc:1:25: warning: extra tokens at end of #include directive
1 | #include<iostream>using namespace std;int main(){ int a,b; while(cin>>a>>b) cout<<a+b<<endl; return 0;}
| ^~~~~~~~~
a.cc:1:9: fatal error: iostream>usin: No such file or directory
1 | #include<iostream>using namespace std;int main(){ int a,b; while(cin>>a>>b) cout<<a+b<<endl; return 0;}
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s873226738 | p00586 | C++ | int a,b;main(){for(;~scanf("%d%d",&a,&b);printf("%d\n",a+b));} | a.cc:1:9: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
1 | int a,b;main(){for(;~scanf("%d%d",&a,&b);printf("%d\n",a+b));}
| ^~~~
a.cc: In function 'int main()':
a.cc:1:22: error: 'scanf' was not declared in this scope
1 | int a,b;main(){for(;~scanf("%d%d",&a,&b);printf("%d\n",a+b));}
| ^~~~~
a.cc:1:42: error: 'printf' was not declared in this scope
1 | int a,b;main(){for(;~scanf("%d%d",&a,&b);printf("%d\n",a+b));}
| ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
+++ |+#include <cstdio>
1 | int a,b;main(){for(;~scanf("%d%d",&a,&b);printf("%d\n",a+b));}
|
s126139895 | p00586 | C++ | #import<cstdio>
int main(a,b){for(;~scanf("%d%d",&a,&b);printf("%d\n",a+b));} | a.cc:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
1 | #import<cstdio>
| ^~~~~~
a.cc:2:5: error: cannot declare '::main' to be a global variable
2 | int main(a,b){for(;~scanf("%d%d",&a,&b);printf("%d\n",a+b));}
| ^~~~
a.cc:2:10: error: 'a' was not declared in this scope
2 | int main(a,b){for(;~scanf("%d%d",&a,&b);printf("%d\n",a+b));}
| ^
a.cc:2:12: error: 'b' was not declared in this scope
2 | int main(a,b){for(;~scanf("%d%d",&a,&b);printf("%d\n",a+b));}
| ^
a.cc:2:13: error: expression list treated as compound expression in initializer [-fpermissive]
2 | int main(a,b){for(;~scanf("%d%d",&a,&b);printf("%d\n",a+b));}
| ^
|
s301406298 | p00586 | C++ | int main(){
int a, b;
while( scanf("%d %d", &a, &b) != EOF ){
printf("%d\n", a + b);
}
int N=100000000;
while(N--){}
return 0;
} | a.cc: In function 'int main()':
a.cc:3:12: error: 'scanf' was not declared in this scope
3 | while( scanf("%d %d", &a, &b) != EOF ){
| ^~~~~
a.cc:3:38: error: 'EOF' was not declared in this scope
3 | while( scanf("%d %d", &a, &b) != EOF ){
| ^~~
a.cc:1:1: note: 'EOF' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
+++ |+#include <cstdio>
1 | int main(){
a.cc:4:9: error: 'printf' was not declared in this scope
4 | printf("%d\n", a + b);
| ^~~~~~
a.cc:4:9: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
|
s662104560 | p00586 | C++ | #include <iosteam>
int main(){
int a, b;
while( scanf("%d %d", &a, &b) != EOF ){
printf("%d\n", a + b);
}
int N=100000000;
while(N--){}
return 0;
} | a.cc:1:10: fatal error: iosteam: No such file or directory
1 | #include <iosteam>
| ^~~~~~~~~
compilation terminated.
|
s739460854 | p00586 | C++ | #include <cstdio>
int main(){
int a, b;
while( scanf("%d %d", &a, &b) != EOF ){
printf("%d\n", a + b);
}
long long N=1000000000000LL;
int s=0;
while(N--){s+=N;}
cout<<s<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:10:1: error: 'cout' was not declared in this scope
10 | cout<<s<<endl;
| ^~~~
a.cc:10:10: error: 'endl' was not declared in this scope
10 | cout<<s<<endl;
| ^~~~
|
s671886357 | p00586 | C++ | #include <iostream>
#include <cstdio>
int main(){
int a, b;
while( scanf("%d %d", &a, &b) != EOF ){
printf("%d\n", a + b);
}
long long N=1000000000000LL;
int s=0;
while(N--){s+=N;}
cout<<s<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:11:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
11 | cout<<s<<endl;
| ^~~~
| std::cout
In file included from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:11:10: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
11 | cout<<s<<endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s773690648 | p00586 | C++ | main(a,b){for(;~scanf("%d%d",&a,&b);printf("%d\n",a+b);exit(0);} | a.cc:1:5: error: expected constructor, destructor, or type conversion before '(' token
1 | main(a,b){for(;~scanf("%d%d",&a,&b);printf("%d\n",a+b);exit(0);}
| ^
|
s619120343 | p00586 | C++ | #include <iostream>
int main(){
int a,b;
while(cin >> a >> b){
cout << a+b << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:5:15: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
5 | while(cin >> a >> b){
| ^~~
| std::cin
In file included 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:6:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
6 | cout << a+b << 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:6:32: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
6 | cout << a+b << endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s757734528 | p00586 | C++ | #include <iostream>
int a,b,c;
int main(){
while(std::cin>>a>>b){
std::cout<<a+b+c<<endl;
}
} | a.cc: In function 'int main()':
a.cc:5:19: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
5 | std::cout<<a+b+c<<endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s617775029 | p00586 | C++ | #include <iostream>
int a,b;
int main(){
while(std::cin>>a>>b){
int c=0;
for(ll i=0;i<10000000000LL;i++)c++;
std::cout<<a+b+c/20000000000LL<<std::endl;
}
} | a.cc: In function 'int main()':
a.cc:6:5: error: 'll' was not declared in this scope
6 | for(ll i=0;i<10000000000LL;i++)c++;
| ^~
a.cc:6:12: error: 'i' was not declared in this scope
6 | for(ll i=0;i<10000000000LL;i++)c++;
| ^
|
s308771824 | p00586 | C++ | #include <iostream>
int a,b;
int main(){
while(std::cin>>a>>b){
if(a+b>=1000000000)cout<<"fijeoawgjewjoagj";
else cout<<a+b<<endl;
}
} | a.cc: In function 'int main()':
a.cc:5:20: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
5 | if(a+b>=1000000000)cout<<"fijeoawgjewjoagj";
| ^~~~
| std::cout
In file included from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:6:6: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
6 | else cout<<a+b<<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:6:17: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
6 | else cout<<a+b<<endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s590798928 | p00586 | C++ | #include <iostream>
long long a,b;
int main(){
while(std::cin>>a>>b){
long long c=0;
while(c<10000000000LL)c++;
else std::cout<<(a+b+c)%c<<std::endl;
}
} | a.cc: In function 'int main()':
a.cc:7:1: error: 'else' without a previous 'if'
7 | else std::cout<<(a+b+c)%c<<std::endl;
| ^~~~
|
s991525025 | p00586 | C++ | #include <iostream>
long long a,b;
int main(){
while(std::cin>>a>>b){
long long c=0;
while(c<a+b)c++;
cout<<c<<endl;
}
} | a.cc: In function 'int main()':
a.cc:7:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
7 | cout<<c<<endl;
| ^~~~
| std::cout
In file included from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:7:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
7 | cout<<c<<endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s120123546 | p00586 | C++ | #include <iostream>
using namespace std;
long long a,b;
int main(){
while(cin>>a>>b){
if(a<0||b<0)cout<<"ERROR";
cout<<a+b<<endl;
}
}
} | a.cc:12:1: error: expected declaration before '}' token
12 | }
| ^
|
s282342685 | p00586 | C++ | a | a.cc:1:1: error: 'a' does not name a type
1 | a
| ^
|
s729139887 | p00586 | C++ | fe | a.cc:1:1: error: 'fe' does not name a type
1 | fe
| ^~
|
s774647736 | p00586 | C++ | #include<iostream>
int main(){
int a, b;
while( scanf("%d %d", &a, &b) != EOF ){
cout << a+b << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:6:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
6 | cout << a+b << endl;
| ^~~~
| std::cout
In file included from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:6:24: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
6 | cout << a+b << endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s418067405 | p00586 | C++ | #include <cstdio>
main(a,b){scanf("%d %d",&a,&b);printf("%d",a+b);} | a.cc:2:5: error: expected constructor, destructor, or type conversion before '(' token
2 | main(a,b){scanf("%d %d",&a,&b);printf("%d",a+b);}
| ^
|
s032495328 | p00586 | C++ | #include <cstdio>
main(){int a,b:scanf("%d %d",&a,&b);printf("%d",a+b);} | a.cc:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
2 | main(){int a,b:scanf("%d %d",&a,&b);printf("%d",a+b);}
| ^~~~
a.cc: In function 'int main()':
a.cc:2:15: error: found ':' in nested-name-specifier, expected '::'
2 | main(){int a,b:scanf("%d %d",&a,&b);printf("%d",a+b);}
| ^
| ::
a.cc:2:14: error: 'b' has not been declared
2 | main(){int a,b:scanf("%d %d",&a,&b);printf("%d",a+b);}
| ^
a.cc:2:21: error: qualified-id in declaration before '(' token
2 | main(){int a,b:scanf("%d %d",&a,&b);printf("%d",a+b);}
| ^
a.cc:2:51: error: 'b' was not declared in this scope
2 | main(){int a,b:scanf("%d %d",&a,&b);printf("%d",a+b);}
| ^
|
s950028811 | p00586 | C++ | main(a,b){while(~scanf("%d%d",&a,&b))printf("%d\n",a+b);} | a.cc:1:5: error: expected constructor, destructor, or type conversion before '(' token
1 | main(a,b){while(~scanf("%d%d",&a,&b))printf("%d\n",a+b);}
| ^
|
s087495402 | p00586 | C++ | /* comment */
/* ?e?X?g */ | /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s650127175 | p00586 | C++ | /* 日本語コメント */
#include<iostream>
using namespace std;
main(){
int a; b;
while(cin >> a >> b ) cout << a + b << endl;
} | a.cc:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
6 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:7:8: error: 'b' was not declared in this scope
7 | int a; b;
| ^
|
s097793610 | p00586 | C++ | #include <iostream>
using namespace std;
int main() {
while(cin >> a >> b) {
cout << a+b << endl;
}
} | a.cc: In function 'int main()':
a.cc:5:14: error: 'a' was not declared in this scope
5 | while(cin >> a >> b) {
| ^
a.cc:5:19: error: 'b' was not declared in this scope
5 | while(cin >> a >> b) {
| ^
|
s504253408 | p00586 | C++ | #include <iostream>
using namespace std;
int main()
int a,b,c;
while(cin>>a>>b)
{
c=a+b;
cout<<c<<endl;
}
return 0;
} | a.cc:5:1: error: expected initializer before 'int'
5 | int a,b,c;
| ^~~
a.cc:6:1: error: expected unqualified-id before 'while'
6 | while(cin>>a>>b)
| ^~~~~
a.cc:11:1: error: expected unqualified-id before 'return'
11 | return 0;
| ^~~~~~
a.cc:12:1: error: expected declaration before '}' token
12 | }
| ^
|
s645494506 | p00586 | C++ | main(a,b){for(;~scanf("%d%d",&a,&b);printf("%d\n",a+b));} | a.cc:1:5: error: expected constructor, destructor, or type conversion before '(' token
1 | main(a,b){for(;~scanf("%d%d",&a,&b);printf("%d\n",a+b));}
| ^
|
s390014319 | p00586 | C++ | while 1:
try: print sum(map(int,raw_input().split()))
except : break | a.cc:1:1: error: expected unqualified-id before 'while'
1 | while 1:
| ^~~~~
|
s924436498 | p00586 | C++ | #include <iostream>
int main(void){
int a << std::cin;
int b << std::cin;
std::cout << a + b << std::endl;
} | a.cc: In function 'int main()':
a.cc:4:9: error: expected initializer before '<<' token
4 | int a << std::cin;
| ^~
a.cc:5:9: error: expected initializer before '<<' token
5 | int b << std::cin;
| ^~
a.cc:6:16: error: 'a' was not declared in this scope
6 | std::cout << a + b << std::endl;
| ^
a.cc:6:20: error: 'b' was not declared in this scope
6 | std::cout << a + b << std::endl;
| ^
|
s745575722 | p00586 | C++ | #include<iostream>
using namespace std;
int main(){
lint a,b;
while(cin>>a){
cin>>b;
cout<<a+b<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:6:1: error: 'lint' was not declared in this scope; did you mean 'uint'?
6 | lint a,b;
| ^~~~
| uint
a.cc:7:12: error: 'a' was not declared in this scope
7 | while(cin>>a){
| ^
a.cc:8:6: error: 'b' was not declared in this scope
8 | cin>>b;
| ^
|
s739519738 | p00586 | C++ | #include<stdio.h>
#include<windows.h>
int main(void)
{
HANDLE hToken;
TOKEN_PRIVILEGES tkp;
// 蜿門セ礼ウサ扈溽沿譛ャ
OSVERSIONINFO osvi;
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
if (GetVersionEx(&osvi) == 0)
return false;
if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT)
{
// Windows NT 3.51, Windows NT 4.0, Windows 2000,
// Windows XP, Windows .NET Server
if (!OpenProcessToken(GetCurrentProcess(),
TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken))
//謇灘シ?ス灘燕霑帷ィ玖ョソ髣ョ莉」蜿キ
return false;
LookupPrivilegeValue(NULL, SE_SHUTDOWN_NAME, &tkp.Privileges[0].Luid);//闔キ蜿匁悽蝨ー蜚ッ荳??隸?畑莠主惠迚ケ螳夂ウサ扈滉クュ隶セ鄂ョ譚?剞
tkp.PrivilegeCount = 1;
tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
AdjustTokenPrivileges(hToken, FALSE, &tkp, 0, (PTOKEN_PRIVILEGES)NULL, 0);
//謠仙合隶ソ髣ョ莉、迚梧揀髯?
}
ExitWindowsEx(EWX_FORCE, 0);//蠑コ蛻カ蜈ウ譛コ?御ク榊髄霑帷ィ句書騾仝M_QUERYENDSESSION豸域?
} | a.cc:3:9: fatal error: windows.h: No such file or directory
3 | #include<windows.h>
| ^~~~~~~~~~~
compilation terminated.
|
s806868011 | p00586 | C++ | #include <iostream>
using namespace std;
int main()
{
椀nt a, b;
while(scanf("%d %d", &a, &b) != EOF)
printf("%dn", a+b);
return 0;
} | a.cc: In function 'int main()':
a.cc:7:1: error: '\U00006900nt' was not declared in this scope
7 | 椀nt a, b;
| ^~~~
a.cc:8:23: error: 'a' was not declared in this scope
8 | while(scanf("%d %d", &a, &b) != EOF)
| ^
a.cc:8:27: error: 'b' was not declared in this scope
8 | while(scanf("%d %d", &a, &b) != EOF)
| ^
|
s466420692 | p00586 | C++ | #include <stdio.h>
main(){
int a,b,c;
while(scanf("%d %d",&a,&b) = EOF ){
c = a + b;
printf("%d\n",c);
}
} | a.cc:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
2 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:6:12: error: lvalue required as left operand of assignment
6 | while(scanf("%d %d",&a,&b) = EOF ){
| ~~~~~^~~~~~~~~~~~~~~
|
s770554069 | p00586 | C++ | #include <stdio.h>
main(){
int a,b,c;
while(scanf("%d %d",&a,&b) = EOF){
c = a + b;
printf("%d",c);
}
} | a.cc:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
2 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:6:12: error: lvalue required as left operand of assignment
6 | while(scanf("%d %d",&a,&b) = EOF){
| ~~~~~^~~~~~~~~~~~~~~
|
s155081931 | p00586 | C++ | #include <iostream>
int main(){
int a,b;
while (cin>>a>>b) cout<<a+b;
return 0;
} | a.cc: In function 'int main()':
a.cc:6:8: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
6 | while (cin>>a>>b) cout<<a+b;
| ^~~
| std::cin
In file included 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:6:19: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
6 | while (cin>>a>>b) cout<<a+b;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
|
s131898707 | p00586 | C++ | <?php
while( fscanf(STDIN,"%d %d",$a,$b) > 0 ){
echo $a+$b . "\n";
}
?> | a.cc:1:1: error: expected unqualified-id before '<' token
1 | <?php
| ^
a.cc:5:1: error: expected unqualified-id before '?' token
5 | ?>
| ^
|
s875173985 | p00586 | C++ | import java.io.BufferedReader;
import java.io.InputStreamReader;
class ABProblem{
public static void main(String args[]){
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String input_str;
try{
while((input_str = br.readLine()) != null){
String[] input_strs = input_str.split(" ");
int a = Integer.parseInt(input_strs[0]);
int b = Integer.parseInt(input_strs[1]);
System.out.println(a + b);
}
}catch(Exception e){
//System.err.println(e);
}
}
} | a.cc:1:1: error: 'import' does not name a type
1 | import java.io.BufferedReader;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import java.io.InputStreamReader;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:15: error: expected ':' before 'static'
5 | public static void main(String args[]){
| ^~~~~~~
| :
a.cc:5:33: error: 'String' has not been declared
5 | public static void main(String args[]){
| ^~~~~~
a.cc:19:2: error: expected ';' after class definition
19 | }
| ^
| ;
a.cc: In static member function 'static void ABProblem::main(int*)':
a.cc:6:17: error: 'BufferedReader' was not declared in this scope
6 | BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
| ^~~~~~~~~~~~~~
a.cc:7:17: error: 'String' was not declared in this scope
7 | String input_str;
| ^~~~~~
a.cc:9:32: error: 'input_str' was not declared in this scope
9 | while((input_str = br.readLine()) != null){
| ^~~~~~~~~
a.cc:9:44: error: 'br' was not declared in this scope
9 | while((input_str = br.readLine()) != null){
| ^~
a.cc:9:62: error: 'null' was not declared in this scope
9 | while((input_str = br.readLine()) != null){
| ^~~~
a.cc:10:40: error: expected primary-expression before ']' token
10 | String[] input_strs = input_str.split(" ");
| ^
a.cc:11:41: error: 'Integer' was not declared in this scope
11 | int a = Integer.parseInt(input_strs[0]);
| ^~~~~~~
a.cc:11:58: error: 'input_strs' was not declared in this scope
11 | int a = Integer.parseInt(input_strs[0]);
| ^~~~~~~~~~
a.cc:13:33: error: 'System' was not declared in this scope
13 | System.out.println(a + b);
| ^~~~~~
a.cc:15:24: error: 'Exception' does not name a type
15 | }catch(Exception e){
| ^~~~~~~~~
|
s342276376 | p00586 | C++ | #include <iostream>
using namespace std;
int main() {
int a,b;
whilc (cin>>a>>b) {
cout<<a+b<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:6:3: error: 'whilc' was not declared in this scope
6 | whilc (cin>>a>>b) {
| ^~~~~
|
s694301181 | p00586 | C++ | #include<iostream>
#include<cstdio>
int main(void){
int a,b;
while(cin>>a>>b!=EOF)
cout<<a+b<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
6 | while(cin>>a>>b!=EOF)
| ^~~
| std::cin
In file included 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:7:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
7 | cout<<a+b<<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:7:16: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
7 | cout<<a+b<<endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s016613117 | p00586 | C++ | #include<iostream>
#include<cstdio>
using namespace std;
int main(void){
int a,b;
while(cin>>a>>b!=EOF)
cout<<a+b<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:6:18: error: no match for 'operator!=' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'int')
6 | while(cin>>a>>b!=EOF)
| ~~~~~~~~~^~
| |
| std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}
a.cc:6:18: note: candidate: 'operator!=(int, int)' (built-in)
6 | while(cin>>a>>b!=EOF)
| ^
a.cc:6:18: note: no known conversion for argument 1 from 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} to 'int'
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:1:
/usr/include/c++/14/bits/postypes.h:197:5: note: candidate: 'template<class _StateT> bool std::operator!=(const fpos<_StateT>&, const fpos<_StateT>&)'
197 | operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/postypes.h:197:5: note: template argument deduction/substitution failed:
In file included from /usr/include/c++/14/cstdio:42,
from /usr/include/c++/14/ext/string_conversions.h:45,
from /usr/include/c++/14/bits/basic_string.h:4154,
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:
a.cc:6:20: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::fpos<_StateT>'
6 | while(cin>>a>>b!=EOF)
| ^~~
In file included from /usr/include/c++/14/string:43:
/usr/include/c++/14/bits/allocator.h:243:5: note: candidate: 'template<class _T1, class _T2> bool std::operator!=(const allocator<_CharT>&, const allocator<_T2>&)'
243 | operator!=(const allocator<_T1>&, const allocator<_T2>&)
| ^~~~~~~~
/usr/include/c++/14/bits/allocator.h:243:5: note: template argument deduction/substitution failed:
a.cc:6:20: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::allocator<_CharT>'
6 | while(cin>>a>>b!=EOF)
| ^~~
In file included from /usr/include/c++/14/string:48:
/usr/include/c++/14/bits/stl_iterator.h:455:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
455 | operator!=(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:455:5: note: template argument deduction/substitution failed:
a.cc:6:20: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
6 | while(cin>>a>>b!=EOF)
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:500:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
500 | operator!=(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:500:5: note: template argument deduction/substitution failed:
a.cc:6:20: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
6 | while(cin>>a>>b!=EOF)
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1686:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1686 | operator!=(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1686:5: note: template argument deduction/substitution failed:
a.cc:6:20: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
6 | while(cin>>a>>b!=EOF)
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1753:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1753 | operator!=(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1753:5: note: template argument deduction/substitution failed:
a.cc:6:20: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
6 | while(cin>>a>>b!=EOF)
| ^~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/string:51:
/usr/include/c++/14/bits/stl_pair.h:1052:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator!=(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1052 | operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1052:5: note: template argument deduction/substitution failed:
a.cc:6:20: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::pair<_T1, _T2>'
6 | while(cin>>a>>b!=EOF)
| ^~~
In file included from /usr/include/c++/14/bits/basic_string.h:47:
/usr/include/c++/14/string_view:651:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
651 | operator!=(basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:651:5: note: template argument deduction/substitution failed:
a.cc:6:20: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
6 | while(cin>>a>>b!=EOF)
| ^~~
/usr/include/c++/14/string_view:658: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> >)'
658 | operator!=(basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:658:5: note: template argument deduction/substitution failed:
a.cc:6:20: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
6 | while(cin>>a>>b!=EOF)
| ^~~
/usr/include/c++/14/string_view:666: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>)'
666 | operator!=(__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:666:5: note: template argument deduction/substitution failed:
a.cc:6:20: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int'
6 | while(cin>>a>>b!=EOF)
| ^~~
/usr/include/c++/14/bits/basic_string.h:3833: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>&)'
3833 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3833:5: note: template argument deduction/substitution failed:
a.cc:6:20: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
6 | while(cin>>a>>b!=EOF)
| ^~~
/usr/include/c++/14/bits/basic_string.h:3847:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3847 | operator!=(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3847:5: note: template argument deduction/substitution failed:
a.cc:6:20: note: mismatched types 'const _CharT*' and 'std::basic_istream<char>'
6 | while(cin>>a>>b!=EOF)
| ^~~
/usr/include/c++/14/bits/basic_string.h:3860:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
3860 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3860:5: note: template argument deduction/substitution failed:
a.cc:6:20: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
6 | while(cin>>a>>b!=EOF)
| ^~~
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:2613:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator!=(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)'
2613 | operator!=(const tuple<_TElements...>& __t,
| ^~~~~~~~
/usr/include/c++/14/tuple:2613:5: note: template argument deduction/substitution failed:
a.cc:6:20: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::tuple<_UTypes ...>'
6 | while(cin>>a>>b!=EOF)
| ^~~
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:242:5: note: candidate: 'templa |
s377381454 | p00587 | Java | import java.util.Scanner;
public class Main2 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int x = sc.nextInt(); int answer = x*x*x;
System.out.println(answer);
}
} | Main.java:2: error: class Main2 is public, should be declared in a file named Main2.java
public class Main2 {
^
1 error
|
s015511985 | p00587 | Java | import java.util.Scanner;
public class A {
static Scanner sc = new Scanner(System.in);
public static void main(String[] args) {
while (sc.hasNext()) {
char query = sc.next().charAt(0);
String tree1 = sc.next();
String tree2 = sc.next();
Node root = new Node();
parse(tree1, 0, root, 1);
parse(tree2, 0, root, 2);
root.write(query == 'u');
System.out.println();
}
}
static int parse(String tree, int pos, Node cur, int val) {
cur.val += val;
++pos;
if (tree.charAt(pos) == '(') {
if (cur.left == null) {
cur.left = new Node();
}
pos = parse(tree, pos, cur.left, val);
}
++pos;
if (tree.charAt(pos) == '(') {
if (cur.right == null) {
cur.right = new Node();
}
pos = parse(tree, pos, cur.right, val);
}
return pos + 1;
}
static class Node {
Node left;
Node right;
int val = 0;
boolean match(boolean union) {
if (union) {
return this.val > 0;
} else {
return this.val == 3;
}
}
void write(boolean union) {
if (!match(union)) return;
System.out.print("(");
if (this.left != null) this.left.write(union);
System.out.print(",");
if (this.right != null) this.right.write(union);
System.out.print(")");
}
}
} | Main.java:3: error: class A is public, should be declared in a file named A.java
public class A {
^
1 error
|
s360152934 | p00587 | Java | i ((,),(,)) ((,(,)),)
u ((,),(,)) ((,(,)),) | Main.java:1: error: class, interface, enum, or record expected
i ((,),(,)) ((,(,)),)
^
1 error
|
s890799041 | p00587 | Java | import java.util.Scanner;
public class _1001_BinaryTreeIntersectionAndUnion {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
while(scan.hasNext()){
int order = scan.next().equals("i") ? 0 : 1;
boolean[] tree1 = decode(scan.next());
boolean[] tree2 = decode(scan.next());
print(tree1,tree2,order);
}
}
public static boolean[] decode(String str){
boolean[] tree = new boolean[101];
int pos = 0;
for (int i = 0; i < str.length(); i++) {
char ch = str.charAt(i);
if(ch=='('){
tree[pos]=true;
pos = pos*2+1;
}
if(ch==','){
pos = pos+1;
}
if(ch==')'){
pos = (pos-1)/2;
}
}
return tree;
}
public static Tree[] tr;
public static void print(boolean[] tree1,boolean[] tree2,int order){
tr = new Tree[101];
for (int i = 0; i < 101; i++) {
boolean a = tree1[i];
boolean b = tree2[i];
boolean leaf = order==0 ? (a && b) : (a || b);
if(leaf){
int par = (i-1)/2;
if(i==0) tr[i] = new Tree();
else{
tr[i] = new Tree();
if(i%2==0) tr[par].r=tr[i];
else tr[par].l=tr[i];
}
}
}
System.out.println(trp(tr[0]));
}
public static String trp(Tree tree){
String str = "(";
if(tree.l!=null) str+=trp(tree.l);
str+=",";
if(tree.r!=null) str+=trp(tree.r);
str+=")";
return str;
}
}
class Tree{
Tree l=null,r=null;
} | Main.java:4: error: class _1001_BinaryTreeIntersectionAndUnion is public, should be declared in a file named _1001_BinaryTreeIntersectionAndUnion.java
public class _1001_BinaryTreeIntersectionAndUnion {
^
1 error
|
s087893496 | p00587 | C | #include<iostream>
#include<string>
using namespace std;
struct Tree{
Tree *l,*r;
Tree():l(0),r(0){}
~Tree(){delete l;delete r;}
};
Tree* to_t(string s){
Tree *t=new Tree();
if(s=="")return 0;
if(s=="(,)")return t;
int lev=0;
for(int i=0;i<s.size();i++){
if(s[i]=='(')lev++;
else if(s[i]==')')lev--;
else if(lev==1&&s[i]==','){
t->l=to_t(s.substr(1,i-1));
t->r=to_t(s.substr(i+1,s.size()-(i+1)-1));
break;
}
}
return t;
}
string intersection(Tree *s,Tree *t){
string res;
if(!s||!t)return res;
res+='(';
res+=intersection(s->l,t->l);
res+=',';
res+=intersection(s->r,t->r);
res+=')';
return res;
}
string _union(Tree *s,Tree *t){
string res;
if(!s&&!t)return res;
res+='(';
res+=_union(s?s->l:0,t?t->l:0);
res+=',';
res+=_union(s?s->r:0,t?t->r:0);
res+=')';
return res;
}
int main(){
char op;
string a,b;
Tree * s,*t;
while(cin>>op>>a>>b){
s=to_t(a);
t=to_t(b);
if(op=='i')cout<<intersection(s,t)<<endl;
else cout<<_union(s,t)<<endl;
delete s;
delete t;
}
return 0;
} | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s898746052 | p00587 | C++ | #include <iostream>
#include <limits.h>
#include <queue>
#include <algorithm>
#include <string>
//typedef pair<int,int> P;
using namespace std;
const int INF=INT_MAX/3;
const int N=100;
int heap[N];
string output;
void parse(string &s,int id){
//cout<<s<<":"<<id<<endl;
if(s.empty()) return;
heap[id]++;
if(s=="(,)") return;
int cnt=0;
for(int i=1;i<s.length()-1;i++){
if(s[i]=='(') cnt++;
if(s[i]==')') cnt--;
if(s[i]==',' && cnt==0){
string sub1=s.substr(1,i-1);
string sub2=s.substr(i+1,s.length()-i-2);
parse(sub1, 2*id+1);
parse(sub2, 2*id+2);
break;
}
}
return;
}
int out(int th, int id,int n){
string c("(,)");
for(int i=0;i<3;i++)
output.insert(output.begin()+n+i,c[i]);
int ch1=0,ch2=0;//n of string of each child
if(heap[id]>th){
if(heap[2*id+1]>th){
ch1=out(th,2*id+1,n+1);
}
if(heap[2*id+2]>th){
ch2=out(th,2*id+2,n+ch1+2);
}
}
return ch1+ch2+3;
}
void print(){
for(int i=0;i<N;i++)
cout<<"["<<i<<"]"<<heap[i]<<endl;
}
void solve(string cmd,string &s1,string &s2){
fill(heap,heap+N,0);
output.clear();
//cout<<output<<endl;
parse(s1,0);
parse(s2,0);
int th=-1;
if(cmd=="u") th=0;
if(cmd=="i") th=1;
out(th,0,0);
cout<<output<<endl;
}
int main(){
string cmd,s1,s2;
cin>>cmd>>s1>>s2
solve(cmd,s1,s2);
cout<<"hoge";
return 0;
} | a.cc: In function 'int main()':
a.cc:91:19: error: expected ';' before 'solve'
91 | cin>>cmd>>s1>>s2
| ^
| ;
92 | solve(cmd,s1,s2);
| ~~~~~
|
s768609744 | p00587 | C++ | #include <iostream>
#include <limits.h>
#include <queue>
#include <algorithm>
#include <string>
//typedef pair<int,int> P;
using namespace std;
const int INF=INT_MAX/3;
const int N=1000;
int heap[N];
string output;
void parse(string &s,int id){
//cout<<s<<":"<<id<<endl;
if(s.empty()) return;
heap[id]++;
if(s=="(,)") return;
if(id>=N) break;
int cnt=0;
for(int i=1;i<s.length()-1;i++){
if(s[i]=='(') cnt++;
if(s[i]==')') cnt--;
if(s[i]==',' && cnt==0){
string sub1=s.substr(1,i-1);
string sub2=s.substr(i+1,s.length()-i-2);
if(i-1>=0) parse(sub1, 2*id+1);
if(s.length()-i-2>=0)parse(sub2, 2*id+2);
break;
}
}
return;
}
void out(int th, int id){
output.push_back('(');
int ch1=0,ch2=0;//n of string of each child
if(heap[id]>th && heap[2*id+1]>th){
out(th,2*id+1);
}
output.push_back(',');
if(heap[id]>th && heap[2*id+2]>th){
out(th,2*id+2);
}
output.push_back(')');
return;
}
void print(){
for(int i=0;i<N;i++)
cout<<"["<<i<<"]"<<heap[i]<<endl;
}
void solve(string cmd,string &s1,string &s2){
fill(heap,heap+N,0);
output.clear();
//cout<<output<<endl;
parse(s1,0);
parse(s2,0);
int th=-1;
if(cmd=="u") th=0;
if(cmd=="i") th=1;
out(th,0);
cout<<output<<endl;
}
int main(){
string cmd,s1,s2;
int i=0;
while(cin>>cmd>>s1>>s2){
solve(cmd,s1,s2);
}
return 0;
} | a.cc: In function 'void parse(std::string&, int)':
a.cc:24:13: error: break statement not within loop or switch
24 | if(id>=N) break;
| ^~~~~
|
s319007502 | p00587 | C++ | #coding : utf-8
# version 1.0 2017/02/10 ??????????????¨???????????????
# version 1.1 2017/02/11???????????????????°????????????????????????¶??§??????
# version 1.2 2017/02/11???AOJ??????????????°??????
# version 1.3 2017/02/12 ?§£????????????????????????????????¨?????§?????????????????????
import requests,sys
import time
from selenium import webdriver
from bs4 import BeautifulSoup
import xerox
def main():
print("Hello! This is The AOJ Chaser!")
user_url='http://judge.u-aizu.ac.jp/onlinejudge/webservice/user'
problem_url='http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id='
# ????´¢?????????id?????\???
rival_id='minaminao'
my_id='oshibori'
my_password='1225tomoki'
if not my_id :
print('Input your id!', end=' ')
my_id=input()
if not my_password :
print('Input your password!', end=' ')
my_password=input()
if not rival_id :
print('Input your rival\'s id!', end=' ')
rival_id=input()
# ??????????????????
myparams={'id':my_id} # ME
mydata=requests.get(user_url,params=myparams)
rivalparams={'id':rival_id} # RIVAL
rivaldata=requests.get(user_url,params=rivalparams)
# ??????????????????
mysoup=BeautifulSoup(mydata.text,"html.parser")
rivalsoup=BeautifulSoup(rivaldata.text,"html.parser")
table={}
cnt=0
result_list=[]
for i in mysoup.findAll('problem'):
table[int(i.id.string)]=1;
for i in rivalsoup.findAll('problem'):
x=int(i.id.string)
try:
table[x]=table[x]-1
except:
print(x)
result_list.append([int(i.judge_id.string),i.id.string])
cnt=cnt+1
print('')
result_list.sort(key=lambda x:x[0])
#result_list.sort(key=lambda x:x[1])
#for i in result_list:
# print(i[1])
print('Sum is ',end='')
print(cnt)
index=0
while True:
#??????????????¶?????????
browser=webdriver.Chrome('./chromedriver')
#?????????????????¨?§?
browser.get(problem_url + result_list[index][1])
# ?????°??????
loginform=browser.find_element_by_id('user')
loginform.find_element_by_id('login').click()
loginUserID=loginform.find_element_by_name('loginUserID')
loginPassword=loginform.find_element_by_name('loginPassword')
loginUserID.send_keys(my_id)
loginPassword.send_keys(my_password)
logininput=loginform.find_element_by_id('logininput')
logininput.submit()
index=index+1
#???????????????
submit_url='http://judge.u-aizu.ac.jp/onlinejudge/status.jsp#submit/'+ result_list[index][1]
if browser.current_url == submit_url:
submit_area=browser.find_element_by_id('submitArea')
select=submit_area.find_element_by_id('submit_language')
select.click()
select.find_elements_by_tag_name('option')[4].click() # C++14
select.click()
source=submit_area.find_element_by_id('submit_source')
# ???????????????????????????????????????
print(browser.title)
print(".....END.....")
#????¶??¶???????
com = input()
browser.quit()
if com == 'done' or com == 'fin' :
break;
if __name__ == '__main__':
main() | a.cc:1:2: error: invalid preprocessing directive #coding
1 | #coding : utf-8
| ^~~~~~
a.cc:3:3: error: invalid preprocessing directive #version
3 | # version 1.0 2017/02/10 ??????????????¨???????????????
| ^~~~~~~
a.cc:4:3: error: invalid preprocessing directive #version
4 | # version 1.1 2017/02/11???????????????????°????????????????????????¶??§??????
| ^~~~~~~
a.cc:4:44: error: extended character ° is not valid in an identifier
4 | # version 1.1 2017/02/11???????????????????°????????????????????????¶??§??????
| ^
a.cc:4:69: error: extended character ¶ is not valid in an identifier
4 | # version 1.1 2017/02/11???????????????????°????????????????????????¶??§??????
| ^
a.cc:4:72: error: extended character § is not valid in an identifier
4 | # version 1.1 2017/02/11???????????????????°????????????????????????¶??§??????
| ^
a.cc:5:3: error: invalid preprocessing directive #version
5 | # version 1.2 2017/02/11???AOJ??????????????°??????
| ^~~~~~~
a.cc:5:45: error: extended character ° is not valid in an identifier
5 | # version 1.2 2017/02/11???AOJ??????????????°??????
| ^
a.cc:6:3: error: invalid preprocessing directive #version
6 | # version 1.3 2017/02/12 ?§£????????????????????????????????¨?????§?????????????????????
| ^~~~~~~
a.cc:6:28: error: extended character § is not valid in an identifier
6 | # version 1.3 2017/02/12 ?§£????????????????????????????????¨?????§?????????????????????
| ^
a.cc:6:28: error: extended character £ is not valid in an identifier
a.cc:6:68: error: extended character § is not valid in an identifier
6 | # version 1.3 2017/02/12 ?§£????????????????????????????????¨?????§?????????????????????
| ^
a.cc:16:14: warning: multi-character literal with 53 characters exceeds 'int' size of 4 bytes
16 | user_url='http://judge.u-aizu.ac.jp/onlinejudge/webservice/user'
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:17:17: warning: multi-character literal with 57 characters exceeds 'int' size of 4 bytes
17 | problem_url='http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id='
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:19:7: error: invalid preprocessing directive #?
19 | # ????´¢?????????id?????\???
| ^
a.cc:19:11: error: extended character ¢ is not valid in an identifier
19 | # ????´¢?????????id?????\???
| ^
a.cc:20:14: warning: multi-character literal with 9 characters exceeds 'int' size of 4 bytes
20 | rival_id='minaminao'
| ^~~~~~~~~~~
a.cc:21:11: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
21 | my_id='oshibori'
| ^~~~~~~~~~
a.cc:22:17: warning: multi-character literal with 10 characters exceeds 'int' size of 4 bytes
22 | my_password='1225tomoki'
| ^~~~~~~~~~~~
a.cc:24:15: warning: multi-character literal with 14 characters exceeds 'int' size of 4 bytes
24 | print('Input your id!', end=' ')
| ^~~~~~~~~~~~~~~~
a.cc:27:15: warning: multi-character literal with 20 characters exceeds 'int' size of 4 bytes
27 | print('Input your password!', end=' ')
| ^~~~~~~~~~~~~~~~~~~~~~
a.cc:30:15: warning: multi-character literal with 22 characters exceeds 'int' size of 4 bytes
30 | print('Input your rival\'s id!', end=' ')
| ^~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:35:7: error: invalid preprocessing directive #?
35 | # ??????????????????
| ^
a.cc:36:15: warning: multi-character character constant [-Wmultichar]
36 | myparams={'id':my_id} # ME
| ^~~~
a.cc:36:45: error: stray '#' in program
36 | myparams={'id':my_id} # ME
| ^
a.cc:38:18: warning: multi-character character constant [-Wmultichar]
38 | rivalparams={'id':rival_id} # RIVAL
| ^~~~
a.cc:38:47: error: stray '#' in program
38 | rivalparams={'id':rival_id} # RIVAL
| ^
a.cc:41:7: error: invalid preprocessing directive #?
41 | # ??????????????????
| ^
a.cc:47:29: warning: multi-character literal with 7 characters exceeds 'int' size of 4 bytes
47 | for i in mysoup.findAll('problem'):
| ^~~~~~~~~
a.cc:50:32: warning: multi-character literal with 7 characters exceeds 'int' size of 4 bytes
50 | for i in rivalsoup.findAll('problem'):
| ^~~~~~~~~
a.cc:61:11: error: empty character constant
61 | print('')
| ^~
a.cc:64:6: error: invalid preprocessing directive #result_list
64 | #result_list.sort(key=lambda x:x[1])
| ^~~~~~~~~~~
a.cc:65:6: error: invalid preprocessing directive #for
65 | #for i in result_list:
| ^~~
a.cc:66:10: error: invalid preprocessing directive #print
66 | # print(i[1])
| ^~~~~
a.cc:67:11: warning: multi-character literal with 7 characters exceeds 'int' size of 4 bytes
67 | print('Sum is ',end='')
| ^~~~~~~~~
a.cc:67:25: error: empty character constant
67 | print('Sum is ',end='')
| ^~
a.cc:72:10: error: invalid preprocessing directive #?
72 | #??????????????¶?????????
| ^
a.cc:72:24: error: extended character ¶ is not valid in an identifier
72 | #??????????????¶?????????
| ^
a.cc:73:34: warning: multi-character literal with 14 characters exceeds 'int' size of 4 bytes
73 | browser=webdriver.Chrome('./chromedriver')
| ^~~~~~~~~~~~~~~~
a.cc:74:10: error: invalid preprocessing directive #?
74 | #?????????????????¨?§?
| ^
a.cc:74:29: error: extended character § is not valid in an identifier
74 | #?????????????????¨?§?
| ^
a.cc:76:11: error: invalid preprocessing directive #?
76 | # ?????°??????
| ^
a.cc:76:16: error: extended character ° is not valid in an identifier
76 | # ?????°??????
| ^
a.cc:77:46: warning: multi-character character constant [-Wmultichar]
77 | loginform=browser.find_element_by_id('user')
| ^~~~~~
a.cc:78:38: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes
78 | loginform.find_element_by_id('login').click()
| ^~~~~~~
a.cc:80:52: warning: multi-character literal with 11 characters exceeds 'int' size of 4 bytes
80 | loginUserID=loginform.find_element_by_name('loginUserID')
| ^~~~~~~~~~~~~
a.cc:81:54: warning: multi-character literal with 13 characters exceeds 'int' size of 4 bytes
81 | loginPassword=loginform.find_element_by_name('loginPassword')
| ^~~~~~~~~~~~~~~
a.cc:86:49: warning: multi-character literal with 10 characters exceeds 'int' size of 4 bytes
86 | logininput=loginform.find_element_by_id('logininput')
| ^~~~~~~~~~~~
a.cc:90:10: error: invalid preprocessing directive #?
90 | #???????????????
| ^
a.cc:91:20: warning: multi-character literal with 56 characters exceeds 'int' size of 4 bytes
91 | submit_url='http://judge.u-aizu.ac.jp/onlinejudge/status.jsp#submit/'+ result_list[index][1]
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:93:52: warning: multi-character literal with 10 characters exceeds 'int' size of 4 bytes
93 | submit_area=browser.find_element_by_id('submitArea')
| ^~~~~~~~~~~~
a.cc:94:51: warning: multi-character literal with 15 characters exceeds 'int' size of 4 bytes
94 | select=submit_area.find_element_by_id('submit_language')
| ^~~~~~~~~~~~~~~~~
a.cc:96:46: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes
96 | select.find_elements_by_tag_name('option')[4].click() # C++14
| ^~~~~~~~
a.cc:96:68: error: stray '#' in program
96 | select.find_elements_by_tag_name('option')[4].click() # C++14
| ^
a.cc:99:51: warning: multi-character literal with 13 characters exceeds 'int' size of 4 bytes
99 | source=submit_area.find_element_by_id('submit_source')
| ^~~~~~~~~~~~~~~
a.cc:102:11: error: invalid preprocessing directive #?
102 | # ???????????????????????????????????????
| ^
a.cc:106:10: error: invalid preprocessing directive #?
106 | #????¶??¶???????
| ^
a.cc:106:14: error: extended character ¶ is not valid in an identifier
106 | #????¶??¶???????
| ^
a.cc:106:17: error: extended character ¶ is not valid in an identifier
106 | #????¶??¶???????
| ^
a.cc:109:19: warning: multi-character character constant [-Wmultichar]
109 | if com == 'done' or com == 'fin' :
| ^~~~~~
a.cc:109:36: warning: multi-character character constant [-Wmult |
s236429342 | p00587 | C++ | #coding : utf-8
# version 1.0 2017/02/10 ??????????????¨???????????????
# version 1.1 2017/02/11???????????????????°????????????????????????¶??§??????
# version 1.2 2017/02/11???AOJ??????????????°??????
# version 1.3 2017/02/12 ?§£????????????????????????????????¨?????§?????????????????????
import requests,sys
import time
from selenium import webdriver
from bs4 import BeautifulSoup
import xerox
def main():
print("Hello! This is The AOJ Chaser!")
user_url='http://judge.u-aizu.ac.jp/onlinejudge/webservice/user'
problem_url='http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id='
# ????´¢?????????id?????\???
rival_id='minaminao'
my_id='oshibori'
my_password='1225tomoki'
if not my_id :
print('Input your id!', end=' ')
my_id=input()
if not my_password :
print('Input your password!', end=' ')
my_password=input()
if not rival_id :
print('Input your rival\'s id!', end=' ')
rival_id=input()
# ??????????????????
myparams={'id':my_id} # ME
mydata=requests.get(user_url,params=myparams)
rivalparams={'id':rival_id} # RIVAL
rivaldata=requests.get(user_url,params=rivalparams)
# ??????????????????
mysoup=BeautifulSoup(mydata.text,"html.parser")
rivalsoup=BeautifulSoup(rivaldata.text,"html.parser")
table={}
cnt=0
result_list=[]
for i in mysoup.findAll('problem'):
table[int(i.id.string)]=1;
for i in rivalsoup.findAll('problem'):
x=int(i.id.string)
try:
table[x]=table[x]-1
except:
print(x)
result_list.append([int(i.judge_id.string),i.id.string])
cnt=cnt+1
print('')
result_list.sort(key=lambda x:x[0])
#result_list.sort(key=lambda x:x[1])
#for i in result_list:
# print(i[1])
print('Sum is ',end='')
print(cnt)
index=0
while True:
#??????????????¶?????????
browser=webdriver.Chrome('./chromedriver')
#?????????????????¨?§?
browser.get(problem_url + result_list[index][1])
# ?????°??????
loginform=browser.find_element_by_id('user')
loginform.find_element_by_id('login').click()
loginUserID=loginform.find_element_by_name('loginUserID')
loginPassword=loginform.find_element_by_name('loginPassword')
loginUserID.send_keys(my_id)
loginPassword.send_keys(my_password)
logininput=loginform.find_element_by_id('logininput')
logininput.submit()
index=index+1
#???????????????
submit_url='http://judge.u-aizu.ac.jp/onlinejudge/status.jsp#submit/'+ result_list[index][1]
if browser.current_url == submit_url:
submit_area=browser.find_element_by_id('submitArea')
select=submit_area.find_element_by_id('submit_language')
select.click()
select.find_elements_by_tag_name('option')[4].click() # C++14
select.click()
source=submit_area.find_element_by_id('submit_source')
# ???????????????????????????????????????
print(browser.title)
print(".....END.....")
#????¶??¶???????
com = input()
browser.quit()
if com == 'done' or com == 'fin' :
break;
if __name__ == '__main__':
main() | a.cc:1:2: error: invalid preprocessing directive #coding
1 | #coding : utf-8
| ^~~~~~
a.cc:3:3: error: invalid preprocessing directive #version
3 | # version 1.0 2017/02/10 ??????????????¨???????????????
| ^~~~~~~
a.cc:4:3: error: invalid preprocessing directive #version
4 | # version 1.1 2017/02/11???????????????????°????????????????????????¶??§??????
| ^~~~~~~
a.cc:4:44: error: extended character ° is not valid in an identifier
4 | # version 1.1 2017/02/11???????????????????°????????????????????????¶??§??????
| ^
a.cc:4:69: error: extended character ¶ is not valid in an identifier
4 | # version 1.1 2017/02/11???????????????????°????????????????????????¶??§??????
| ^
a.cc:4:72: error: extended character § is not valid in an identifier
4 | # version 1.1 2017/02/11???????????????????°????????????????????????¶??§??????
| ^
a.cc:5:3: error: invalid preprocessing directive #version
5 | # version 1.2 2017/02/11???AOJ??????????????°??????
| ^~~~~~~
a.cc:5:45: error: extended character ° is not valid in an identifier
5 | # version 1.2 2017/02/11???AOJ??????????????°??????
| ^
a.cc:6:3: error: invalid preprocessing directive #version
6 | # version 1.3 2017/02/12 ?§£????????????????????????????????¨?????§?????????????????????
| ^~~~~~~
a.cc:6:28: error: extended character § is not valid in an identifier
6 | # version 1.3 2017/02/12 ?§£????????????????????????????????¨?????§?????????????????????
| ^
a.cc:6:28: error: extended character £ is not valid in an identifier
a.cc:6:68: error: extended character § is not valid in an identifier
6 | # version 1.3 2017/02/12 ?§£????????????????????????????????¨?????§?????????????????????
| ^
a.cc:16:14: warning: multi-character literal with 53 characters exceeds 'int' size of 4 bytes
16 | user_url='http://judge.u-aizu.ac.jp/onlinejudge/webservice/user'
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:17:17: warning: multi-character literal with 57 characters exceeds 'int' size of 4 bytes
17 | problem_url='http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id='
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:19:7: error: invalid preprocessing directive #?
19 | # ????´¢?????????id?????\???
| ^
a.cc:19:11: error: extended character ¢ is not valid in an identifier
19 | # ????´¢?????????id?????\???
| ^
a.cc:20:14: warning: multi-character literal with 9 characters exceeds 'int' size of 4 bytes
20 | rival_id='minaminao'
| ^~~~~~~~~~~
a.cc:21:11: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
21 | my_id='oshibori'
| ^~~~~~~~~~
a.cc:22:17: warning: multi-character literal with 10 characters exceeds 'int' size of 4 bytes
22 | my_password='1225tomoki'
| ^~~~~~~~~~~~
a.cc:24:15: warning: multi-character literal with 14 characters exceeds 'int' size of 4 bytes
24 | print('Input your id!', end=' ')
| ^~~~~~~~~~~~~~~~
a.cc:27:15: warning: multi-character literal with 20 characters exceeds 'int' size of 4 bytes
27 | print('Input your password!', end=' ')
| ^~~~~~~~~~~~~~~~~~~~~~
a.cc:30:15: warning: multi-character literal with 22 characters exceeds 'int' size of 4 bytes
30 | print('Input your rival\'s id!', end=' ')
| ^~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:35:7: error: invalid preprocessing directive #?
35 | # ??????????????????
| ^
a.cc:36:15: warning: multi-character character constant [-Wmultichar]
36 | myparams={'id':my_id} # ME
| ^~~~
a.cc:36:45: error: stray '#' in program
36 | myparams={'id':my_id} # ME
| ^
a.cc:38:18: warning: multi-character character constant [-Wmultichar]
38 | rivalparams={'id':rival_id} # RIVAL
| ^~~~
a.cc:38:47: error: stray '#' in program
38 | rivalparams={'id':rival_id} # RIVAL
| ^
a.cc:41:7: error: invalid preprocessing directive #?
41 | # ??????????????????
| ^
a.cc:47:29: warning: multi-character literal with 7 characters exceeds 'int' size of 4 bytes
47 | for i in mysoup.findAll('problem'):
| ^~~~~~~~~
a.cc:50:32: warning: multi-character literal with 7 characters exceeds 'int' size of 4 bytes
50 | for i in rivalsoup.findAll('problem'):
| ^~~~~~~~~
a.cc:61:11: error: empty character constant
61 | print('')
| ^~
a.cc:64:6: error: invalid preprocessing directive #result_list
64 | #result_list.sort(key=lambda x:x[1])
| ^~~~~~~~~~~
a.cc:65:6: error: invalid preprocessing directive #for
65 | #for i in result_list:
| ^~~
a.cc:66:10: error: invalid preprocessing directive #print
66 | # print(i[1])
| ^~~~~
a.cc:67:11: warning: multi-character literal with 7 characters exceeds 'int' size of 4 bytes
67 | print('Sum is ',end='')
| ^~~~~~~~~
a.cc:67:25: error: empty character constant
67 | print('Sum is ',end='')
| ^~
a.cc:72:10: error: invalid preprocessing directive #?
72 | #??????????????¶?????????
| ^
a.cc:72:24: error: extended character ¶ is not valid in an identifier
72 | #??????????????¶?????????
| ^
a.cc:73:34: warning: multi-character literal with 14 characters exceeds 'int' size of 4 bytes
73 | browser=webdriver.Chrome('./chromedriver')
| ^~~~~~~~~~~~~~~~
a.cc:74:10: error: invalid preprocessing directive #?
74 | #?????????????????¨?§?
| ^
a.cc:74:29: error: extended character § is not valid in an identifier
74 | #?????????????????¨?§?
| ^
a.cc:76:11: error: invalid preprocessing directive #?
76 | # ?????°??????
| ^
a.cc:76:16: error: extended character ° is not valid in an identifier
76 | # ?????°??????
| ^
a.cc:77:46: warning: multi-character character constant [-Wmultichar]
77 | loginform=browser.find_element_by_id('user')
| ^~~~~~
a.cc:78:38: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes
78 | loginform.find_element_by_id('login').click()
| ^~~~~~~
a.cc:80:52: warning: multi-character literal with 11 characters exceeds 'int' size of 4 bytes
80 | loginUserID=loginform.find_element_by_name('loginUserID')
| ^~~~~~~~~~~~~
a.cc:81:54: warning: multi-character literal with 13 characters exceeds 'int' size of 4 bytes
81 | loginPassword=loginform.find_element_by_name('loginPassword')
| ^~~~~~~~~~~~~~~
a.cc:86:49: warning: multi-character literal with 10 characters exceeds 'int' size of 4 bytes
86 | logininput=loginform.find_element_by_id('logininput')
| ^~~~~~~~~~~~
a.cc:90:10: error: invalid preprocessing directive #?
90 | #???????????????
| ^
a.cc:91:20: warning: multi-character literal with 56 characters exceeds 'int' size of 4 bytes
91 | submit_url='http://judge.u-aizu.ac.jp/onlinejudge/status.jsp#submit/'+ result_list[index][1]
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:93:52: warning: multi-character literal with 10 characters exceeds 'int' size of 4 bytes
93 | submit_area=browser.find_element_by_id('submitArea')
| ^~~~~~~~~~~~
a.cc:94:51: warning: multi-character literal with 15 characters exceeds 'int' size of 4 bytes
94 | select=submit_area.find_element_by_id('submit_language')
| ^~~~~~~~~~~~~~~~~
a.cc:96:46: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes
96 | select.find_elements_by_tag_name('option')[4].click() # C++14
| ^~~~~~~~
a.cc:96:68: error: stray '#' in program
96 | select.find_elements_by_tag_name('option')[4].click() # C++14
| ^
a.cc:99:51: warning: multi-character literal with 13 characters exceeds 'int' size of 4 bytes
99 | source=submit_area.find_element_by_id('submit_source')
| ^~~~~~~~~~~~~~~
a.cc:102:11: error: invalid preprocessing directive #?
102 | # ???????????????????????????????????????
| ^
a.cc:106:10: error: invalid preprocessing directive #?
106 | #????¶??¶???????
| ^
a.cc:106:14: error: extended character ¶ is not valid in an identifier
106 | #????¶??¶???????
| ^
a.cc:106:17: error: extended character ¶ is not valid in an identifier
106 | #????¶??¶???????
| ^
a.cc:109:19: warning: multi-character character constant [-Wmultichar]
109 | if com == 'done' or com == 'fin' :
| ^~~~~~
a.cc:109:36: warning: multi-character character constant [-Wmult |
s641725872 | p00587 | C++ | #coding : utf-8
# version 1.0 2017/02/10 ??????????????¨???????????????
# version 1.1 2017/02/11???????????????????°????????????????????????¶??§??????
# version 1.2 2017/02/11???AOJ??????????????°??????
# version 1.3 2017/02/12 ?§£????????????????????????????????¨?????§?????????????????????
import requests,sys
import time
from selenium import webdriver
from bs4 import BeautifulSoup
import xerox
def main():
print("Hello! This is The AOJ Chaser!")
user_url='http://judge.u-aizu.ac.jp/onlinejudge/webservice/user'
problem_url='http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id='
# ????´¢?????????id?????\???
rival_id='minaminao'
my_id='oshibori'
my_password='1225tomoki'
if not my_id :
print('Input your id!', end=' ')
my_id=input()
if not my_password :
print('Input your password!', end=' ')
my_password=input()
if not rival_id :
print('Input your rival\'s id!', end=' ')
rival_id=input()
# ??????????????????
myparams={'id':my_id} # ME
mydata=requests.get(user_url,params=myparams)
rivalparams={'id':rival_id} # RIVAL
rivaldata=requests.get(user_url,params=rivalparams)
# ??????????????????
mysoup=BeautifulSoup(mydata.text,"html.parser")
rivalsoup=BeautifulSoup(rivaldata.text,"html.parser")
table={}
cnt=0
result_list=[]
for i in mysoup.findAll('problem'):
table[int(i.id.string)]=1;
for i in rivalsoup.findAll('problem'):
x=int(i.id.string)
try:
table[x]=table[x]-1
except:
print(x)
result_list.append([int(i.judge_id.string),i.id.string])
cnt=cnt+1
print('')
result_list.sort(key=lambda x:x[0])
#result_list.sort(key=lambda x:x[1])
#for i in result_list:
# print(i[1])
print('Sum is ',end='')
print(cnt)
index=0
while True:
#??????????????¶?????????
browser=webdriver.Chrome('./chromedriver')
#?????????????????¨?§?
browser.get(problem_url + result_list[index][1])
# ?????°??????
loginform=browser.find_element_by_id('user')
loginform.find_element_by_id('login').click()
loginUserID=loginform.find_element_by_name('loginUserID')
loginPassword=loginform.find_element_by_name('loginPassword')
loginUserID.send_keys(my_id)
loginPassword.send_keys(my_password)
logininput=loginform.find_element_by_id('logininput')
logininput.submit()
index=index+1
#???????????????
submit_url='http://judge.u-aizu.ac.jp/onlinejudge/status.jsp#submit/'+ result_list[index][1]
if browser.current_url == submit_url:
submit_area=browser.find_element_by_id('submitArea')
select=submit_area.find_element_by_id('submit_language')
select.click()
select.find_elements_by_tag_name('option')[4].click() # C++14
select.click()
source=submit_area.find_element_by_id('submit_source')
# ???????????????????????????????????????
print(browser.title)
print(".....END.....")
#????¶??¶???????
com = input()
browser.quit()
if com == 'done' or com == 'fin' :
break;
if __name__ == '__main__':
main() | a.cc:1:2: error: invalid preprocessing directive #coding
1 | #coding : utf-8
| ^~~~~~
a.cc:3:3: error: invalid preprocessing directive #version
3 | # version 1.0 2017/02/10 ??????????????¨???????????????
| ^~~~~~~
a.cc:4:3: error: invalid preprocessing directive #version
4 | # version 1.1 2017/02/11???????????????????°????????????????????????¶??§??????
| ^~~~~~~
a.cc:4:44: error: extended character ° is not valid in an identifier
4 | # version 1.1 2017/02/11???????????????????°????????????????????????¶??§??????
| ^
a.cc:4:69: error: extended character ¶ is not valid in an identifier
4 | # version 1.1 2017/02/11???????????????????°????????????????????????¶??§??????
| ^
a.cc:4:72: error: extended character § is not valid in an identifier
4 | # version 1.1 2017/02/11???????????????????°????????????????????????¶??§??????
| ^
a.cc:5:3: error: invalid preprocessing directive #version
5 | # version 1.2 2017/02/11???AOJ??????????????°??????
| ^~~~~~~
a.cc:5:45: error: extended character ° is not valid in an identifier
5 | # version 1.2 2017/02/11???AOJ??????????????°??????
| ^
a.cc:6:3: error: invalid preprocessing directive #version
6 | # version 1.3 2017/02/12 ?§£????????????????????????????????¨?????§?????????????????????
| ^~~~~~~
a.cc:6:28: error: extended character § is not valid in an identifier
6 | # version 1.3 2017/02/12 ?§£????????????????????????????????¨?????§?????????????????????
| ^
a.cc:6:28: error: extended character £ is not valid in an identifier
a.cc:6:68: error: extended character § is not valid in an identifier
6 | # version 1.3 2017/02/12 ?§£????????????????????????????????¨?????§?????????????????????
| ^
a.cc:16:14: warning: multi-character literal with 53 characters exceeds 'int' size of 4 bytes
16 | user_url='http://judge.u-aizu.ac.jp/onlinejudge/webservice/user'
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:17:17: warning: multi-character literal with 57 characters exceeds 'int' size of 4 bytes
17 | problem_url='http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id='
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:19:7: error: invalid preprocessing directive #?
19 | # ????´¢?????????id?????\???
| ^
a.cc:19:11: error: extended character ¢ is not valid in an identifier
19 | # ????´¢?????????id?????\???
| ^
a.cc:20:14: warning: multi-character literal with 9 characters exceeds 'int' size of 4 bytes
20 | rival_id='minaminao'
| ^~~~~~~~~~~
a.cc:21:11: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
21 | my_id='oshibori'
| ^~~~~~~~~~
a.cc:22:17: warning: multi-character literal with 10 characters exceeds 'int' size of 4 bytes
22 | my_password='1225tomoki'
| ^~~~~~~~~~~~
a.cc:24:15: warning: multi-character literal with 14 characters exceeds 'int' size of 4 bytes
24 | print('Input your id!', end=' ')
| ^~~~~~~~~~~~~~~~
a.cc:27:15: warning: multi-character literal with 20 characters exceeds 'int' size of 4 bytes
27 | print('Input your password!', end=' ')
| ^~~~~~~~~~~~~~~~~~~~~~
a.cc:30:15: warning: multi-character literal with 22 characters exceeds 'int' size of 4 bytes
30 | print('Input your rival\'s id!', end=' ')
| ^~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:35:7: error: invalid preprocessing directive #?
35 | # ??????????????????
| ^
a.cc:36:15: warning: multi-character character constant [-Wmultichar]
36 | myparams={'id':my_id} # ME
| ^~~~
a.cc:36:45: error: stray '#' in program
36 | myparams={'id':my_id} # ME
| ^
a.cc:38:18: warning: multi-character character constant [-Wmultichar]
38 | rivalparams={'id':rival_id} # RIVAL
| ^~~~
a.cc:38:47: error: stray '#' in program
38 | rivalparams={'id':rival_id} # RIVAL
| ^
a.cc:41:7: error: invalid preprocessing directive #?
41 | # ??????????????????
| ^
a.cc:47:29: warning: multi-character literal with 7 characters exceeds 'int' size of 4 bytes
47 | for i in mysoup.findAll('problem'):
| ^~~~~~~~~
a.cc:50:32: warning: multi-character literal with 7 characters exceeds 'int' size of 4 bytes
50 | for i in rivalsoup.findAll('problem'):
| ^~~~~~~~~
a.cc:61:11: error: empty character constant
61 | print('')
| ^~
a.cc:64:6: error: invalid preprocessing directive #result_list
64 | #result_list.sort(key=lambda x:x[1])
| ^~~~~~~~~~~
a.cc:65:6: error: invalid preprocessing directive #for
65 | #for i in result_list:
| ^~~
a.cc:66:10: error: invalid preprocessing directive #print
66 | # print(i[1])
| ^~~~~
a.cc:67:11: warning: multi-character literal with 7 characters exceeds 'int' size of 4 bytes
67 | print('Sum is ',end='')
| ^~~~~~~~~
a.cc:67:25: error: empty character constant
67 | print('Sum is ',end='')
| ^~
a.cc:72:10: error: invalid preprocessing directive #?
72 | #??????????????¶?????????
| ^
a.cc:72:24: error: extended character ¶ is not valid in an identifier
72 | #??????????????¶?????????
| ^
a.cc:73:34: warning: multi-character literal with 14 characters exceeds 'int' size of 4 bytes
73 | browser=webdriver.Chrome('./chromedriver')
| ^~~~~~~~~~~~~~~~
a.cc:74:10: error: invalid preprocessing directive #?
74 | #?????????????????¨?§?
| ^
a.cc:74:29: error: extended character § is not valid in an identifier
74 | #?????????????????¨?§?
| ^
a.cc:76:11: error: invalid preprocessing directive #?
76 | # ?????°??????
| ^
a.cc:76:16: error: extended character ° is not valid in an identifier
76 | # ?????°??????
| ^
a.cc:77:46: warning: multi-character character constant [-Wmultichar]
77 | loginform=browser.find_element_by_id('user')
| ^~~~~~
a.cc:78:38: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes
78 | loginform.find_element_by_id('login').click()
| ^~~~~~~
a.cc:80:52: warning: multi-character literal with 11 characters exceeds 'int' size of 4 bytes
80 | loginUserID=loginform.find_element_by_name('loginUserID')
| ^~~~~~~~~~~~~
a.cc:81:54: warning: multi-character literal with 13 characters exceeds 'int' size of 4 bytes
81 | loginPassword=loginform.find_element_by_name('loginPassword')
| ^~~~~~~~~~~~~~~
a.cc:86:49: warning: multi-character literal with 10 characters exceeds 'int' size of 4 bytes
86 | logininput=loginform.find_element_by_id('logininput')
| ^~~~~~~~~~~~
a.cc:90:10: error: invalid preprocessing directive #?
90 | #???????????????
| ^
a.cc:91:20: warning: multi-character literal with 56 characters exceeds 'int' size of 4 bytes
91 | submit_url='http://judge.u-aizu.ac.jp/onlinejudge/status.jsp#submit/'+ result_list[index][1]
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:93:52: warning: multi-character literal with 10 characters exceeds 'int' size of 4 bytes
93 | submit_area=browser.find_element_by_id('submitArea')
| ^~~~~~~~~~~~
a.cc:94:51: warning: multi-character literal with 15 characters exceeds 'int' size of 4 bytes
94 | select=submit_area.find_element_by_id('submit_language')
| ^~~~~~~~~~~~~~~~~
a.cc:96:46: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes
96 | select.find_elements_by_tag_name('option')[4].click() # C++14
| ^~~~~~~~
a.cc:96:68: error: stray '#' in program
96 | select.find_elements_by_tag_name('option')[4].click() # C++14
| ^
a.cc:99:51: warning: multi-character literal with 13 characters exceeds 'int' size of 4 bytes
99 | source=submit_area.find_element_by_id('submit_source')
| ^~~~~~~~~~~~~~~
a.cc:102:11: error: invalid preprocessing directive #?
102 | # ???????????????????????????????????????
| ^
a.cc:106:10: error: invalid preprocessing directive #?
106 | #????¶??¶???????
| ^
a.cc:106:14: error: extended character ¶ is not valid in an identifier
106 | #????¶??¶???????
| ^
a.cc:106:17: error: extended character ¶ is not valid in an identifier
106 | #????¶??¶???????
| ^
a.cc:109:19: warning: multi-character character constant [-Wmultichar]
109 | if com == 'done' or com == 'fin' :
| ^~~~~~
a.cc:109:36: warning: multi-character character constant [-Wmult |
s924020857 | p00587 | C++ | #include <cstdio>
using namespace std;
const int nil = -1;
const int MAX_N = 256;
struct Node {
int l, r, cnt;
Node() {
l = r = nil;
cnt = 0;
}
};
Node v[MAX_N];
int nodeIndex;
int parse(const char *s, int n, int root) {
v[root].cnt++;
if (s[++n] != ',') {
if (v[root].l == nil) v[root].l = ++nodeIndex;
n = parse(s, n, v[root].l);
}
if (s[++n] != ')') {
if (v[root].r == nil) v[root].r = ++nodeIndex;
n = parse(s, n, v[root].r);
}
return n+1;
}
void print(int root, int cnt) {
if (v[root].cnt < cnt) return;
putchar('(');
if (v[root].l != nil) print(v[root].l, cnt);
putchar(',');
if (v[root].r != nil) print(v[root].r, cnt);
putchar(')');
}
int main() {
char op[10], t1[1024], t2[1024];
while (scanf("%s %s %s", op, t1, t2) == 3) {
for (int i=0;i<MAX_N;i++) v[i] = Node();
nodeIndex = 0;
parse(t1, 0, 0);
parse(t2, 0, 0);
print(0, (op=='u'?1:2)); putchar('\n');
}
return 0;
} | a.cc: In function 'int main()':
a.cc:48:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
48 | print(0, (op=='u'?1:2)); putchar('\n');
| ~~^~~~~
|
s841517379 | p00587 | C++ | /*
AizuOnline A1001
Binary Tree Intersection And Union
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
int find_comma(char * s)
{ int i;
int depth=0;
char c;
for(i=0;i<strlen(s);i++)
{
c = s[i];
if(c=='(')depth++;
if(c==')')depth--;
if((depth==1) && (c == ','))
return(i);
}
return(-1);
}
char *left_node(char *s)
{
int pos;
int len;
char *ptr;
pos=find_comma(s);
if(pos == 0||pos==1)
return(NULL);
else if(pos > 0)
{ len = pos -1;
ptr = malloc(len+1);
strncpy(ptr,&s[1],len);
ptr[len]='\0';
return(ptr);
}
}
char *right_node(char *s)
{
int pos;
int len;
char *ptr;
pos=find_comma(s);
/*printf("P,L = %d %d\n",pos,strlen(s));*/
if(pos == strlen(s)-1||pos==strlen(s)-2)
return(NULL);
else if(pos > 0)
{ len = strlen(s)-pos -2;
ptr = malloc(len+1);
strncpy(ptr,&s[pos+1],len);
ptr[len]='\0';
return(ptr);
}
}
void space_trim(char *s)
{ int i,j;
for(i=strlen(s);i--;i>=0)
if(isspace(s[i]))
for(j=i;j<strlen(s);j++)
s[j]=s[j+1];
}
char * binary_tree_cons(char *x,char *y)
{ int len;
char *p;
if(NULL == x)
if(NULL == y)
{ p=malloc(4);
strcpy(p,"(,)");
return(p);
}
else
{ len = strlen(y);
p=malloc(len+4);
p[0]='(';
p[1]=',';
strcpy(p+2,y);
p[len+2]=')';
p[len+3]='\0';
}
else
if(NULL == y)
{ len = strlen(x);
p=malloc(len+4);
p[0]='(';
strcpy(p+1,x);
p[len+1] = ',';
p[len+2] = ')';
p[len+3] = '\0';
}
else
{
len = strlen(y)+strlen(x);
p=malloc(len+4);
p[0]='(';
strcpy(p+1,x);
p[strlen(x)+1]=',';
strcpy(p+strlen(x)+2,y);
p[len+2] = ')';
p[len+3] = '\0';
}
return(p);
}
char * binary_tree_union(char *x,char *y)
{ int len;
char *p;
if(NULL == x)
if(NULL == y)
{ return(NULL);
}
else
{ len = strlen(y);
p=malloc(len);
strcpy(p,y);
}
else
if(NULL == y)
{ len = strlen(x);
p=malloc(len);
strcpy(p,x);
}
else
{ if(0==strcmp(x,y))
{ len = strlen(x);
p=malloc(len);
strcpy(p,x);
}
else
{ /* printf("U:%s %s %s %s \n",left_node(x),right_node(x),left_node(y),right_node(y));*/
p=binary_tree_cons(binary_tree_union (left_node(x),left_node(y)),
binary_tree_union (right_node(x),right_node(y)));
}
}
return(p);
}
char * binary_tree_intersect(char *x,char *y)
{ int len;
char *p;
if((NULL == x) || (NULL == y))
{ return(NULL);
}
else
{ if(0==strcmp(x,y))
{ len = strlen(x);
p=malloc(len);
strcpy(p,x);
}
else
{ /* printf("I:%s %s %s %s \n",left_node(x),right_node(x),left_node(y),right_node(y)); */
p=binary_tree_cons(binary_tree_intersect (left_node(x),left_node(y)),
binary_tree_intersect (right_node(x),right_node(y)));
}
}
return(p);
}
main()
{
char bin1[256],bin2[256];
char order;
while(3 == scanf(" %c %s %s",&order,bin1,bin2))
{
/* printf("T1,T2=%s %s\n",bin1,bin2); */
if(order =='i')
printf("%s\n",binary_tree_intersect(bin1,bin2));
else
printf("%s\n",binary_tree_union(bin2,bin1));
}
return(0);
} | a.cc: In function 'char* left_node(char*)':
a.cc:38:23: error: invalid conversion from 'void*' to 'char*' [-fpermissive]
38 | ptr = malloc(len+1);
| ~~~~~~^~~~~~~
| |
| void*
a.cc: In function 'char* right_node(char*)':
a.cc:57:23: error: invalid conversion from 'void*' to 'char*' [-fpermissive]
57 | ptr = malloc(len+1);
| ~~~~~~^~~~~~~
| |
| void*
a.cc: In function 'char* binary_tree_cons(char*, char*)':
a.cc:77:18: error: invalid conversion from 'void*' to 'char*' [-fpermissive]
77 | { p=malloc(4);
| ~~~~~~^~~
| |
| void*
a.cc:83:16: error: invalid conversion from 'void*' to 'char*' [-fpermissive]
83 | p=malloc(len+4);
| ~~~~~~^~~~~~~
| |
| void*
a.cc:93:17: error: invalid conversion from 'void*' to 'char*' [-fpermissive]
93 | p=malloc(len+4);
| ~~~~~~^~~~~~~
| |
| void*
a.cc:103:18: error: invalid conversion from 'void*' to 'char*' [-fpermissive]
103 | p=malloc(len+4);
| ~~~~~~^~~~~~~
| |
| void*
a.cc: In function 'char* binary_tree_union(char*, char*)':
a.cc:126:16: error: invalid conversion from 'void*' to 'char*' [-fpermissive]
126 | p=malloc(len);
| ~~~~~~^~~~~
| |
| void*
a.cc:132:17: error: invalid conversion from 'void*' to 'char*' [-fpermissive]
132 | p=malloc(len);
| ~~~~~~^~~~~
| |
| void*
a.cc:138:19: error: invalid conversion from 'void*' to 'char*' [-fpermissive]
138 | p=malloc(len);
| ~~~~~~^~~~~
| |
| void*
a.cc: In function 'char* binary_tree_intersect(char*, char*)':
a.cc:160:19: error: invalid conversion from 'void*' to 'char*' [-fpermissive]
160 | p=malloc(len);
| ~~~~~~^~~~~
| |
| void*
a.cc: At global scope:
a.cc:174:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
174 | main()
| ^~~~
a.cc: In function 'char* left_node(char*)':
a.cc:44:1: warning: control reaches end of non-void function [-Wreturn-type]
44 | }
| ^
a.cc: In function 'char* right_node(char*)':
a.cc:62:1: warning: control reaches end of non-void function [-Wreturn-type]
62 | }
| ^
|
s971347567 | p00587 | C++ | #include <iostream>
#include <boost/shared_ptr.hpp>
#include <boost/make_shared.hpp>
using namespace std;
struct bad_input { };
struct Node;
typedef boost::shared_ptr<Node> NodePtr;
struct Node {
NodePtr left;
NodePtr right;
};
void show_intersection_tree(NodePtr root1, NodePtr root2)
{
std::cout << '(';
if (root1->left && root2->left) {
show_intersection_tree(root1->left, root2->left);
}
std::cout << ',';
if (root1->right && root2->right) {
show_intersection_tree(root1->right, root2->right);
}
std::cout << ')';
}
void show_union_tree(NodePtr root1, NodePtr root2)
{
std::cout << '(';
if ((root1 && root1->left) || (root2 && root2->left)) {
show_union_tree(root1 ? root1->left : root1, root2 ? root2->left : root2);
}
std::cout << ',';
if ((root1 && root1->right) || (root2 && root2->right)) {
show_union_tree(root1 ? root1->right : root1, root2 ? root2->right : root2);
}
std::cout << ')';
}
char get_token()
{
char c;
while (std::cin >> c) {
if (c == '(' || c == ',' || c == ')') {
break;
}
if (c != '\n' && c != ' ') {
throw bad_input();
}
}
return c;
}
NodePtr make_node(int no)
{
NodePtr node = boost::make_shared<Node>();
char c = get_token();
if (c == '(') {
node->left = make_node(no + 1);
c = get_token();
}
if (c == ',') {
}
else {
throw bad_input();
}
c = get_token();
if (c == '(') {
node->right = make_node(no + 1);
c = get_token();
}
if (c == ')') {
}
else {
throw bad_input();
}
return node;
}
int main()
{
char op;
while (std::cin >> op) {
NodePtr root1, root2;
if (get_token() == '(') {
root1 = make_node(0);
}
else {
throw bad_input();
}
if (get_token() == '(') {
root2 = make_node(0);
}
else {
throw bad_input();
}
if (op == 'i') {
if (root1 && root2) {
show_intersection_tree(root1, root2);
}
}
else if (op == 'u') {
if (root1 || root2) {
show_union_tree(root1, root2);
}
}
std::cout << std::endl;
}
return 0;
} | a.cc:2:10: fatal error: boost/shared_ptr.hpp: No such file or directory
2 | #include <boost/shared_ptr.hpp>
| ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
|
s949227584 | p00587 | C++ | #include <iostream>
#include <boost/shared_ptr.hpp>
using namespace std;
struct bad_input { };
struct Node;
typedef boost::shared_ptr<Node> NodePtr;
struct Node {
NodePtr left;
NodePtr right;
};
void show_intersection_tree(NodePtr root1, NodePtr root2)
{
std::cout << '(';
if (root1->left && root2->left) {
show_intersection_tree(root1->left, root2->left);
}
std::cout << ',';
if (root1->right && root2->right) {
show_intersection_tree(root1->right, root2->right);
}
std::cout << ')';
}
void show_union_tree(NodePtr root1, NodePtr root2)
{
std::cout << '(';
if ((root1 && root1->left) || (root2 && root2->left)) {
show_union_tree(root1 ? root1->left : root1, root2 ? root2->left : root2);
}
std::cout << ',';
if ((root1 && root1->right) || (root2 && root2->right)) {
show_union_tree(root1 ? root1->right : root1, root2 ? root2->right : root2);
}
std::cout << ')';
}
char get_token()
{
char c;
while (std::cin >> c) {
if (c == '(' || c == ',' || c == ')') {
break;
}
if (c != '\n' && c != ' ') {
throw bad_input();
}
}
return c;
}
NodePtr make_node(int no)
{
NodePtr node = boost::make_shared<Node>();
char c = get_token();
if (c == '(') {
node->left = make_node(no + 1);
c = get_token();
}
if (c == ',') {
}
else {
throw bad_input();
}
c = get_token();
if (c == '(') {
node->right = make_node(no + 1);
c = get_token();
}
if (c == ')') {
}
else {
throw bad_input();
}
return node;
}
int main()
{
char op;
while (std::cin >> op) {
NodePtr root1, root2;
if (get_token() == '(') {
root1 = make_node(0);
}
else {
throw bad_input();
}
if (get_token() == '(') {
root2 = make_node(0);
}
else {
throw bad_input();
}
if (op == 'i') {
if (root1 && root2) {
show_intersection_tree(root1, root2);
}
}
else if (op == 'u') {
if (root1 || root2) {
show_union_tree(root1, root2);
}
}
std::cout << std::endl;
}
return 0;
} | a.cc:2:10: fatal error: boost/shared_ptr.hpp: No such file or directory
2 | #include <boost/shared_ptr.hpp>
| ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
|
s189637222 | p00587 | C++ | #include <iostream>
#include <cstdio>
#include <string>
#include <string.h>
using namespace std;
#define maxn 10005
char a[maxn],b[maxn];
struct Node
{
int out;
int l,r;
Node()
{
out=l=r=-1;
}
}x[maxn],y[maxn];
//int Build(string cur,int id,int f)
//{
// 蟒コ遶狗ャャ荳?「玲?
// if(f==0)
// {
// if(cur=="")return -1;
// int t=1;
// string t1,t2;
// for(int i=1; i<cur.size(); i++)
// {
// if(cur[i]=='(')
// {
// t++;
// }
// else if(cur[i]==',')
// {
// if(t==1)
// {
// x[id].l=Build(t1,id+1,f);
// for(int j=i+1; j<cur.size()-1; j++)
// {
// t2+=cur[j];
// }
// x[id].r=Build(t2,id+2,f);
// break;
// }
// }
// else if(cur[i]==')')
// {
// t--;
// }
// t1+=cur[i];
// }
// }
// 蟒コ遶狗ャャ荳?「玲?
// else
// {
// if(cur=="")return -1;
// int t=1;
// string t1,t2;
// for(int i=1; i<cur.size(); i++)
// {
// if(cur[i]=='(')
// {
// t++;
// }
// else if(cur[i]==',')
// {
// if(t==1)
// {
// y[id].l=Build(t1,id+1,f);
// for(int j=i+1; j<cur.size()-1; j++)
// {
// t2+=cur[j];
// }
// y[id].r=Build(t2,id+2,f);
// break;
// }
// }
// else if(cur[i]==')')
// {
// t--;
// }
// t1+=cur[i];
// }
// }
// return id;
//}
void Out(int ix,int iy,char ch)
{
if(ch=='i')//荳? {
if(ix==-1||iy==-1)
{
return;
}
printf("(");
if(x[ix].l!=-1&&y[iy].l!=-1)
{
Out(x[ix].l,y[iy].l,ch);
}
printf(",");
if(x[ix].r!=-1&&y[iy].r!=-1)
{
Out(x[ix].r,y[iy].r,ch);
}
printf(")");
}
else
{
if(ix!=-1&&iy!=-1)//蜷梧慮驛ス譛? {
printf("(");
Out(x[ix].l,y[iy].l,ch);
printf(",");
Out(x[ix].r,y[iy].r,ch);
printf(")");
}
if(ix==-1&&iy!=-1)//iy譛? {
printf("(");
Out(-1,y[iy].l,ch);
printf(",");
Out(-1,y[iy].r,ch);
printf(")");
}
if(ix!=-1&&iy==-1)//ix譛? {
printf("(");
Out(x[ix].l,-1,ch);
printf(",");
Out(x[ix].r,-1,ch);
printf(")");
}
}
}
int main()
{
char ch;
while(scanf("%c%s%s",&ch,a,b)!=EOF)
{
getchar();
for(int i=0; i<maxn; i++)
{
x[i].out=x[i].l=x[i].r=-1;
y[i].out=y[i].l=y[i].r=-1;
}
string s1=a;
string s2=b;
// Build(s1,0,0);
// Build(s2,0,1);
Out(0,0,ch);
printf("\n");
}
return 0;
} | a.cc:104:5: error: expected unqualified-id before 'else'
104 | else
| ^~~~
a.cc:113:9: error: expected unqualified-id before 'if'
113 | if(ix==-1&&iy!=-1)//iy譛? {
| ^~
a.cc:115:16: error: expected constructor, destructor, or type conversion before '(' token
115 | Out(-1,y[iy].l,ch);
| ^
a.cc:116:19: error: expected constructor, destructor, or type conversion before '(' token
116 | printf(",");
| ^
a.cc:117:16: error: expected constructor, destructor, or type conversion before '(' token
117 | Out(-1,y[iy].r,ch);
| ^
a.cc:118:19: error: expected constructor, destructor, or type conversion before '(' token
118 | printf(")");
| ^
a.cc:119:9: error: expected declaration before '}' token
119 | }
| ^
a.cc:120:9: error: expected unqualified-id before 'if'
120 | if(ix!=-1&&iy==-1)//ix譛? {
| ^~
a.cc:122:16: error: expected constructor, destructor, or type conversion before '(' token
122 | Out(x[ix].l,-1,ch);
| ^
a.cc:123:19: error: expected constructor, destructor, or type conversion before '(' token
123 | printf(",");
| ^
a.cc:124:16: error: expected constructor, destructor, or type conversion before '(' token
124 | Out(x[ix].r,-1,ch);
| ^
a.cc:125:19: error: expected constructor, destructor, or type conversion before '(' token
125 | printf(")");
| ^
a.cc:126:9: error: expected declaration before '}' token
126 | }
| ^
a.cc:127:5: error: expected declaration before '}' token
127 | }
| ^
a.cc:128:1: error: expected declaration before '}' token
128 | }
| ^
|
s975242501 | p00587 | C++ | class Node
attr_reader :left, :right
def initialize(left,right)
@left = left
@right = right
end
def to_s
"(#{@left||""},#{@right||""})"
end
end
class Parser
def initialize(str)
@str = str
@idx = 0
end
def read
if @str[@idx] == ?(
@idx += 1
l = read
@idx += 1
r = read
@idx += 1
Node.new(l,r)
else
nil
end
end
end
def its (a,b)
if a && b
Node.new(its(a.left,b.left),its(a.right,b.right))
else
nil
end
end
def uni (a,b)
if !a
b
elsif !b
a
else
Node.new(uni(a.left,b.left),uni(a.right,b.right))
end
end
while line = gets
ch, a, b = line.split
c = Parser.new(a).read
d = Parser.new(b).read
if ch=="i"
puts its(c,d)
elsif ch=="u"
puts uni(c,d)
end
end | a.cc:4:5: error: stray '@' in program
4 | @left = left
| ^
a.cc:5:5: error: stray '@' in program
5 | @right = right
| ^
a.cc:14:5: error: stray '@' in program
14 | @str = str
| ^
a.cc:15:5: error: stray '@' in program
15 | @idx = 0
| ^
a.cc:18:8: error: stray '@' in program
18 | if @str[@idx] == ?(
| ^
a.cc:18:13: error: stray '@' in program
18 | if @str[@idx] == ?(
| ^
a.cc:19:7: error: stray '@' in program
19 | @idx += 1
| ^
a.cc:21:7: error: stray '@' in program
21 | @idx += 1
| ^
a.cc:23:7: error: stray '@' in program
23 | @idx += 1
| ^
a.cc:2:15: error: found ':' in nested-name-specifier, expected '::'
2 | attr_reader :left, :right
| ^
| ::
a.cc:2:3: error: 'attr_reader' has not been declared
2 | attr_reader :left, :right
| ^~~~~~~~~~~
a.cc:2:16: error: aggregate 'Node left' has incomplete type and cannot be defined
2 | attr_reader :left, :right
| ^~~~
a.cc:2:22: error: expected unqualified-id before ':' token
2 | attr_reader :left, :right
| ^
|
s485613423 | p00587 | C++ |
else
return max(strL, strR);
}
string sL1, sL2, sR1, sR2;
divide(strL, sL1, sL2);
divide(strR, sR1, sR2)
return "(" + solve(op, sL1, sL2) + "," + solve(op, s2, t2) + ")";
}
int main() { | a.cc:2:5: error: expected unqualified-id before 'else'
2 | else
| ^~~~
a.cc:4:3: error: expected declaration before '}' token
4 | }
| ^
a.cc:6:3: error: 'string' does not name a type
6 | string sL1, sL2, sR1, sR2;
| ^~~~~~
a.cc:7:9: error: expected constructor, destructor, or type conversion before '(' token
7 | divide(strL, sL1, sL2);
| ^
a.cc:8:9: error: expected constructor, destructor, or type conversion before '(' token
8 | divide(strR, sR1, sR2)
| ^
a.cc:11:1: error: expected declaration before '}' token
11 | }
| ^
a.cc: In function 'int main()':
a.cc:13:13: error: expected '}' at end of input
13 | int main() {
| ~^
|
s551559872 | p00587 | C++ | #include <iostream>
using namespace std;
int main() {
}
s | a.cc:6:2: error: 's' does not name a type
6 | s
| ^
|
s699013742 | p00587 | C++ | #include <iostream>
using namespace std;
int main() {
}
s | a.cc:6:2: error: 's' does not name a type
6 | s
| ^
|
s100353045 | p00587 | C++ | #include <iostream>
using namespace std;
int main() {
}
s | a.cc:6:2: error: 's' does not name a type
6 | s
| ^
|
s297654480 | p00587 | C++ | #include <iostream>
using namespace std;
int main() {
}
s | a.cc:6:2: error: 's' does not name a type
6 | s
| ^
|
s898335967 | p00587 | C++ | #include <iostream>
using namespace std;
int main() {
}
s | a.cc:6:2: error: 's' does not name a type
6 | s
| ^
|
s061921274 | p00587 | C++ | #include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <set>
#include <boost/format.hpp>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,j) FOR(i,0,j)
#define mp std::make_pair
const int INF = 1 << 24;
const int dx[8] = {0, 0, 1, -1, 1, 1, -1, -1}, dy[8] = {1, -1, 0, 0, 1, -1, 1, -1};
typedef unsigned long long ull;
typedef std::pair<std::string,std::string> P;
std::string substring(std::string s, int begin, int end){
return s.substr(begin, end-begin);
}
P child(std::string tree){
P res;
int parLevel = 0;
for(int i=1;i<tree.size()-1;i++){
if(tree[i] == '('){
parLevel++;
}else if(tree[i] == ')'){
parLevel--;
}else if(tree[i] == ',' && !parLevel){
res.first = substring(tree, 1, i);
res.second = substring(tree, i+1, tree.size()-1);
}
}
return res;
}
std::string Union(std::string a, std::string b){
P a_child = child(a), b_child = child(b);
std::string
al_child = a_child.first,
ar_child = a_child.second,
bl_child = b_child.first,
br_child = b_child.second,
l_child = "",
r_child = "";
// std::cout << boost::format("%1% %2%") % al_child % ar_child << std::endl;
// std::cout << boost::format("%1% %2%") % bl_child % br_child << std::endl;
if(al_child != "" && bl_child == ""){
l_child = al_child;
}else if(al_child == "" && bl_child != ""){
l_child = bl_child;
}else if(al_child != "" && bl_child != ""){
l_child = Union(al_child, bl_child);
}
if(ar_child != "" && br_child == ""){
r_child = ar_child;
}else if(ar_child == "" && br_child != ""){
r_child = br_child;
}else if(ar_child != "" && br_child != ""){
r_child = Union(ar_child, br_child);
}
// std::cout << "Result: " << "(" + l_child + "," + r_child + ")" << std::endl;
return "(" + l_child + "," + r_child + ")";
}
std::string Intersection(std::string a, std::string b){
P a_child = child(a), b_child = child(b);
std::string
al_child = a_child.first,
ar_child = a_child.second,
bl_child = b_child.first,
br_child = b_child.second,
l_child = "",
r_child = "";
if(al_child != "" && bl_child != ""){
l_child = Intersection(al_child, bl_child);
}
if(ar_child != "" && br_child != ""){
r_child = Intersection(ar_child, br_child);
}
return "(" + l_child + "," + r_child + ")";
}
int main(){
char c;
std::string a, b;
while(std::cin >> c >> a >> b, !std::cin.eof()){
if(c == 'u'){
std::cout << Union(a, b) << std::endl;
}else if(c == 'i'){
std::cout << Intersection(a, b) << std::endl;
}
}
} | a.cc:10:10: fatal error: boost/format.hpp: No such file or directory
10 | #include <boost/format.hpp>
| ^~~~~~~~~~~~~~~~~~
compilation terminated.
|
s300224450 | p00587 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <sstream>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <numeric>
#include <cctype>
#include <tuple>
#ifdef _MSC_VER
#include <agents.h>
#endif
#define FOR(i, a, b) for(int i = (a); i < (int)(b); ++i)
#define rep(i, n) FOR(i, 0, n)
#define ALL(v) begin(v), end(v)
#define REV(v) rbegin(v), rend(v)
#define MEMSET(v, s) memset(v, s, sizeof(v))
#define X first
#define Y second
using namespace std;
using ll = long long;
using P = pair<int, int>;
string tree(const string &s, int &pos){
string chl, chr;
++pos;
if (s[pos] == '(') chl = tree(s, pos);
++pos;
if (s[pos] == '(') chr = tree(s, pos);
++pos;
return "(" + chl + "," + chr + ")";
}
char c;
string a, b;
int p1, p2;
string and(){
++p1, ++p2;
string chl, chr;
if (a[p1] == '(' && b[p2] == '('){
chl = and();
}
else if (a[p1] == '('){
tree(a, p1);
}
else if (b[p2] == '('){
tree(b, p2);
}
++p1, ++p2;
if (a[p1] == '(' && b[p2] == '('){
chr = and();
}
else if (a[p1] == '('){
tree(a, p1);
}
else if (b[p2] == '('){
tree(b, p2);
}
++p1, ++p2;
return "(" + chl + "," + chr + ")";
}
string or(){
++p1, ++p2;
string chl, chr;
if (a[p1] == '(' && b[p2] == '('){
chl = or();
}
else if (a[p1] == '('){
chl = tree(a, p1);
}
else if (b[p2] == '('){
chl = tree(b, p2);
}
++p1, ++p2;
if (a[p1] == '(' && b[p2] == '('){
chr = and();
}
else if (a[p1] == '('){
chr = tree(a, p1);
}
else if (b[p2] == '('){
chr = tree(b, p2);
}
++p1, ++p2;
return "(" + chl + "," + chr + ")";
}
int main(){
while (cin >> c >> a >> b){
p1 = p2 = 0;
if (c == 'i') cout << and() << endl;
else cout << or() << endl;
}
return 0;
} | a.cc:49:12: error: expected unqualified-id before ')' token
49 | string and(){
| ^
a.cc:80:8: error: expected unqualified-id before 'or' token
80 | string or(){
| ^~
a.cc: In function 'int main()':
a.cc:115:42: error: expected identifier before '(' token
115 | if (c == 'i') cout << and() << endl;
| ^
a.cc:116:30: error: expected primary-expression before 'or' token
116 | else cout << or() << endl;
| ^~
a.cc:116:33: error: expected primary-expression before ')' token
116 | else cout << or() << endl;
| ^
|
s746868997 | p00587 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <sstream>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <numeric>
#include <cctype>
#include <tuple>
#ifdef _MSC_VER
#include <agents.h>
#endif
#define FOR(i, a, b) for(int i = (a); i < (int)(b); ++i)
#define rep(i, n) FOR(i, 0, n)
#define ALL(v) begin(v), end(v)
#define REV(v) rbegin(v), rend(v)
#define MEMSET(v, s) memset(v, s, sizeof(v))
#define X first
#define Y second
using namespace std;
string tree(const string &s, int &pos){
string chl, chr;
++pos;
if (s[pos] == '(') chl = tree(s, pos);
++pos;
if (s[pos] == '(') chr = tree(s, pos);
++pos;
return "(" + chl + "," + chr + ")";
}
char c;
string a, b;
int p1, p2;
string and(){
++p1, ++p2;
string chl, chr;
if (a[p1] == '(' && b[p2] == '('){
chl = and();
}
else if (a[p1] == '('){
tree(a, p1);
}
else if (b[p2] == '('){
tree(b, p2);
}
++p1, ++p2;
if (a[p1] == '(' && b[p2] == '('){
chr = and();
}
else if (a[p1] == '('){
tree(a, p1);
}
else if (b[p2] == '('){
tree(b, p2);
}
++p1, ++p2;
return "(" + chl + "," + chr + ")";
}
string or(){
++p1, ++p2;
string chl, chr;
if (a[p1] == '(' && b[p2] == '('){
chl = or();
}
else if (a[p1] == '('){
chl = tree(a, p1);
}
else if (b[p2] == '('){
chl = tree(b, p2);
}
++p1, ++p2;
if (a[p1] == '(' && b[p2] == '('){
chr = and();
}
else if (a[p1] == '('){
chr = tree(a, p1);
}
else if (b[p2] == '('){
chr = tree(b, p2);
}
++p1, ++p2;
return "(" + chl + "," + chr + ")";
}
int main(){
while (cin >> c >> a >> b){
p1 = p2 = 0;
if (c == 'i') cout << and() << endl;
else cout << or() << endl;
}
return 0;
} | a.cc:46:12: error: expected unqualified-id before ')' token
46 | string and(){
| ^
a.cc:77:8: error: expected unqualified-id before 'or' token
77 | string or(){
| ^~
a.cc: In function 'int main()':
a.cc:112:42: error: expected identifier before '(' token
112 | if (c == 'i') cout << and() << endl;
| ^
a.cc:113:30: error: expected primary-expression before 'or' token
113 | else cout << or() << endl;
| ^~
a.cc:113:33: error: expected primary-expression before ')' token
113 | else cout << or() << endl;
| ^
|
s499555423 | p00587 | C++ | #include "set>.cpp"
#include "set>.cpp" | a.cc:1:10: fatal error: set>.cpp: No such file or directory
1 | #include "set>.cpp"
| ^~~~~~~~~~
compilation terminated.
|
s438857700 | p00587 | C++ | #include "set>.cpp"
#include "set>.cpp"
#include <iostream>
int main(){
while(1){
}
} | a.cc:1:10: fatal error: set>.cpp: No such file or directory
1 | #include "set>.cpp"
| ^~~~~~~~~~
compilation terminated.
|
s276656484 | p00587 | C++ | #include "set>.cpp"
#include "set>.cpp"
#include <iostream>
template<class T>class L{L<T*>operator->()};L<int>i=i->
int main(){
while(1){
}
} | a.cc:1:10: fatal error: set>.cpp: No such file or directory
1 | #include "set>.cpp"
| ^~~~~~~~~~
compilation terminated.
|
s552621573 | p00587 | C++ | #include <iostream>
template<class T>class L{L<T*>operator->()};L<int>i=i->
int main(){
while(1){
}
} | a.cc:2:42: error: expected ';' at end of member declaration
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^
| ;
a.cc:2:54: error: 'L<T*> L<T>::operator->() [with T = int]' is private within this context
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~
a.cc:2:31: note: declared private here
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~~~~~~~
a.cc: In instantiation of 'L<T*> L<T>::operator->() [with T = int]':
a.cc:2:54: required from here
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~
a.cc:2:54: error: 'L<T*> L<T>::operator->() [with T = int*]' is private within this context
a.cc:2:31: note: declared private here
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~~~~~~~
a.cc:2:54: error: 'L<T*> L<T>::operator->() [with T = int**]' is private within this context
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~
a.cc:2:31: note: declared private here
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~~~~~~~
a.cc:2:54: error: 'L<T*> L<T>::operator->() [with T = int***]' is private within this context
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~
a.cc:2:31: note: declared private here
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~~~~~~~
a.cc:2:54: error: 'L<T*> L<T>::operator->() [with T = int****]' is private within this context
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~
a.cc:2:31: note: declared private here
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~~~~~~~
a.cc:2:54: error: 'L<T*> L<T>::operator->() [with T = int*****]' is private within this context
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~
a.cc:2:31: note: declared private here
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~~~~~~~
a.cc:2:54: error: 'L<T*> L<T>::operator->() [with T = int******]' is private within this context
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~
a.cc:2:31: note: declared private here
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~~~~~~~
a.cc:2:54: error: 'L<T*> L<T>::operator->() [with T = int*******]' is private within this context
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~
a.cc:2:31: note: declared private here
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~~~~~~~
a.cc:2:54: error: 'L<T*> L<T>::operator->() [with T = int********]' is private within this context
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~
a.cc:2:31: note: declared private here
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~~~~~~~
a.cc:2:54: error: 'L<T*> L<T>::operator->() [with T = int*********]' is private within this context
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~
a.cc:2:31: note: declared private here
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~~~~~~~
a.cc:2:54: error: 'L<T*> L<T>::operator->() [with T = int**********]' is private within this context
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~
a.cc:2:31: note: declared private here
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~~~~~~~
a.cc:2:54: error: 'L<T*> L<T>::operator->() [with T = int***********]' is private within this context
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~
a.cc:2:31: note: declared private here
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~~~~~~~
a.cc:2:54: error: 'L<T*> L<T>::operator->() [with T = int************]' is private within this context
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~
a.cc:2:31: note: declared private here
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~~~~~~~
a.cc:2:54: error: 'L<T*> L<T>::operator->() [with T = int*************]' is private within this context
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~
a.cc:2:31: note: declared private here
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~~~~~~~
a.cc:2:54: error: 'L<T*> L<T>::operator->() [with T = int**************]' is private within this context
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~
a.cc:2:31: note: declared private here
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~~~~~~~
a.cc:2:54: error: 'L<T*> L<T>::operator->() [with T = int***************]' is private within this context
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~
a.cc:2:31: note: declared private here
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~~~~~~~
a.cc:2:54: error: 'L<T*> L<T>::operator->() [with T = int****************]' is private within this context
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~
a.cc:2:31: note: declared private here
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~~~~~~~
a.cc:2:54: error: 'L<T*> L<T>::operator->() [with T = int*****************]' is private within this context
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~
a.cc:2:31: note: declared private here
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~~~~~~~
a.cc:2:54: error: 'L<T*> L<T>::operator->() [with T = int******************]' is private within this context
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~
a.cc:2:31: note: declared private here
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~~~~~~~
a.cc:2:54: error: 'L<T*> L<T>::operator->() [with T = int*******************]' is private within this context
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~
a.cc:2:31: note: declared private here
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~~~~~~~
a.cc:2:54: error: 'L<T*> L<T>::operator->() [with T = int********************]' is private within this context
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~
a.cc:2:31: note: declared private here
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~~~~~~~
a.cc:2:54: error: 'L<T*> L<T>::operator->() [with T = int*********************]' is private within this context
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~
a.cc:2:31: note: declared private here
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~~~~~~~
a.cc:2:54: error: 'L<T*> L<T>::operator->() [with T = int**********************]' is private within this context
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~
a.cc:2:31: note: declared private here
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~~~~~~~
a.cc:2:54: error: 'L<T*> L<T>::operator->() [with T = int***********************]' is private within this context
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~
a.cc:2:31: note: declared private here
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~~~~~~~
a.cc:2:54: error: 'L<T*> L<T>::operator->() [with T = int************************]' is private within this context
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~
a.cc:2:31: note: declared private here
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~~~~~~~
a.cc:2:54: error: 'L<T*> L<T>::operator->() [with T = int*************************]' is private within this context
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~
a.cc:2:31: note: declared private here
2 | template<class T>class L{L<T*>operator->()};L<int>i=i->
| ^~~ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.