submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s634014459
p00094
C++
#include<iostream> #include<math.h> #include<vector> #include<algorithm> #include<cstdio> using namespace std; int main() { int a, b; cin >> a >> b; cout << fixed << setprecision(10) << a * b / 3.305785 << endl; }
a.cc: In function 'int main()': a.cc:11:20: error: 'setprecision' was not declared in this scope 11 | cout << fixed << setprecision(10) << a * b / 3.305785 << endl; | ^~~~~~~~~~~~ a.cc:6:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>' 5 | #include<cstdio> +++ |+#include <iomanip> 6 | using namespace std;
s200473683
p00094
C++
/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
s951915707
p00094
C++
/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
s939117610
p00094
C++
/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
s878620590
p00094
C++
#include <iostream> #include <math.h> using namespace std; int main(void) { int a, b; double S; cin >> a >> b; S = a * b / 3.305785; cout << fixed << setprecision(6) << S << endl; return 0; }
a.cc: In function 'int main()': a.cc:10:26: error: 'setprecision' was not declared in this scope 10 | cout << fixed << setprecision(6) << S << endl; | ^~~~~~~~~~~~ a.cc:3:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>' 2 | #include <math.h> +++ |+#include <iomanip> 3 | using namespace std;
s583550926
p00094
C++
#include<iostream> using namespace std; int main() { cin>>x>>y; cout<<(x+y)/3.305785<<endl; return 0; }
a.cc: In function 'int main()': a.cc:6:7: error: 'x' was not declared in this scope 6 | cin>>x>>y; | ^ a.cc:6:10: error: 'y' was not declared in this scope 6 | cin>>x>>y; | ^
s967205845
p00094
C++
#include<iostream> using namespace std; int main() { while(true) { cin>>x>>y; } cout<<(x+y)/3.305785<<endl; return 0; }
a.cc: In function 'int main()': a.cc:8:7: error: 'x' was not declared in this scope 8 | cin>>x>>y; | ^ a.cc:8:10: error: 'y' was not declared in this scope 8 | cin>>x>>y; | ^ a.cc:10:9: error: 'x' was not declared in this scope 10 | cout<<(x+y)/3.305785<<endl; | ^ a.cc:10:11: error: 'y' was not declared in this scope 10 | cout<<(x+y)/3.305785<<endl; | ^
s512132434
p00094
C++
#include<iostream> using namespace std; int main() { while(true) { cin>>x>>y; } cout<<(x+y)/3.305785<<endl; return 0; }
a.cc: In function 'int main()': a.cc:8:7: error: 'x' was not declared in this scope 8 | cin>>x>>y; | ^ a.cc:8:10: error: 'y' was not declared in this scope 8 | cin>>x>>y; | ^ a.cc:10:9: error: 'x' was not declared in this scope 10 | cout<<(x+y)/3.305785<<endl; | ^ a.cc:10:11: error: 'y' was not declared in this scope 10 | cout<<(x+y)/3.305785<<endl; | ^
s704283858
p00094
C++
#include<iostream> #include<iomanip> using namespace std; int main() { int x,y; cin>>x>>y; cout<<precision(6)<<(x+y)/3.305785<<endl; return 0; }
a.cc: In function 'int main()': a.cc:9:8: error: 'precision' was not declared in this scope 9 | cout<<precision(6)<<(x+y)/3.305785<<endl; | ^~~~~~~~~
s906950398
p00094
C++
#include<iostream> using namespae std; int main() { int x,y; cin>>x>>y; cout<<(x*y)/3.305785<<endl; return 0; }
a.cc:2:7: error: expected nested-name-specifier before 'namespae' 2 | using namespae std; | ^~~~~~~~ a.cc: In function 'int main()': a.cc:7:2: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 7 | cin>>x>>y; | ^~~ | 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:8:2: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 8 | cout<<(x*y)/3.305785<<endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:8:24: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 8 | cout<<(x*y)/3.305785<<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) | ^~~~
s076920057
p00094
C++
include<iostream> #include<cstdio> using namespace std; int main(void){ double a,b; cin >> a >> b; printf("%.6f\n",a*b/3.305785); return 0; }
a.cc:1:1: error: 'include' does not name a type 1 | include<iostream> | ^~~~~~~ a.cc: In function 'int main()': a.cc:8:3: error: 'cin' was not declared in this scope 8 | cin >> a >> b; | ^~~ a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 2 | #include<cstdio> +++ |+#include <iostream> 3 |
s344102932
p00094
C++
#include <iostream> #include <cstdio> using namespace std; int main (void) { int a, b; double res; cin >> a >> b; res = a * b / 3.305785; printf("%.6lf\n", res) return 0; }
a.cc: In function 'int main()': a.cc:14:25: error: expected ';' before 'return' 14 | printf("%.6lf\n", res) | ^ | ; 15 | 16 | return 0; | ~~~~~~
s655381920
p00094
C++
#include <iostream> #include <cstdio> using namespace std; int main (void) { int a, b; double res; cin >> a >> b; res = a * b / 3.305785; printf("%.6lf\n", res) return 0; }
a.cc: In function 'int main()': a.cc:14:25: error: expected ';' before 'return' 14 | printf("%.6lf\n", res) | ^ | ; 15 | 16 | return 0; | ~~~~~~
s164688846
p00094
C++
#include <iostream> using namespace std; int main() { int a, b; cin >> a >> b; cout >> a*b/3.305785 >> "hogehogehogebakbakbaka"; return 0; }
a.cc: In function 'int main()': a.cc:8:8: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'double') 8 | cout >> a*b/3.305785 >> "hogehogehogebakbakbaka"; | ~~~~ ^~ ~~~~~~~~~~~~ | | | | | double | std::ostream {aka std::basic_ostream<char>} In file included from /usr/include/c++/14/string:55, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 835 | operator>>(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed: a.cc:8:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 8 | cout >> a*b/3.305785 >> "hogehogehogebakbakbaka"; | ^~~~~~~~ In file included from /usr/include/c++/14/bits/memory_resource.h:38, from /usr/include/c++/14/string:68: /usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)' 131 | operator>>(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed: a.cc:8:3: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 8 | cout >> a*b/3.305785 >> "hogehogehogebakbakbaka"; | ^~~~ In file included from /usr/include/c++/14/istream:1109, from /usr/include/c++/14/iostream:42: /usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)' 978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) | ^~~~~~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed: a.cc:8:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 8 | cout >> a*b/3.305785 >> "hogehogehogebakbakbaka"; | ^~~~~~~~ /usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)' 849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed: a.cc:8:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 8 | cout >> a*b/3.305785 >> "hogehogehogebakbakbaka"; | ^~~~~~~~ /usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)' 854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed: a.cc:8:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 8 | cout >> a*b/3.305785 >> "hogehogehogebakbakbaka"; | ^~~~~~~~ /usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)' 896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed: a.cc:8:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 8 | cout >> a*b/3.305785 >> "hogehogehogebakbakbaka"; | ^~~~~~~~ /usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)' 939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed: a.cc:8:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 8 | cout >> a*b/3.305785 >> "hogehogehogebakbakbaka"; | ^~~~~~~~ /usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)' 945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed: a.cc:8:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 8 | cout >> a*b/3.305785 >> "hogehogehogebakbakbaka"; | ^~~~~~~~ /usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ /usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed: /usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = double]': a.cc:8:15: required from here 8 | cout >> a*b/3.305785 >> "hogehogehogebakbakbaka"; | ^~~~~~~~ /usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~
s585929241
p00094
C++
#include <iostream> using namespace std; int main() { int a, b; double c; cin >> a >> b; c = a*b/3.305785; cout >> c >> "hogehogehogebakbakbaka"; return 0; }
a.cc: In function 'int main()': a.cc:9:8: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'double') 9 | cout >> c >> "hogehogehogebakbakbaka"; | ~~~~ ^~ ~ | | | | | double | std::ostream {aka std::basic_ostream<char>} In file included from /usr/include/c++/14/string:55, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 835 | operator>>(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed: a.cc:9:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 9 | cout >> c >> "hogehogehogebakbakbaka"; | ^ In file included from /usr/include/c++/14/bits/memory_resource.h:38, from /usr/include/c++/14/string:68: /usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)' 131 | operator>>(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed: a.cc:9:3: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 9 | cout >> c >> "hogehogehogebakbakbaka"; | ^~~~ In file included from /usr/include/c++/14/istream:1109, from /usr/include/c++/14/iostream:42: /usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)' 978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) | ^~~~~~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed: a.cc:9:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 9 | cout >> c >> "hogehogehogebakbakbaka"; | ^ /usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)' 849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed: a.cc:9:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 9 | cout >> c >> "hogehogehogebakbakbaka"; | ^ /usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)' 854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed: a.cc:9:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 9 | cout >> c >> "hogehogehogebakbakbaka"; | ^ /usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)' 896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed: a.cc:9:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 9 | cout >> c >> "hogehogehogebakbakbaka"; | ^ /usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)' 939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed: a.cc:9:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 9 | cout >> c >> "hogehogehogebakbakbaka"; | ^ /usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)' 945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed: a.cc:9:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 9 | cout >> c >> "hogehogehogebakbakbaka"; | ^ /usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ /usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed: /usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = double&]': a.cc:9:11: required from here 9 | cout >> c >> "hogehogehogebakbakbaka"; | ^ /usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~
s946197991
p00094
C++
#include <iostream> #include <cstdio> using namespace std; int main() { int a, b; double c; cin >> a >> b; c = a*b/3.305785; printf("%ld", c); cout >> "hogehogehogebakbakbaka"; return 0; }
a.cc: In function 'int main()': a.cc:11:8: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'const char [23]') 11 | cout >> "hogehogehogebakbakbaka"; | ~~~~ ^~ ~~~~~~~~~~~~~~~~~~~~~~~~ | | | | | const char [23] | std::ostream {aka std::basic_ostream<char>} In file included from /usr/include/c++/14/string:55, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 835 | operator>>(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed: a.cc:11:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 11 | cout >> "hogehogehogebakbakbaka"; | ^~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/bits/memory_resource.h:38, from /usr/include/c++/14/string:68: /usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)' 131 | operator>>(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed: a.cc:11:3: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 11 | cout >> "hogehogehogebakbakbaka"; | ^~~~ In file included from /usr/include/c++/14/istream:1109, from /usr/include/c++/14/iostream:42: /usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)' 978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) | ^~~~~~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed: a.cc:11:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 11 | cout >> "hogehogehogebakbakbaka"; | ^~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)' 849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed: a.cc:11:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 11 | cout >> "hogehogehogebakbakbaka"; | ^~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)' 854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed: a.cc:11:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 11 | cout >> "hogehogehogebakbakbaka"; | ^~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)' 896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed: a.cc:11:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 11 | cout >> "hogehogehogebakbakbaka"; | ^~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)' 939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed: a.cc:11:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 11 | cout >> "hogehogehogebakbakbaka"; | ^~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)' 945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed: a.cc:11:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 11 | cout >> "hogehogehogebakbakbaka"; | ^~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ /usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed: /usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = const char (&)[23]]': a.cc:11:11: required from here 11 | cout >> "hogehogehogebakbakbaka"; | ^~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~
s197937673
p00094
C++
#include <iostream> using namespace std; int main(){ double a,b; int c; cin>>a>>b; c=a*b/3.305785 cout<<c<<endl; return 0; }
a.cc: In function 'int main()': a.cc:7:15: error: expected ';' before 'cout' 7 | c=a*b/3.305785 | ^ | ; 8 | cout<<c<<endl; | ~~~~
s428128724
p00094
C++
#include <iostream> using namespace std; int main(){ int a,b,c; cin>>a>>b; c=a*b/3.305785 cout<<c<<endl; return 0; }
a.cc: In function 'int main()': a.cc:6:15: error: expected ';' before 'cout' 6 | c=a*b/3.305785 | ^ | ; 7 | cout<<c<<endl; | ~~~~
s756647079
p00094
C++
#include <iostream> using namespace std; int main(){ double a,b,c; cin>>a>>b; c=(a*b)/3.305785; cout<<showpoint<<setprecision(7)<<c<<endl; return 0; }
a.cc: In function 'int main()': a.cc:7:18: error: 'setprecision' was not declared in this scope 7 | cout<<showpoint<<setprecision(7)<<c<<endl; | ^~~~~~~~~~~~ a.cc:2:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>' 1 | #include <iostream> +++ |+#include <iomanip> 2 | using namespace std;
s718456711
p00094
C++
#include <c.stdio> int main(void) { int a,b; scanf("%d%d",&a,&b); printf("%.15f\n",(double)a*b/3.305785); return 0; }
a.cc:1:10: fatal error: c.stdio: No such file or directory 1 | #include <c.stdio> | ^~~~~~~~~ compilation terminated.
s909804837
p00094
C++
#include <stdio.h> int main(){ float a,b; scanf( "%f %f",&a,&b ); printf( "%f\n",a * b / 3.305785 );
a.cc: In function 'int main()': a.cc:6:39: error: expected '}' at end of input 6 | printf( "%f\n",a * b / 3.305785 ); | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s200174620
p00095
C
#include <stdio.h> int num[100], val[100]; int main(viod) { int i= 0;, n, mmn = 100,maxv = 0; scanf("%d", &n); for (i = 0; i< n; i++){ scanf("%d %d", &num[i], &val[i]); if (maxc < val[i]){ maxv = val[i];} } for (i =0; i< n; i++){ if (maxv == val[i] && minn > num[i]){ minn = num[i]; } } printf("%d %d", minn, maxv); return 0; }
main.c: In function 'main': main.c:4:5: error: type of 'viod' defaults to 'int' [-Wimplicit-int] 4 | int main(viod) | ^~~~ main.c:6:10: error: expected expression before ',' token 6 | int i= 0;, n, mmn = 100,maxv = 0; | ^ main.c:6:12: error: 'n' undeclared (first use in this function) 6 | int i= 0;, n, mmn = 100,maxv = 0; | ^ main.c:6:12: note: each undeclared identifier is reported only once for each function it appears in main.c:6:15: error: 'mmn' undeclared (first use in this function) 6 | int i= 0;, n, mmn = 100,maxv = 0; | ^~~ main.c:6:25: error: 'maxv' undeclared (first use in this function) 6 | int i= 0;, n, mmn = 100,maxv = 0; | ^~~~ main.c:11:5: error: 'maxc' undeclared (first use in this function) 11 | if (maxc < val[i]){ | ^~~~ main.c:15:23: error: 'minn' undeclared (first use in this function) 15 | if (maxv == val[i] && minn > num[i]){ | ^~~~
s935924665
p00095
C
#include<stdio.h> int main(void){ int t,a,v,i,max,num; scanf("%d",&t) max=0; for(i=0;i<t;i++){ scanf("%d%d",&a,&v); if(max<v){ max=v; num=a; } } printf("%d %d\n",num,max); } return 0; }
main.c: In function 'main': main.c:6:15: error: expected ';' before 'max' 6 | scanf("%d",&t) | ^ | ; 7 | max=0; | ~~~ main.c: At top level: main.c:17:1: error: expected identifier or '(' before 'return' 17 | return 0; | ^~~~~~ main.c:18:1: error: expected identifier or '(' before '}' token 18 | } | ^
s150634643
p00095
C
#include<stdio.h> int main(void){ int t,a,v,i,max,num; scanf("%d",&t) max=0; for(i=0;i<t;i++){ scanf("%d%d",&a,&v); if(max<v){ max=v; num=a; } } printf("%d %d\n",num,max); return 0; }
main.c: In function 'main': main.c:6:15: error: expected ';' before 'max' 6 | scanf("%d",&t) | ^ | ; 7 | max=0; | ~~~
s176511175
p00095
C
#include <stdio.h> int main(){ int a,d,b,c,e,i; b=0; scanf("%d",&a); for(i=0;i<a;i++){ scanf("%d %d",&c[i],&d[i]); if(b<d[i]){ b=d[i]; e=c[i]; } printf("%d\n",i); } printf("%d %d\n",e,d); return 0; }
main.c: In function 'main': main.c:8:33: error: subscripted value is neither array nor pointer nor vector 8 | scanf("%d %d",&c[i],&d[i]); | ^ main.c:8:39: error: subscripted value is neither array nor pointer nor vector 8 | scanf("%d %d",&c[i],&d[i]); | ^ main.c:9:23: error: subscripted value is neither array nor pointer nor vector 9 | if(b<d[i]){ | ^ main.c:10:28: error: subscripted value is neither array nor pointer nor vector 10 | b=d[i]; | ^ main.c:11:28: error: subscripted value is neither array nor pointer nor vector 11 | e=c[i]; | ^
s709557978
p00095
C
#include <stdio.h> int main(){ int a,d[100],b,c[100],e,i; b=0; scanf("%d",&a); for(i=0;i<a;i++){ scanf("%d %d",&c,&d; if(b<d){ b=d; e=c; } } printf("%d %d\n",e,b); return 0; }
main.c: In function 'main': main.c:8:36: error: expected ')' before ';' token 8 | scanf("%d %d",&c,&d; | ~ ^ | ) main.c:12:18: error: expected ';' before '}' token 12 | } | ^ | ; 13 | } | ~
s329274253
p00095
C
#include <stdio.h> int main(){ int a,d,b,c,e,i; b=0; scanf("%d",&a); for(i=0;i<a;i++){ scanf("%d %d",&c,&d; if(b<d){ b=d; e=c; } } printf("%d %d\n",e,b); return 0; }
main.c: In function 'main': main.c:8:36: error: expected ')' before ';' token 8 | scanf("%d %d",&c,&d; | ~ ^ | ) main.c:12:18: error: expected ';' before '}' token 12 | } | ^ | ; 13 | } | ~
s440135853
p00095
C
if (v[i] > v[t]){ x = i; }
main.c:1:9: error: expected identifier or '(' before 'if' 1 | if (v[i] > v[t]){ | ^~
s555717049
p00095
C
#include<stdio.h> int main(void){ int number; int a[20],b[20]; int i; int max = 0; int min = 0; int x = 0; scanf("%d",&number); for(i = 0;i < number;i++){ scanf("%d %d",&a[i],&b[i]); if(b[i] > max){ max = b[i]; x = a[i]; } } for(i = 0;i < number;i++;){ if(b[i] == max && a[i] < x){ min = a[i]; } printf("%d %d\n",min,max); return 0; }
main.c: In function 'main': main.c:17:33: error: expected ')' before ';' token 17 | for(i = 0;i < number;i++;){ | ~ ^ | ) main.c:23:1: error: expected declaration or statement at end of input 23 | } | ^
s885747548
p00095
C
6 1 14 2 25 3 42 4 11 5 40 6 37
main.c:1:1: error: expected identifier or '(' before numeric constant 1 | 6 | ^
s740422865
p00095
C
#include<stdio.h> #include <string.h> int main(){ int a, b[20], c[20], i, s = 0, ans; scanf("%d", &a); for(i = 0; i < a; i++){ scanf("%d %d", &b[i], &c[i]); if(s < c[i]){ s = c[i]; ans = i; } } printf("%d %d\n", b[ans], c[ans]) return 0; }
main.c: In function 'main': main.c:14:42: error: expected ';' before 'return' 14 | printf("%d %d\n", b[ans], c[ans]) | ^ | ; 15 | return 0; | ~~~~~~
s127547018
p00095
C
#include<iostream> #include<algorithm> using namespace std; int main(){ int n, a, b; cin >> n; int ra = 1 << 29; int rb = -100; for(int i = 0;i < n;i++){ cin >> a >> b; if(rb < b || rb == b && ra > a){ ra = a; rb = b; } } cout << ra << " " << rb << endl; return 0; }
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s491248549
p00095
C
#include<stdio.h> int main(){ int n,a,v,i,x,y; scanf("%d",&n); x=0; y=0; for(i=0;i<n;i++){ scanf("%d %d",&a,&v); if(y<v){ x=a; y=v; } } if(x==0)[ x=1; y=0; } printf("%d %d\n",x,y); return 0; }
main.c: In function 'main': main.c:14:9: error: expected expression before '[' token 14 | if(x==0)[ | ^ main.c:16:5: error: expected ';' before '}' token 16 | y=0; | ^ | ; 17 | } | ~ main.c: At top level: main.c:18:8: error: expected declaration specifiers or '...' before string constant 18 | printf("%d %d\n",x,y); | ^~~~~~~~~ main.c:18:18: error: unknown type name 'x' 18 | printf("%d %d\n",x,y); | ^ main.c:18:20: error: unknown type name 'y' 18 | printf("%d %d\n",x,y); | ^ main.c:19:1: error: expected identifier or '(' before 'return' 19 | return 0; | ^~~~~~ main.c:20:1: error: expected identifier or '(' before '}' token 20 | } | ^
s805151503
p00095
C++
#include <iostream> using namespace std; int main(){ int n; cin >> n; int max=0; int kouho =0; for(int i=0;i<n;i++){ int a,b; cin >> a >> b; if(max < b){ max = b; kouho = a; } } cout << a << " " << b << endl; }
a.cc: In function 'int main()': a.cc:15:13: error: 'a' was not declared in this scope 15 | cout << a << " " << b << endl; | ^ a.cc:15:25: error: 'b' was not declared in this scope 15 | cout << a << " " << b << endl; | ^
s874655206
p00095
C++
#include<stdio.h> int main(){ int x,y,n; int X=0,Y=0; scanf("%d",&n); for(int i=0;i<n;i++) { scanf("%d %d",&x,&y); if(Y<y){X=x;Y=y} } printf("%d %d\n",X,Y); return 0; }
a.cc: In function 'int main()': a.cc:14:16: error: expected ';' before '}' token 14 | if(Y<y){X=x;Y=y} | ^ | ;
s693917671
p00095
C++
#include <stdio.h> #include <math.h> #include <string.h> #include <stdlib.h> #include <time.h> #include "oki.h" ////////////////*My library*//////////////////////// #define rep_to(a,i,n) for(i=a;i<n;i++) #define rep(i,n) for(i=0;i<n;i++) #define rep_r(i,n) for(i=n-1;i>=0;i--) #define debug_i(x) printf("x:%d\n",x) #define debug_s(str) printf("str:%s\n",str) #define debug_c(c) printf("c:%c\n",c) #define s_i1(x) scanf("%d",&x) #define s_i2(x,y) scanf("%d %d",&x,&y) #define s_i3(x,y,z) scanf("%d %d %d",&x,&y,&z) //////////////////////////////////////////////////// //////////////////////// /*prime()*/ /*primecount()*/ /*sort()*/ /////////////////////// int main() { int i,j,k; int n,q; int x,y,num=0,sd_num=0; double max=0,sd_max=0; int a[100000]={},v[100000]={}; s_i1(n); rep(i,n) { scanf("%d %d",&x,&y); v[x]+=y; num=(max<v[x])? x : num; max=fmax(v[x],max); } printf("%d %d\n",num,(int)max); return 0; }
a.cc:6:10: fatal error: oki.h: No such file or directory 6 | #include "oki.h" | ^~~~~~~ compilation terminated.
s253924840
p00095
C++
#include<stdio.h> int main(void) { int n,a,b,c,i,max,min; max=-1; min=101; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d %d",&a,&b); if(max<b){ max=b; c=a; /* } if(min>c){ min=c; }*/ } printf("%d %d\n",min,max); return 0; }
a.cc: In function 'int main()': a.cc:21:2: error: expected '}' at end of input 21 | } | ^ a.cc:3:1: note: to match this '{' 3 | { | ^
s466687183
p00095
C++
#include <iostream> using namespace std; int main() { int n; int min = 21, max = 0; int a, v; cin >> n; for (int i = 0; i < n; i++){ cin >> a >> v; if (max < v){ max = v; min = a; } else if (max == v){ if (w1 > a){ min = a; } } } cout << w1 << ' ' << max << endl; return (0); }
a.cc: In function 'int main()': a.cc:18:11: error: 'w1' was not declared in this scope 18 | if (w1 > a){ | ^~ a.cc:23:11: error: 'w1' was not declared in this scope 23 | cout << w1 << ' ' << max << endl; | ^~
s345549590
p00095
C++
#include <iostream> #include <vector> typedef pair<int, int> P; using namespace std; void solve(vector<P> v) { int minID, maxNum; minID = v[0].first(); maxNum = v[0].second(); for (int i = 1; i < v.size(); i++) if (v[i].second > maxNum || (v[i].second == maxNum && v[i].first < minID)) { minID = v[i].first(); maxNum = v[i].second(); } cout << minID << " " << maxNum << endl; } int main() { cin.tie(0); ios::sync_with_stdio(false); int n, a, v; cin >> n; vector<P> fish; for (int i = 0; i < n; i++) { cin >> a >> v; fish.push_back(P(a, v)); } solve(fish); }
a.cc:4:9: error: 'pair' does not name a type 4 | typedef pair<int, int> P; | ^~~~ a.cc:8:19: error: 'P' was not declared in this scope 8 | void solve(vector<P> v) { | ^ a.cc:8:20: error: template argument 1 is invalid 8 | void solve(vector<P> v) { | ^ a.cc:8:20: error: template argument 2 is invalid a.cc: In function 'void solve(int)': a.cc:10:18: error: invalid types 'int[int]' for array subscript 10 | minID = v[0].first(); | ^ a.cc:11:19: error: invalid types 'int[int]' for array subscript 11 | maxNum = v[0].second(); | ^ a.cc:12:31: error: request for member 'size' in 'v', which is of non-class type 'int' 12 | for (int i = 1; i < v.size(); i++) | ^~~~ a.cc:13:22: error: invalid types 'int[int]' for array subscript 13 | if (v[i].second > maxNum || (v[i].second == maxNum && v[i].first < minID)) { | ^ a.cc:13:47: error: invalid types 'int[int]' for array subscript 13 | if (v[i].second > maxNum || (v[i].second == maxNum && v[i].first < minID)) { | ^ a.cc:13:72: error: invalid types 'int[int]' for array subscript 13 | if (v[i].second > maxNum || (v[i].second == maxNum && v[i].first < minID)) { | ^ a.cc:14:34: error: invalid types 'int[int]' for array subscript 14 | minID = v[i].first(); | ^ a.cc:15:35: error: invalid types 'int[int]' for array subscript 15 | maxNum = v[i].second(); | ^ a.cc: In function 'int main()': a.cc:28:16: error: 'P' was not declared in this scope 28 | vector<P> fish; | ^ a.cc:28:17: error: template argument 1 is invalid 28 | vector<P> fish; | ^ a.cc:28:17: error: template argument 2 is invalid a.cc:31:22: error: request for member 'push_back' in 'fish', which is of non-class type 'int' 31 | fish.push_back(P(a, v)); | ^~~~~~~~~
s916320469
p00095
C++
#include <iostream> #include <vector> #include <utility> typedef pair<int, int> P; using namespace std; void solve(vector<P> v) { int minID, maxNum; minID = v[0].first(); maxNum = v[0].second(); for (int i = 1; i < v.size(); i++) if (v[i].second > maxNum || (v[i].second == maxNum && v[i].first < minID)) { minID = v[i].first(); maxNum = v[i].second(); } cout << minID << " " << maxNum << endl; } int main() { cin.tie(0); ios::sync_with_stdio(false); int n, a, v; cin >> n; vector<P> fish; for (int i = 0; i < n; i++) { cin >> a >> v; fish.push_back(P(a, v)); } solve(fish); }
a.cc:5:9: error: 'pair' does not name a type 5 | typedef pair<int, int> P; | ^~~~ a.cc:9:19: error: 'P' was not declared in this scope 9 | void solve(vector<P> v) { | ^ a.cc:9:20: error: template argument 1 is invalid 9 | void solve(vector<P> v) { | ^ a.cc:9:20: error: template argument 2 is invalid a.cc: In function 'void solve(int)': a.cc:11:18: error: invalid types 'int[int]' for array subscript 11 | minID = v[0].first(); | ^ a.cc:12:19: error: invalid types 'int[int]' for array subscript 12 | maxNum = v[0].second(); | ^ a.cc:13:31: error: request for member 'size' in 'v', which is of non-class type 'int' 13 | for (int i = 1; i < v.size(); i++) | ^~~~ a.cc:14:22: error: invalid types 'int[int]' for array subscript 14 | if (v[i].second > maxNum || (v[i].second == maxNum && v[i].first < minID)) { | ^ a.cc:14:47: error: invalid types 'int[int]' for array subscript 14 | if (v[i].second > maxNum || (v[i].second == maxNum && v[i].first < minID)) { | ^ a.cc:14:72: error: invalid types 'int[int]' for array subscript 14 | if (v[i].second > maxNum || (v[i].second == maxNum && v[i].first < minID)) { | ^ a.cc:15:34: error: invalid types 'int[int]' for array subscript 15 | minID = v[i].first(); | ^ a.cc:16:35: error: invalid types 'int[int]' for array subscript 16 | maxNum = v[i].second(); | ^ a.cc: In function 'int main()': a.cc:29:16: error: 'P' was not declared in this scope 29 | vector<P> fish; | ^ a.cc:29:17: error: template argument 1 is invalid 29 | vector<P> fish; | ^ a.cc:29:17: error: template argument 2 is invalid a.cc:32:22: error: request for member 'push_back' in 'fish', which is of non-class type 'int' 32 | fish.push_back(P(a, v)); | ^~~~~~~~~
s656252575
p00095
C++
#include "bits/stdc++.h" using namespace std; int a,b,c; int n; int main(){ cin>>n; pair<int,int> p[n]; for (int i = 0; i < n; ++i) { cin>>a>>b; p[i].second=a;p[i].first=-b; } sort(p,p+n); cout<<p[0].second<<" "<<-p[0].first<<endl; //cout<<p[n-1].second<<" "<<-p[n-1].first<<endl;
a.cc: In function 'int main()': a.cc:13:43: error: expected '}' at end of input 13 | cout<<p[0].second<<" "<<-p[0].first<<endl; | ^ a.cc:5:11: note: to match this '{' 5 | int main(){ | ^
s779631387
p00095
C++
#include<iostream> int a,v,M;main(A){for(std::cin>>a;std::cin>>a>>v;)M<v&&(M=v)&(A=a);std::printf("%d %d\n",A,M); }
a.cc:2:15: error: expected constructor, destructor, or type conversion before '(' token 2 | int a,v,M;main(A){for(std::cin>>a;std::cin>>a>>v;)M<v&&(M=v)&(A=a);std::printf("%d %d\n",A,M); } | ^
s328578022
p00095
C++
#include<iostream> int a,v,M; main(A) { for(std::cin>>a;std::cin>>a>>v;)M<v&&(M=v)&(A=a); std::printf("%d %d\n",A,M); }
a.cc:3:5: error: expected constructor, destructor, or type conversion before '(' token 3 | main(A) | ^
s353890667
p00095
C++
#include<iostream> int a,v,M;main(A){for(std::cin>>a;std::cin>>a>>v;)M<v&&(M=v)&(A=a);std::cout<<A<<" "<<M<<"\n";}
a.cc:2:15: error: expected constructor, destructor, or type conversion before '(' token 2 | int a,v,M;main(A){for(std::cin>>a;std::cin>>a>>v;)M<v&&(M=v)&(A=a);std::cout<<A<<" "<<M<<"\n";} | ^
s354468764
p00095
C++
#include<iostream> main(a,v,A,V){for(std::cin>>A;std::cin>>a>>v;)V^v?V<v&&(V=v)&(A=a):A>a&&(A=a);std::cout<<A<<" "<<V<<"\n";}
a.cc:2:5: error: expected constructor, destructor, or type conversion before '(' token 2 | main(a,v,A,V){for(std::cin>>A;std::cin>>a>>v;)V^v?V<v&&(V=v)&(A=a):A>a&&(A=a);std::cout<<A<<" "<<V<<"\n";} | ^
s644012574
p00095
C++
#include<iostream> main(int a,v,A,V){for(std::cin>>A;std::cin>>a>>v;)V^v?V<v&&(V=v)&(A=a):A>a&&(A=a);std::cout<<A<<" "<<V<<"\n";}
a.cc:2:12: error: 'v' has not been declared 2 | main(int a,v,A,V){for(std::cin>>A;std::cin>>a>>v;)V^v?V<v&&(V=v)&(A=a):A>a&&(A=a);std::cout<<A<<" "<<V<<"\n";} | ^ a.cc:2:14: error: 'A' has not been declared 2 | main(int a,v,A,V){for(std::cin>>A;std::cin>>a>>v;)V^v?V<v&&(V=v)&(A=a):A>a&&(A=a);std::cout<<A<<" "<<V<<"\n";} | ^ a.cc:2:16: error: 'V' has not been declared 2 | main(int a,v,A,V){for(std::cin>>A;std::cin>>a>>v;)V^v?V<v&&(V=v)&(A=a):A>a&&(A=a);std::cout<<A<<" "<<V<<"\n";} | ^ a.cc:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 2 | main(int a,v,A,V){for(std::cin>>A;std::cin>>a>>v;)V^v?V<v&&(V=v)&(A=a):A>a&&(A=a);std::cout<<A<<" "<<V<<"\n";} | ^~~~ a.cc:2:1: warning: second argument of 'int main(int, int, int, int)' should be 'char **' [-Wmain] a.cc:2:1: warning: third argument of 'int main(int, int, int, int)' should probably be 'char **' [-Wmain] a.cc:2:1: warning: 'int main(int, int, int, int)' takes only zero or two arguments [-Wmain] a.cc: In function 'int main(int, int, int, int)': a.cc:2:33: error: 'A' was not declared in this scope 2 | main(int a,v,A,V){for(std::cin>>A;std::cin>>a>>v;)V^v?V<v&&(V=v)&(A=a):A>a&&(A=a);std::cout<<A<<" "<<V<<"\n";} | ^ a.cc:2:48: error: 'v' was not declared in this scope 2 | main(int a,v,A,V){for(std::cin>>A;std::cin>>a>>v;)V^v?V<v&&(V=v)&(A=a):A>a&&(A=a);std::cout<<A<<" "<<V<<"\n";} | ^ a.cc:2:51: error: 'V' was not declared in this scope 2 | main(int a,v,A,V){for(std::cin>>A;std::cin>>a>>v;)V^v?V<v&&(V=v)&(A=a):A>a&&(A=a);std::cout<<A<<" "<<V<<"\n";} | ^ a.cc:2:94: error: 'A' was not declared in this scope 2 | main(int a,v,A,V){for(std::cin>>A;std::cin>>a>>v;)V^v?V<v&&(V=v)&(A=a):A>a&&(A=a);std::cout<<A<<" "<<V<<"\n";} | ^ a.cc:2:102: error: 'V' was not declared in this scope 2 | main(int a,v,A,V){for(std::cin>>A;std::cin>>a>>v;)V^v?V<v&&(V=v)&(A=a):A>a&&(A=a);std::cout<<A<<" "<<V<<"\n";} | ^
s138747343
p00095
C++
#include<iostream> int main(a,v,A,V){for(std::cin>>A;std::cin>>a>>v;)V^v?V<v&&(V=v)&(A=a):A>a&&(A=a);std::cout<<A<<" "<<V<<"\n";}
a.cc:2:5: error: cannot declare '::main' to be a global variable 2 | int main(a,v,A,V){for(std::cin>>A;std::cin>>a>>v;)V^v?V<v&&(V=v)&(A=a):A>a&&(A=a);std::cout<<A<<" "<<V<<"\n";} | ^~~~ a.cc:2:10: error: 'a' was not declared in this scope 2 | int main(a,v,A,V){for(std::cin>>A;std::cin>>a>>v;)V^v?V<v&&(V=v)&(A=a):A>a&&(A=a);std::cout<<A<<" "<<V<<"\n";} | ^ a.cc:2:12: error: 'v' was not declared in this scope 2 | int main(a,v,A,V){for(std::cin>>A;std::cin>>a>>v;)V^v?V<v&&(V=v)&(A=a):A>a&&(A=a);std::cout<<A<<" "<<V<<"\n";} | ^ a.cc:2:14: error: 'A' was not declared in this scope 2 | int main(a,v,A,V){for(std::cin>>A;std::cin>>a>>v;)V^v?V<v&&(V=v)&(A=a):A>a&&(A=a);std::cout<<A<<" "<<V<<"\n";} | ^ a.cc:2:16: error: 'V' was not declared in this scope 2 | int main(a,v,A,V){for(std::cin>>A;std::cin>>a>>v;)V^v?V<v&&(V=v)&(A=a):A>a&&(A=a);std::cout<<A<<" "<<V<<"\n";} | ^ a.cc:2:17: error: expression list treated as compound expression in initializer [-fpermissive] 2 | int main(a,v,A,V){for(std::cin>>A;std::cin>>a>>v;)V^v?V<v&&(V=v)&(A=a):A>a&&(A=a);std::cout<<A<<" "<<V<<"\n";} | ^
s833600648
p00095
C++
#include<iostream> a,v,A,V;main(){for(std::cin>>A;std::cin>>a>>v;)V^v?V<v&&(V=v)&(A=a):A>a&&(A=a);std::cout<<A<<" "<<V<<"\n";}
a.cc:2:1: error: 'a' does not name a type 2 | a,v,A,V;main(){for(std::cin>>A;std::cin>>a>>v;)V^v?V<v&&(V=v)&(A=a):A>a&&(A=a);std::cout<<A<<" "<<V<<"\n";} | ^ a.cc:2:9: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 2 | a,v,A,V;main(){for(std::cin>>A;std::cin>>a>>v;)V^v?V<v&&(V=v)&(A=a):A>a&&(A=a);std::cout<<A<<" "<<V<<"\n";} | ^~~~ a.cc: In function 'int main()': a.cc:2:30: error: 'A' was not declared in this scope 2 | a,v,A,V;main(){for(std::cin>>A;std::cin>>a>>v;)V^v?V<v&&(V=v)&(A=a):A>a&&(A=a);std::cout<<A<<" "<<V<<"\n";} | ^ a.cc:2:42: error: 'a' was not declared in this scope 2 | a,v,A,V;main(){for(std::cin>>A;std::cin>>a>>v;)V^v?V<v&&(V=v)&(A=a):A>a&&(A=a);std::cout<<A<<" "<<V<<"\n";} | ^ a.cc:2:45: error: 'v' was not declared in this scope 2 | a,v,A,V;main(){for(std::cin>>A;std::cin>>a>>v;)V^v?V<v&&(V=v)&(A=a):A>a&&(A=a);std::cout<<A<<" "<<V<<"\n";} | ^ a.cc:2:48: error: 'V' was not declared in this scope 2 | a,v,A,V;main(){for(std::cin>>A;std::cin>>a>>v;)V^v?V<v&&(V=v)&(A=a):A>a&&(A=a);std::cout<<A<<" "<<V<<"\n";} | ^ a.cc:2:91: error: 'A' was not declared in this scope 2 | a,v,A,V;main(){for(std::cin>>A;std::cin>>a>>v;)V^v?V<v&&(V=v)&(A=a):A>a&&(A=a);std::cout<<A<<" "<<V<<"\n";} | ^ a.cc:2:99: error: 'V' was not declared in this scope 2 | a,v,A,V;main(){for(std::cin>>A;std::cin>>a>>v;)V^v?V<v&&(V=v)&(A=a):A>a&&(A=a);std::cout<<A<<" "<<V<<"\n";} | ^
s049092946
p00095
C++
#include<iostream> int a,v,V;main(A){for(std::cin>>A;std::cin>>a>>v;)(V<v||V==v&&A>a)&&(V=v)&(A=a);std::cout<<A<<" "<<V<<"\n";}
a.cc:2:15: error: expected constructor, destructor, or type conversion before '(' token 2 | int a,v,V;main(A){for(std::cin>>A;std::cin>>a>>v;)(V<v||V==v&&A>a)&&(V=v)&(A=a);std::cout<<A<<" "<<V<<"\n";} | ^
s429797639
p00095
C++
include <iostream> using namespace std; int main(void){ int n; int max = 0; int num = 0; int flag = 0; cin >> n; for( int i = 0 ; i < n ; i++ ){ int a = 0,v = 0; cin >> a >> v; if( max <= v && flag == 0){ max = v; num = a; if( v == 0 ) flag = 1; } } cout << num << " " << max << 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:11:3: error: 'cin' was not declared in this scope 11 | cin >> n; | ^~~ a.cc:30:3: error: 'cout' was not declared in this scope 30 | cout << num << " " << max << endl; | ^~~~ a.cc:30:32: error: 'endl' was not declared in this scope 30 | cout << num << " " << max << endl; | ^~~~
s879479827
p00095
C++
#include <iostream> #include <algorithm> using namespace std; int main(void){ int n,num,w; pair<int,int>; cin >> n; for(int i = 0 ; i < n ; i++){ cin >> num >> w; p[num-1].first = num; p[num-1].second = w; } sort(p,p+n); cout << p[0].first << ' ' << p[0].second << endl; return 0; }
a.cc: In function 'int main()': a.cc:7:3: error: declaration does not declare anything [-fpermissive] 7 | pair<int,int>; | ^~~~~~~~~~~~~ a.cc:12:5: error: 'p' was not declared in this scope 12 | p[num-1].first = num; | ^ a.cc:16:8: error: 'p' was not declared in this scope 16 | sort(p,p+n); | ^
s893970558
p00096
C
#include<stdio.h> int main(){ int n, a, b, c, d, cnt, x; while(scanf("%d", &n) != EOF){ cnt=0; for(a=1000;a>=0;a--){ for(b=n-a;b>=0;b--){ for(c=n-b;c>=0;c--){ for(d=n-c;d>=0;d--){ if(a+b+c+d==n){ cnt++; } } } } } printf("%d\n", cnt); } return 0;
main.c: In function 'main': main.c:25:3: error: expected declaration or statement at end of input 25 | return 0; | ^~~~~~
s262018801
p00096
C
#include<stdio.h> int main(void){ int a, b, c, d, n, key; while ( scanf("%d", &n) != EOF ) { key = 0; for ( a = 0; a <= n; a++) { for ( b = a + 1; b <= n; b++) { for ( c = b + 1; c <= n; c++ ) { for ( d = d + 1; d <= n; d++ ) { if ( n == a + b + c + d ) key++; } } } } key = key * 26; for ( a = 0; a <= n; a++) { b = a; for ( c = b + 1; c <= n; c++ ) { for ( d = c + 1; d <= n; d++ ) { if ( n == a + b + c + d ) key1++; } } } key1 = key1 * 6 * 6 for ( a = 0; a <= n; a++) { b = a; c = b for ( d = c + 1; d <= n; d++ ) { if ( n == a + b + c + d ) key++; } } key2 = key2 * 2 * 8 for ( a = 0; a <= n; a++) { b = a; c = b; d = c; if ( n == a + b + c + d ) key3++; } printf("%d\n", key + key1 + key2 + key3); } return 0; }
main.c: In function 'main': main.c:21:45: error: 'key1' undeclared (first use in this function); did you mean 'key'? 21 | if ( n == a + b + c + d ) key1++; | ^~~~ | key main.c:21:45: note: each undeclared identifier is reported only once for each function it appears in main.c:25:26: error: expected ';' before 'for' 25 | key1 = key1 * 6 * 6 | ^ | ; 26 | 27 | for ( a = 0; a <= n; a++) { | ~~~
s888514077
p00096
C
#include<stdio.h> int main(void){ int a, b, c, d, n, key, key1, key2, key3; while ( scanf("%d", &n) != EOF ) { key = key1 = key2 = key3 = 0; for ( a = 0; a <= n; a++) { for ( b = a + 1; b <= n; b++) { for ( c = b + 1; c <= n; c++ ) { for ( d = d + 1; d <= n; d++ ) { if ( n == a + b + c + d ) key++; } } } } key = key * 26; for ( a = 0; a <= n; a++) { b = a; for ( c = b + 1; c <= n; c++ ) { for ( d = c + 1; d <= n; d++ ) { if ( n == a + b + c + d ) key1++; } } } key1 = key1 * 6 * 6; for ( a = 0; a <= n; a++) { b = a; c = b for ( d = c + 1; d <= n; d++ ) { if ( n == a + b + c + d ) key++; } } key2 = key2 * 2 * 8; for ( a = 0; a <= n; a++) { b = a; c = b; d = c; if ( n == a + b + c + d ) key3++; } printf("%d\n", key + key1 + key2 + key3); } return 0;
main.c: In function 'main': main.c:29:18: error: expected ';' before 'for' 29 | c = b | ^ | ; 30 | for ( d = c + 1; d <= n; d++ ) { | ~~~ main.c:46:4: error: expected declaration or statement at end of input 46 | return 0; | ^~~~~~
s789054945
p00096
C
#include<stdio.h> int main(void){ int a, b, c, d, n, key, key1, key2, key3; while ( scanf("%d", &n) != EOF ) { key = key1 = key2 = key3 = 0; for ( a = 0; a <= n; a++) { for ( b = a + 1; b <= n; b++) { for ( c = b + 1; c <= n; c++ ) { for ( d = d + 1; d <= n; d++ ) { if ( n == a + b + c + d ) key++; } } } } key = key * 26; for ( a = 0; a <= n; a++) { b = a; for ( c = b + 1; c <= n; c++ ) { for ( d = c + 1; d <= n; d++ ) { if ( n == a + b + c + d ) key1++; } } } key1 = key1 * 6 * 6; for ( a = 0; a <= n; a++) { b = a; c = b for ( d = c + 1; d <= n; d++ ) { if ( n == a + b + c + d ) key++; } } key2 = key2 * 2 * 8; for ( a = 0; a <= n; a++) { b = a; c = b; d = c; if ( n == a + b + c + d ) key3++; } printf("%d\n", key + key1 + key2 + key3); } return 0;
main.c: In function 'main': main.c:29:18: error: expected ';' before 'for' 29 | c = b | ^ | ; 30 | for ( d = c + 1; d <= n; d++ ) { | ~~~ main.c:46:4: error: expected declaration or statement at end of input 46 | return 0; | ^~~~~~
s452632804
p00096
C
include<stdio.h> main(){ int a,b,cnt=0,n; int ab[2001]={0}; int abcd[4001]={0}; for(a=0;a<=1000;a++)for(b=0;b<=1000;b++)ab[a+b]++; for(a=0;a<=2000;a++)for(b=0;b<=2000;b++)abcd[a+b]+=ab[a]*ab[b]; while( scanf("%d",&b)!=EOF) printf("%d\n",abcd[b]); return 0; }
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | include<stdio.h> | ^
s216387695
p00096
C
#include <stdio.h> int N(int x){ return (x+1)*(x+2)*(x+3)/6 } int main(){ while(~scanf("%d", &n)) printf("%lld\n", N[n]); return 0; }
main.c:3:10: error: stray '\343' in program 3 | int N(int<U+3000>x){ | ^~~~~~~~ main.c: In function 'N': main.c:4:31: error: expected ';' before '}' token 4 | return (x+1)*(x+2)*(x+3)/6 | ^ | ; 5 | } | ~ main.c: In function 'main': main.c:8:24: error: 'n' undeclared (first use in this function) 8 | while(~scanf("%d", &n)) | ^ main.c:8:24: note: each undeclared identifier is reported only once for each function it appears in
s546228691
p00096
C
#include <stdio.h> int N(int x){ return (x+1)*(x+2)*(x+3)/6 } int main(){ int n,m; while(~scanf("%d", &n)) if (n > 2000) n = 4000 - n; if (n < 1001) printf("%d\n", N(n)); else m = n - 1000 print("%d\n", N(n)-(N(m)-m+1)/2) return 0; }
main.c:3:10: error: stray '\343' in program 3 | int N(int<U+3000>x){ | ^~~~~~~~ main.c: In function 'N': main.c:4:31: error: expected ';' before '}' token 4 | return (x+1)*(x+2)*(x+3)/6 | ^ | ; 5 | } | ~ main.c: In function 'main': main.c:15:21: error: expected ';' before 'print' 15 | m = n - 1000 | ^ | ; 16 | print("%d\n", N(n)-(N(m)-m+1)/2) | ~~~~~
s406814806
p00096
C
#include <stdio.h> int nn(int x){ return (x+1)*(x+2)*(x+3)/6 } int main(){ int n,m; while(~scanf("%d", &n)) if (n > 2000) n = 4000 - n; if (n < 1001) printf("%d\n", nn(n)); else m = n - 1000 print("%d\n", nn(n)-(nn(m)-m+1)/2) return 0; }
main.c:3:11: error: stray '\343' in program 3 | int nn(int<U+3000>x){ | ^~~~~~~~ main.c: In function 'nn': main.c:4:31: error: expected ';' before '}' token 4 | return (x+1)*(x+2)*(x+3)/6 | ^ | ; 5 | } | ~ main.c: In function 'main': main.c:15:21: error: expected ';' before 'print' 15 | m = n - 1000 | ^ | ; 16 | print("%d\n", nn(n)-(nn(m)-m+1)/2) | ~~~~~
s051162442
p00096
C++
#include<iostream> int main(int argc, char const *argv[]) { int a; while(std::cin >>a){ int ans=0; for(int i=0;i<=1000;i++){ for(int j=0;j<=1000;j++){ for(int k=0;k<=1000;k++){ for(int l=0;l<=1000;l++){ if(a==i+j+k+l) ans++; else if(a<i+j+k+l) break; } else if(a<i+j+k) break; } else if(a<i+j) break; } else if(a<i) break; } std::cout << ans << std::endl; } return 0; }
a.cc: In function 'int main(int, const char**)': a.cc:15:25: error: 'else' without a previous 'if' 15 | else if(a<i+j+k) break; | ^~~~ a.cc:17:25: error: 'else' without a previous 'if' 17 | else if(a<i+j) break; | ^~~~ a.cc:19:25: error: 'else' without a previous 'if' 19 | else if(a<i) break; | ^~~~
s501610131
p00096
C++
using namespace std; int main(){ int count, num,val[4010], tmp[4010]; val[0] = 4; tmp[0] = 6; for (int a = 0; a < 4010; a++){ tmp[a + 1] = tmp[a] + a + 4; } for (int a = 0; a < 4010; a++){ val[a + 1] = val[a] + tmp[a]; } while (cin >> num){ cout << val[num - 1]<<endl; } }
a.cc: In function 'int main()': a.cc:12:16: error: 'cin' was not declared in this scope 12 | while (cin >> num){ | ^~~ 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:13:17: error: 'cout' was not declared in this scope 13 | cout << val[num - 1]<<endl; | ^~~~ a.cc:13:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:13:39: error: 'endl' was not declared in this scope 13 | cout << val[num - 1]<<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;
s101815372
p00096
C++
import std.stdio; import std.algorithm; import std.string; import std.range; import std.array; import std.conv; import std.complex; import std.math; int calc2(int n) { if(n <= 1000) { return n+1; } else { return 2000-n+1; } } void main() { while(!stdin.eof()){ int n = to!int(readln().chomp()); int sum; for(int i = max(0, n-2000); i <= min(n, 2000); ++i) { sum += calc2(i)*calc2(n-i); } writeln(sum); } }
a.cc:1:1: error: 'import' does not name a type 1 | import std.stdio; | ^~~~~~ 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 std.algorithm; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: 'import' does not name a type 3 | import std.string; | ^~~~~~ a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:4:1: error: 'import' does not name a type 4 | import std.range; | ^~~~~~ a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:5:1: error: 'import' does not name a type 5 | import std.array; | ^~~~~~ a.cc:5:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:6:1: error: 'import' does not name a type 6 | import std.conv; | ^~~~~~ a.cc:6:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:7:1: error: 'import' does not name a type 7 | import std.complex; | ^~~~~~ a.cc:7:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:8:1: error: 'import' does not name a type 8 | import std.math; | ^~~~~~ a.cc:8:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:19:1: error: '::main' must return 'int' 19 | void main() { | ^~~~ a.cc: In function 'int main()': a.cc:20:16: error: 'stdin' was not declared in this scope 20 | while(!stdin.eof()){ | ^~~~~ a.cc:1:1: note: 'stdin' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' +++ |+#include <cstdio> 1 | import std.stdio; a.cc:21:25: error: 'to' was not declared in this scope 21 | int n = to!int(readln().chomp()); | ^~ a.cc:23:29: error: 'max' was not declared in this scope 23 | for(int i = max(0, n-2000); i <= min(n, 2000); ++i) { | ^~~ a.cc:23:50: error: 'min' was not declared in this scope; did you mean 'main'? 23 | for(int i = max(0, n-2000); i <= min(n, 2000); ++i) { | ^~~ | main a.cc:26:17: error: 'writeln' was not declared in this scope 26 | writeln(sum); | ^~~~~~~
s103552418
p00096
C++
import std.stdio; import std.algorithm; import std.string; import std.range; import std.array; import std.conv; import std.complex; import std.math; int calc2(int n) { if(n <= 1000) { return n+1; } else { return 2000-n+1; } } void main() { while(!stdin.eof()){ int n = to!int(readln().chomp()); int sum; for(int i = max(0, n-2000); i <= min(n, 2000); ++i) { sum += calc2(i)*calc2(n-i); } writeln(sum); } }
a.cc:1:1: error: 'import' does not name a type 1 | import std.stdio; | ^~~~~~ 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 std.algorithm; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: 'import' does not name a type 3 | import std.string; | ^~~~~~ a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:4:1: error: 'import' does not name a type 4 | import std.range; | ^~~~~~ a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:5:1: error: 'import' does not name a type 5 | import std.array; | ^~~~~~ a.cc:5:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:6:1: error: 'import' does not name a type 6 | import std.conv; | ^~~~~~ a.cc:6:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:7:1: error: 'import' does not name a type 7 | import std.complex; | ^~~~~~ a.cc:7:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:8:1: error: 'import' does not name a type 8 | import std.math; | ^~~~~~ a.cc:8:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:19:1: error: '::main' must return 'int' 19 | void main() { | ^~~~ a.cc: In function 'int main()': a.cc:20:16: error: 'stdin' was not declared in this scope 20 | while(!stdin.eof()){ | ^~~~~ a.cc:1:1: note: 'stdin' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' +++ |+#include <cstdio> 1 | import std.stdio; a.cc:21:25: error: 'to' was not declared in this scope 21 | int n = to!int(readln().chomp()); | ^~ a.cc:23:29: error: 'max' was not declared in this scope 23 | for(int i = max(0, n-2000); i <= min(n, 2000); ++i) { | ^~~ a.cc:23:50: error: 'min' was not declared in this scope; did you mean 'main'? 23 | for(int i = max(0, n-2000); i <= min(n, 2000); ++i) { | ^~~ | main a.cc:26:17: error: 'writeln' was not declared in this scope 26 | writeln(sum); | ^~~~~~~
s363074897
p00096
C++
import java.util.Arrays; import java.util.Scanner; public class Main { Scanner sc = new Scanner(System.in); void run() { int[][] dp = new int[4][4001]; for(int i=0;i<=1000;i++) dp[0][i] = 1; for (int i = 0; i < 3; i++) { for (int j = 0; j <= 4000; j++) { for (int k = 0; k <= 1000; k++) { if (j + k <= 4000) dp[i + 1][j + k] += dp[i][j]; } } } while (sc.hasNext()) { int n = sc.nextInt(); System.out.println(dp[3][n]); } } public static void main(String[] args) { new Main().run(); } void debug(Object... o) { System.out.println(Arrays.deepToString(o)); } void debug2(char[][] array) { for (int i = 0; i < array.length; i++) { for (int j = 0; j < array[i].length; j++) { System.out.print(array[i][j]); } System.out.println(); } } boolean inner(int h, int w, int limH, int limW) { return 0 <= h && h < limH && 0 <= w && w < limW; } void swap(int[] x, int a, int b) { int tmp = x[a]; x[a] = x[b]; x[b] = tmp; } // find minimum i (a[i] >= border) int lower_bound(int a[], int border) { int l = -1; int r = a.length; while (r - l > 1) { int mid = (l + r) / 2; if (border <= a[mid]) { r = mid; } else { l = mid; } } // r = l + 1 return r; } boolean palindrome(String s) { for (int i = 0; i < s.length() / 2; i++) { if (s.charAt(i) != s.charAt(s.length() - 1 - i)) { return false; } } return true; } class MyScanner { int nextInt() { try { int c = System.in.read(); while (c != '-' && (c < '0' || '9' < c)) c = System.in.read(); if (c == '-') return -nextInt(); int res = 0; do { res *= 10; res += c - '0'; c = System.in.read(); } while ('0' <= c && c <= '9'); return res; } catch (Exception e) { return -1; } } double nextDouble() { return Double.parseDouble(next()); } long nextLong() { return Long.parseLong(next()); } String next() { try { StringBuilder res = new StringBuilder(""); int c = System.in.read(); while (Character.isWhitespace(c)) c = System.in.read(); do { res.append((char) c); } while (!Character.isWhitespace(c = System.in.read())); return res.toString(); } catch (Exception e) { return null; } } int[] nextIntArray(int n) { int[] in = new int[n]; for (int i = 0; i < n; i++) { in[i] = nextInt(); } return in; } int[][] nextInt2dArray(int n, int m) { int[][] in = new int[n][m]; for (int i = 0; i < n; i++) { in[i] = nextIntArray(m); } return in; } double[] nextDoubleArray(int n) { double[] in = new double[n]; for (int i = 0; i < n; i++) { in[i] = nextDouble(); } return in; } long[] nextLongArray(int n) { long[] in = new long[n]; for (int i = 0; i < n; i++) { in[i] = nextLong(); } return in; } char[][] nextCharField(int n, int m) { char[][] in = new char[n][m]; for (int i = 0; i < n; i++) { String s = sc.next(); for (int j = 0; j < m; j++) { in[i][j] = s.charAt(j); } } return in; } } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.Arrays; | ^~~~~~ 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.util.Scanner; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:4:1: error: expected unqualified-id before 'public' 4 | public class Main { | ^~~~~~
s656281510
p00096
C++
#include <iostream> using namespace std; int n; int dp[5][4001]; int func(int i,int j){ if (dp[i][j]>=0) { return dp[i][j]; } int res=0; if(i==4){ if (j==n) { return 1;; } else{ return 0; } } else{ for (int k=0; k<=n; k++) { res+=func(i+1, j+k); } } return dp[i][j]=res; } int main(){ while (cin>>n,n) { memset(dp, -1, sizeof(dp)); cout<<func(0,0)<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:30:9: error: 'memset' was not declared in this scope 30 | memset(dp, -1, sizeof(dp)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> +++ |+#include <cstring> 2 | using namespace std;
s897620413
p00096
C++
#include <iostream> using namespace std; int n; int dp[5][4001]; int func(int i,int j){ if (dp[i][j]>=0) { return dp[i][j]; } int res=0; if(i==4){ if (j==n) { return 1;; } else{ return 0; } } else{ for (int k=0; k<=n; k++) { res+=func(i+1, j+k); } } return dp[i][j]=res; } int main(){ while (cin>>n) { memset(dp, -1, sizeof(dp)); cout<<func(0,0)<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:30:9: error: 'memset' was not declared in this scope 30 | memset(dp, -1, sizeof(dp)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> +++ |+#include <cstring> 2 | using namespace std;
s458157174
p00096
C++
#include <iostream> using namespace std; int n; int dp[5][4001]; int func(int i,int j){ if (dp[i][j]>=0) { return dp[i][j]; } int res=0; if(i==4){ if (j==n) { return 1;; } else{ return 0; } } else{ for (int k=0; k<=n; k++) { res+=func(i+1, j+k); } } return dp[i][j]=res; } int main(){ while (cin>>n) { memset(dp, -1, sizeof(dp)); cout<<func(0,0)<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:30:9: error: 'memset' was not declared in this scope 30 | memset(dp, -1, sizeof(dp)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> +++ |+#include <cstring> 2 | using namespace std;
s150542545
p00096
C++
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (sc.hasNext()) { int n = sc.nextInt() + 1; if (n < 990) { System.out.println((n * (n + 1) * (n + 2)) / 6); } else { n--; n=n>2000?4000-n:n; int a=1; int b=3; int c=3; for(int i=0;i<n;i++){ a+=b; b+=c; if(i<998){ c++; }else{ c-=3; } } System.out.println(a); } } } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.Scanner; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: expected unqualified-id before 'public' 3 | public class Main { | ^~~~~~
s327068541
p00096
C++
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (sc.hasNext()) { int n = sc.nextInt() + 1; if (n < 990) { System.out.println((n * (n + 1) * (n + 2)) / 6); } else { n--; n=n>2000?4000-n:n; int a=1; int b=3; int c=3; for(int i=0;i<n;i++){ a+=b; b+=c; if(i<998){ c++; }else{ c-=3; } } System.out.println(a); } } } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.Scanner; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: expected unqualified-id before 'public' 3 | public class Main { | ^~~~~~
s724023004
p00096
C++
#include <iostream> #include <algorithm> using namespace std; typedef long long lli; int main() { lli n; while(cin >> n) { int ans = 0; for(lli a = 0; a <= n; ++a) { for(lli b = 0; a+b <= n; ++b) { ans += min(1000LL, n-a-b) - max(0, n-1000LL-a-b) + 1; } } cout << ans << endl; } return 0; }
a.cc: In function 'int main()': a.cc:13:40: error: no matching function for call to 'max(int, lli)' 13 | ans += min(1000LL, n-a-b) - max(0, n-1000LL-a-b) + 1; | ~~~^~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:13:40: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'lli' {aka 'long long int'}) 13 | ans += min(1000LL, n-a-b) - max(0, n-1000LL-a-b) + 1; | ~~~^~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61, from a.cc:2: /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:13:40: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 13 | ans += min(1000LL, n-a-b) - max(0, n-1000LL-a-b) + 1; | ~~~^~~~~~~~~~~~~~~~~
s191050832
p00096
C++
#include <iostream> #include <algorithm> using namespace std; typedef long long lli; int main() { lli n; while(cin >> n) { lli ans = 0; for(lli a = 0; a <= n; ++a) { for(lli b = 0; a+b <= n; ++b) { ans += min(1000LL, n-a-b) - max(0, n-1000LL-a-b) + 1; } } cout << ans << endl; } return 0; }
a.cc: In function 'int main()': a.cc:13:40: error: no matching function for call to 'max(int, lli)' 13 | ans += min(1000LL, n-a-b) - max(0, n-1000LL-a-b) + 1; | ~~~^~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:13:40: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'lli' {aka 'long long int'}) 13 | ans += min(1000LL, n-a-b) - max(0, n-1000LL-a-b) + 1; | ~~~^~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61, from a.cc:2: /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:13:40: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 13 | ans += min(1000LL, n-a-b) - max(0, n-1000LL-a-b) + 1; | ~~~^~~~~~~~~~~~~~~~~
s829500848
p00096
C++
#include <iostream> using namespace std; int memo[4][4001]; int rec(int idx, int left) { if(idx == 3) return (left <= 1000 ? 1 : 0); if(memo[idx][left] != -1) return memo[idx][left]; int ans = 0; for(int i=0; i <= min(1000, left); i++){ ans += rec(idx+1, left - i); } return ans; } int main() { for(int n = 0; cin >> n; ){ memset(memo, -1, sizeof memo); cout << rec(0, n) << endl; } }
a.cc: In function 'int main()': a.cc:22:17: error: 'memset' was not declared in this scope 22 | memset(memo, -1, sizeof memo); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> +++ |+#include <cstring> 2 | using namespace std;
s014531992
p00096
C++
#include <iostream> using namespace std; int memo[4][4001]; int rec(int idx, int left) { if(idx == 3) return (left <= 1000 ? 1 : 0); if(memo[idx][left] != -1) return memo[idx][left]; int ans = 0; for(int i=0; i <= min(1000, left); i++){ ans += rec(idx+1, left - i); } return ans; } int main() { for(int n = 0; cin >> n; ){ memset(memo, -1, sizeof memo); cout << rec(0, n) << endl; } }
a.cc: In function 'int main()': a.cc:22:17: error: 'memset' was not declared in this scope 22 | memset(memo, -1, sizeof memo); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> +++ |+#include <cstring> 2 | using namespace std;
s524681501
p00096
C++
#include<stdio.h> long long dp[5][4001]; int main(){ dp[0][0]=1; for(int i=0;i<4;i++) for(int j=0;j<=4000;j++){ if(dp[i][j]){ for(int k=0;k<=1000;k++)dp[i+1][j+k]+=dp[i][j]; } } while(~scanf("%d",&a)) for(int i=0;i<a;i++){ int b; scanf("%d",&b); printf("%lld\n",dp[4][b]); }} }
a.cc: In function 'int main()': a.cc:11:28: error: 'a' was not declared in this scope 11 | while(~scanf("%d",&a)) | ^ a.cc: At global scope: a.cc:17:1: error: expected declaration before '}' token 17 | } | ^
s837185768
p00096
C++
#include<stdio.h> long long dp[5][4001]; int main(){ dp[0][0]=1; for(int i=0;i<4;i++) for(int j=0;j<=4000;j++){ if(dp[i][j]){ for(int k=0;k<=1000;k++)dp[i+1][j+k]+=dp[i][j]; } } while(~scanf("%d",&a)){ for(int i=0;i<a;i++){ int b; scanf("%d",&b); printf("%lld\n",dp[4][b]); } } }
a.cc: In function 'int main()': a.cc:11:28: error: 'a' was not declared in this scope 11 | while(~scanf("%d",&a)){ | ^
s126830221
p00096
C++
T = 1000 def f(x): return max(0, T + 1 - abs(T - x)) while True: try: n = input() except EOFError: break cnt = 0 for i in range(n): cnt += f(i) * f(n-i) print cnt #O(n),
a.cc:14:2: error: invalid preprocessing directive #O 14 | #O(n), | ^ a.cc:1:1: error: 'T' does not name a type 1 | T = 1000 | ^
s571562125
p00096
C++
main(m,n){for(;~scanf("%d",&n);printf("%d\n",(n*n*n-n-4*m*m*m+4*m)/6)) n=n>36?0:n>18?38-n:n+2,m=n>11?n-10:0;}
a.cc:1:5: error: expected constructor, destructor, or type conversion before '(' token 1 | main(m,n){for(;~scanf("%d",&n);printf("%d\n",(n*n*n-n-4*m*m*m+4*m)/6)) | ^
s706778569
p00096
C++
main(){int m,n;for(;~scanf("%d",&n);printf("%d\n",(n*n*n-n-4*m*m*m+4*m)/6)) n=n>36?0:n>18?38-n:n+2,m=n>11?n-10:0;}
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 1 | main(){int m,n;for(;~scanf("%d",&n);printf("%d\n",(n*n*n-n-4*m*m*m+4*m)/6)) | ^~~~ a.cc: In function 'int main()': a.cc:1:22: error: 'scanf' was not declared in this scope 1 | main(){int m,n;for(;~scanf("%d",&n);printf("%d\n",(n*n*n-n-4*m*m*m+4*m)/6)) | ^~~~~ a.cc:1:37: error: 'printf' was not declared in this scope 1 | main(){int m,n;for(;~scanf("%d",&n);printf("%d\n",(n*n*n-n-4*m*m*m+4*m)/6)) | ^~~~~~ a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' +++ |+#include <cstdio> 1 | main(){int m,n;for(;~scanf("%d",&n);printf("%d\n",(n*n*n-n-4*m*m*m+4*m)/6))
s820370178
p00096
C++
#include <stdio.h> long N(long x){ return (x+1)*(x+2)*(x+3)/6; } int main(){ long n; while(~scanf("%ld",&n)){ if (n > 2000) n = 4000 - n; if (n < 1001) printf("%d\n",N(n)); else printf("%ld\n", N(n)-(N(2*(n-1000)-n-1001)/2); } } return 0; }
a.cc:10:18: error: extended character   is not valid in an identifier 10 | if (n > 2000) n = 4000 - n; | ^ a.cc: In function 'int main()': a.cc:10:18: error: '\U00003000n' was not declared in this scope 10 | if (n > 2000) n = 4000 - n; | ^~~ a.cc:12:55: error: expected ')' before ';' token 12 | else printf("%ld\n", N(n)-(N(2*(n-1000)-n-1001)/2); | ~ ^ | ) a.cc: At global scope: a.cc:15:3: error: expected unqualified-id before 'return' 15 | return 0; | ^~~~~~ a.cc:16:1: error: expected declaration before '}' token 16 | } | ^
s640708589
p00096
C++
#include <stdio.h> long N(long x){ return (x+1)*(x+2)*(x+3)/6; } int main(){ long n; while(~scanf("%ld",&n)){ if (n > 2000) n = 4000 - n; if (n < 1001) printf("%d\n",N(n)); else printf("%ld\n", N(n)-(N(2*(n-1000)-n-1001)/2); } return 0; }
a.cc:10:18: error: extended character   is not valid in an identifier 10 | if (n > 2000) n = 4000 - n; | ^ a.cc: In function 'int main()': a.cc:10:18: error: '\U00003000n' was not declared in this scope 10 | if (n > 2000) n = 4000 - n; | ^~~ a.cc:12:55: error: expected ')' before ';' token 12 | else printf("%ld\n", N(n)-(N(2*(n-1000)-n-1001)/2); | ~ ^ | )
s772157579
p00096
C++
#include <stdio.h> long N(long x){ return (x+1)*(x+2)*(x+3)/6; } int main(){ long n; while(~scanf("%ld",&n)){ if (n > 2000)  n = 4000 - n; if (n < 1001) printf("%d\n",N(n)); else printf("%ld\n", N(n)-(N(2*(n-1000)-n-1001)/2); } return 0; }
a.cc:11:7: error: extended character   is not valid in an identifier 11 |  n = 4000 - n; | ^ a.cc: In function 'int main()': a.cc:11:7: error: '\U00003000n' was not declared in this scope 11 |  n = 4000 - n; | ^~~ a.cc:15:54: error: expected ')' before ';' token 15 | printf("%ld\n", N(n)-(N(2*(n-1000)-n-1001)/2); | ~ ^ | )
s973046807
p00096
C++
#include <iostream> using namespace std; int main() { long long int n; while( cin >> n ) { long long int ans = (n+3)*(n+2)*(n+1)/3/2/1; if ( n > 1000 ) { ans -= (n-1000+3)*(n-1000+2)*(n-1000+1)/3/2/1*4; } cout << << endl; } return 0; }
a.cc: In function 'int main()': a.cc:12:14: error: expected primary-expression before '<<' token 12 | cout << << endl; | ^~
s655818239
p00097
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; /** * 0 から 100 の数字から異なる n 個の数を取り出して合計が s となる組み合わせの数を出力する * n 個の数はおのおの 0 から 100 までとし、1つの組み合わせに同じ数字は使えません。 * @author sugawara-a2 * */ public class main { final private static int LIMIT = 100; public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); while (input.ready()) { String[] INPUT_STR = input.readLine().split(" "); int numCount = Integer.valueOf(INPUT_STR[0]); int sumNumber = Integer.valueOf(INPUT_STR[1]); if (numCount == 0 && sumNumber == 0) { break; } long ans = solver(numCount, sumNumber); System.out.println(ans); } } private static long solver(int numCount, int sumNumber) { // n個(numCount)の重複しない0以上の整数を足し合わせた際の最小値が // sumNumberより大きい場合は組合せなし if (sumNumber < sumUp(numCount - 1)) { return 0; } // n個(numCount)の重複しないLIMIT以下の整数を足し合わせた際の最大値が // sumNumberより小さい場合は組合せなし if ((LIMIT * numCount) - sumUp(numCount - 1) < sumNumber) { return 0; } // n個(numCount)の重複しない0以上の整数を足し合わせた際の最小値をsumNumberから除算した値とLIMITを比較し小さい値を開始数にする int startIndex = Math.min(LIMIT, sumNumber - sumUp(numCount - 1)); sumNumber = sumNumber - sumUp(numCount - 1); return solver(numCount, sumNumber, 0, startIndex); } private static long solver(int numCount, int sumNumber, int currentSum, int startIndex) { long ret = 0; for (int i = numCount; i > 0; i--) { startIndex = startIndex / 2; ret += startIndex; } return ret; } private static int sumUp(int num) { // ZeroOrigin num--; return (int) ((int) (num + 1) * num * 0.5); } }
Main.java:12: error: class main is public, should be declared in a file named main.java public class main ^ 1 error
s543220063
p00097
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; /** * 0 から 100 の数字から異なる n 個の数を取り出して合計が s となる組み合わせの数を出力する * n 個の数はおのおの 0 から 100 までとし、1つの組み合わせに同じ数字は使えません。 * @author sugawara-a2 * */ public class AOJ_0097 { final private static int LIMIT = 100; public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); while (input.ready()) { String[] INPUT_STR = input.readLine().split(" "); int numCount = Integer.valueOf(INPUT_STR[0]); int sumNumber = Integer.valueOf(INPUT_STR[1]); if (numCount == 0 && sumNumber == 0) { break; } long ans = solver(numCount, sumNumber); System.out.println(ans); } } private static long solver(int numCount, int sumNumber) { // n個(numCount)の重複しない0以上の整数を足し合わせた際の最小値が // sumNumberより大きい場合は組合せなし if (sumNumber < sumUp(numCount - 1)) { return 0; } // n個(numCount)の重複しないLIMIT以下の整数を足し合わせた際の最大値が // sumNumberより小さい場合は組合せなし if (((LIMIT * numCount) - sumUp(numCount - 1)) < sumNumber) { return 0; } return solver2(numCount, sumNumber); } private static long solver2(int numCount, int sumNumber) { int ret = 1; int newSumNumber = sumNumber - sumUp(numCount-1); for (int i = 2; i <= numCount; i++) { ret +=newSumNumber / numCount; } return ret; } private static int sumUp(int num) { return (int) ((int) (num + 1) * num * 0.5); } }
Main.java:12: error: class AOJ_0097 is public, should be declared in a file named AOJ_0097.java public class AOJ_0097 ^ 1 error
s122064743
p00097
Java
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.ArrayList; public class Main { public static void main(String[] args){ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String tes = null; ArrayList<Integer> al = new ArrayList<Integer>(); ArrayList<Integer> al2 = new ArrayList<Integer>(); try { tes = br.readLine(); } catch (IOException e) { // TODO 自動生成された catch ブロック e.printStackTrace(); } int a,b; int[] r = {0,0}; String[] fruit = tes.split(" ", 0); a = Integer.parseInt(fruit[0]); al.add(a); b = Integer.parseInt(fruit[1]); al2.add(b); if(a == 0 && b == 0){ return; } while(true){ try { tes = br.readLine(); } catch (IOException e) { // TODO 自動生成された catch ブロック e.printStackTrace(); } if(tes == null){ break; } try{ fruit = tes.split(" ", 0); a = Integer.parseInt(fruit[0]); b = Integer.parseInt(fruit[1]); if(a == 0 && b == 0){ break; } fruit = tes.split(" ", 0); al.add(a); al2.add(b); }catch(NumberFormatException e){ break; } } int[] total = new int[1]; for(int i=0;i<al.size();i++){ total[0] = 0; if(al.get(i) == 9 && al2.get(i) > 864){ System.out.println("0"); }else if(al.get(i) == 8 && al2.get(i) > 774){ System.out.println("0"); }else if(al.get(i) == 7 && al2.get(i) > 679){ System.out.println("0"); }else if(al.get(i) == 6 && al2.get(i) > 585){ System.out.println("0"); }else if(al.get(i) == 5 && al2.get(i) > 490){ System.out.println("0"); }else if(al.get(i) == 4 && al2.get(i) > 394){ System.out.println("0"); }else if(al.get(i) == 3 && al2.get(i) > 297){ System.out.println("0"); }else if(al.get(i) == 2 && al2.get(i) > 199){ System.out.println("0"); }else if(al.get(i) == 1 && al2.get(i) > 100){ System.out.println("0"); } saiki(total,0,al.get(i)-1,al2.get(i),0); System.out.println(total[0]); } } public static void saiki(int[] total,int tmpgo,int kaisuu,int mokuhyou,int genkai){ if(mokuhyou <= tmpgo){ return; } if(kaisuu == 8 && mokuhyou > 864){ return; }else if(kaisuu == 7 && mokuhyou > 774){ return; }else if(kaisuu == 6 && mokuhyou > 679){ return; }else if(kaisuu == 5 && mokuhyou > 585){ return; }else if(kaisuu == 4 && mokuhyou > 490){ return; }else if(kaisuu == 3 && mokuhyou > 394){ return; }else if(kaisuu == 2 && mokuhyou > 297){ return; }else if(kaisuu == 1 && mokuhyou > 199){ return; }else if(kaisuu == 0 && mokuhyou > 100){ return; } if(kaisuu == 0){ for(int i=genkai;i<=100;i++){ if(mokuhyou == (tmpgo+i)){ total[0]++; }else if(mokuhyou <= (tmpgo+i)){ return; } } return; } for(int i=genkai;i<100;i++){ if(mokuhyou <= tmpgo){ return; } saiki(total,tmpgo+i,kaisuu-1,mokuhyou,i+1); } } }
Main.java:15: error: cannot find symbol } catch (IOException e) { ^ symbol: class IOException location: class Main Main.java:33: error: cannot find symbol } catch (IOException e) { ^ symbol: class IOException location: class Main 2 errors
s822651317
p00097
Java
import java.util.*; public class main { public static void Main(String[] args) { int n,s,max,count; count = 0; n=9; max=100; s=200; Scanner sc = new Scanner(System.in); for(;;){ n = sc.nextInt(); s = sc.nextInt(); if(n==0&&s==0)break; count = check(n,s,max); System.out.println(count); } } private static int check(int n, int s,int max) { int count = 0; if(s<max) max=s; for(;max>=0;max--){ if(n>1) count += check(n-1,s-max,max-1); else if(s==max) return 1; else return 0; } return count; } }
Main.java:3: error: class main is public, should be declared in a file named main.java public class main { ^ 1 error
s349552092
p00097
Java
import import java.util.*; public class Main { public static void main(String[] args) { int n,s,max,count; count = 0; n=9; max=100; s=200; Scanner sc = new Scanner(System.in); for(;;){ n = sc.nextInt(); s = sc.nextInt(); if(n==0&&s==0)break; count = check(n,s,max); System.out.println(count); } } private static int check(int n, int s,int max) { int count = 0; if(s<max) max=s; for(;max>=0;max--){ if(n>1 && (s-max) <= n*max) count += check(n-1,s-max,max-1); else if(n==1 && s==max) return 1; else if(n==1) return 0; } return count; } }
Main.java:1: error: <identifier> expected import import java.util.*; ^ 1 error
s561090973
p00097
Java
import java.util.*; public class main { public static void main(String[] args) { int n,s,max,count; count = 0; n=9; max=100; s=200; Scanner sc = new Scanner(System.in); for(;;){ n = sc.nextInt(); s = sc.nextInt(); if(n==0&&s==0)break; count = check(n,s,max); System.out.println(count); } } private static int check(int n, int s,int max) { int count = 0; if(s<max) max=s; for(;max>=0;max--){ if(n>1 && (s-max) <= n*(max-1)) count += check(n-1,s-max,max-1); else if(n==1 && s==max) return 1; else if(n==1) return 0; } return count; } }
Main.java:3: error: class main is public, should be declared in a file named main.java public class main { ^ 1 error
s623961522
p00097
Java
import java.util.*; public class main { public static void Main(String[] args) { int n,s,max,count; count = 0; n=9; max=100; s=200; Scanner sc = new Scanner(System.in); for(;;){ n = sc.nextInt(); s = sc.nextInt(); if(n==0&&s==0)break; if(s>864) s=864; count = check(n,s,max); System.out.println(count); } } private static int check(int n, int s,int max) { int count = 0; if(s<max) max=s; if(n==1 && s==max) return 1; else if(n==1) return 0; for(;max>=0;max--) if(n>1 && (s-max) <= (n-1)*(max-1)) count += check(n-1,s-max,max-1); return count; } }
Main.java:3: error: class main is public, should be declared in a file named main.java public class main { ^ 1 error
s672996978
p00097
Java
import java.util.Scanner; //Sum of Integers II public class AOJ0097 { void run(){ Scanner sc = new Scanner(System.in); long[] dp = new long[2001]; for(int i=0;i<=1000;i++)for(int j=0;j<=1000;j++)dp[i+j]++; while(sc.hasNext()){ int N = sc.nextInt(); long res = 0; for(int s=0;s<=2000;s++)if(0 <= N-s && N-s <= 2000)res+=dp[s]*dp[N-s]; System.out.println(res); } } public static void main(String[] args) { new AOJ0097().run(); } }
Main.java:4: error: class AOJ0097 is public, should be declared in a file named AOJ0097.java public class AOJ0097 { ^ 1 error
s353872179
p00097
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main{ public static void main(String[] args)throws IOException{ InputStreamReader isr = new InputStreamReader(System.in); BufferedReader reader = new BufferedReader(isr); String string; long res[][] = new long[11][1001], n , s; res[0][0] = 1; for(int i = 0; i <= 100; i++){ for(int j = 9; j >= 0; j--){ for(int k = 0; k + i <= 1000; k++){ res[j + 1][i + k] += res[j][k]; } } } while(!(string = reader.readLine()).equals("0 0")){ n = Integer.valueOf(string.split(" ")[0]); s = Integer.valueOf(string.split(" ")[1]); System.out.println(res[n][s]); } reader.close(); } }
Main.java:25: error: incompatible types: possible lossy conversion from long to int System.out.println(res[n][s]); ^ Main.java:25: error: incompatible types: possible lossy conversion from long to int System.out.println(res[n][s]); ^ 2 errors
s018360868
p00097
Java
import java.util.Scanner; //Sum of Integers II public class Main { long[][][] dp; long get(int rest, int x, int s){ if(rest==0 && s==0)return 1; if(rest<0 || x<0 || s<0)return 0; if(dp[rest][x][s]!=-1)return dp[rest][x][s]; long res = 0; for(int nx=x;nx>=0;nx--)res+=get(rest-1, nx-1, s-nx); return dp[rest][x][s] = res; } void run(){ Scanner sc = new Scanner(System.in); dp = new long[10][101][1001]; for(int i=0;i<10;i++)for(int j=0;j<=100;j++)for(int k=0;k<=1000;k++)dp[i][j][k]=-1; for(;;){ int n = sc.nextInt(), S = sc.nextInt(); if((n|S)==0)break; System.out.println(get(n, 100, S)); } } public static void main(String[] args) { new AOJ0097().run(); } }
Main.java:29: error: cannot find symbol new AOJ0097().run(); ^ symbol: class AOJ0097 location: class Main 1 error
s624741362
p00097
Java
public class Main { public static void main(String[] args){ int[][] allData = new int[10][1001]; allData[0][0] = 1; for (int iRang = 0; iRang <= 100; iRang++){ for (int iSum = 1000; iSum >= 0; iSum--){ for (int item = 9; item >= 1; item--){ if (iSum - iRang >= 0) allData[item][iSum] += allData[item - 1][iSum - iRang]; } } } Scanner input = new Scanner(System.in); while (input.hasNext()){ String[] nAnds = input.nextLine().split(" "); int valueN = Integer.parseInt(nAnds[0]); int valueS = Integer.parseInt(nAnds[1]); System.out.printf("%d\n", allData[valueN][valueS]); } input.close(); } }
Main.java:17: error: cannot find symbol Scanner input = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:17: error: cannot find symbol Scanner input = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s008670454
p00097
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class AOJ_0097 { final private static int LIMIT = 100; public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); while (input.ready()) { String[] INPUT_STR = input.readLine().split(" "); int numCount = Integer.valueOf(INPUT_STR[0]); int sumNumber = Integer.valueOf(INPUT_STR[1]); if (numCount == 0 && sumNumber == 0) { break; } long ans = solver(numCount, sumNumber); System.out.println(ans); } } private static long solver(int numCount, int sumNumber) { int startIndex = Math.min(LIMIT, sumNumber - sumUp(numCount - 1)); return solver(numCount, sumNumber, 0, startIndex); } private static long solver(int numCount, int sumNumber, int currentSum, int startIndex) { long ret = 0; int currentLimit = sumNumber - currentSum; if (numCount == 1) { if (currentLimit <= startIndex) { return 1; } return 0; } else { int i = startIndex; while (true) { int nextStartIndex = sumNumber - (currentSum + i); if (nextStartIndex >= i) { nextStartIndex = i - 1; } ret += solver(numCount - 1, sumNumber, currentSum + i, nextStartIndex); if (sumNumber - (currentSum + i) >= (i - 1) * (numCount - 1)) { break; } if (numCount > i) { break; } i--; if (sumNumber - (currentSum + i) < sumUp(numCount - 2)) { break; } } } return ret; } private static int sumUp(int num) { int ret = 0; for (int i = 1; i < num; i++) { ret += i; } return ret; } }
Main.java:5: error: class AOJ_0097 is public, should be declared in a file named AOJ_0097.java public class AOJ_0097 ^ 1 error
s564470535
p00097
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import static java.lang.Integer.parseInt; /** * Sum of Integers II */ public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String line; String[] words; while ((line = br.readLine()) != null && !line.isEmpty()) { int n, s; n = parseInt(line.substring(0, line.indexOf(' '))); s = parseInt(line.substring(line.indexOf(' ') + 1)); if ((n | s) == 0) return; long[][] dp = new long[n + 1][s + 1]; dp[0][0] = 1; //dp[1][0] = 1; for (int i = 0; i <= 100; i++) { for (int j = 1; j < n; j++) { for (int k = i; k <= s; k++) { dp[n][s] += dp[n - 1][s - i]; } } } System.out.println(dp[n][s]); } }
Main.java:39: error: reached end of file while parsing } ^ 1 error
s215655176
p00097
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import static java.lang.Integer.parseInt; /** * Sum of Integers II */ public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String line; String[] words; while ((line = br.readLine()) != null && !line.isEmpty()) { int n, s; n = parseInt(line.substring(0, line.indexOf(' '))); s = parseInt(line.substring(line.indexOf(' ') + 1)); if ((n | s) == 0) return; long[][] dp = new long[n + 1][s + 1]; dp[0][0] = 1; //dp[1][0] = 1; for (int i = 0; i <= 100; i++) { for (int j = 1; j < n; j++) { for (int k = i; k <= s; k++) { dp[n][s] += dp[n - 1][s - i]; } } } System.out.println(dp[n][s]); } }
Main.java:39: error: reached end of file while parsing } ^ 1 error
s889991677
p00097
C
#include <stdio.h> #include <string.h> typedef long LONG; LONG memo[10][1001][101]; LONG comb(int *use, int n, int s, int m) { int i; LONG c; // printf("<%d %d %d>\n", n, s, m); if (memo[n][s][m] != -1){ return (memo[n][s][m]); } if (n == 1){ if (0 <= s && s <= 100 && s >= m && use[s] == 0){ // printf("["); // for (i = 0; i <= 100; i++){ // if (use[i])printf("%d ", i); // } // printf("%d]", s); memo[n][s][m] = 1; return (1); } memo[n][s][m] = 0; return (0); } c = 0; for (i = m; i <= 100; i++){ if (s - i >= 0){ c += comb(use, n - 1, s - i, i + 1); } } memo[n][s][m] = c; return (c); } int main(void) { int n, s; int c; int i; while (1){ scanf("%d%d", &n, &s); if (n == 0 && s == 0){ break; } memset(memo, -1, sizeof(memo)); printf("%ld\n", comb(use, n, s, 0)); } return (0); }
main.c: In function 'main': main.c:59:38: error: 'use' undeclared (first use in this function) 59 | printf("%ld\n", comb(use, n, s, 0)); | ^~~ main.c:59:38: note: each undeclared identifier is reported only once for each function it appears in
s167221043
p00097
C
#include <stdio.h> #include <string.h> int comb(int N, int S, int num); int n, s; int memo[101][1001][101]; int main(void) { int i, j; while (1){ memset(memo, -1, sizeof(memo)); scanf("%d %d", &n, &s); if (!n && !s)return 0; printf("%d\n", comb(n, 0, 0)); } } long comb(int N, int S, int num) { int i, j; if (s == S && !N)return 1; if (num == 101 || !N || S > s) return 0; if (memo[N][S][num] != -1) return memo[N][S][num]; return memo[N][S][num] = comb(N - 1, S + num, num + 1) + comb(N, S, num + 1); }
main.c:29:6: error: conflicting types for 'comb'; have 'long int(int, int, int)' 29 | long comb(int N, int S, int num) | ^~~~ main.c:4:5: note: previous declaration of 'comb' with type 'int(int, int, int)' 4 | int comb(int N, int S, int num); | ^~~~
s995882746
p00097
C
#include <stdio.h> #include <string.h> ?? int comb(int N, int S, int num); ?? int n, s; long memo[11][1001][101]; ?? int main(void) { ????????int i, j; ?????????? ????????while (1){ ?????????????????? ?????????????????? ????????????????memset(memo, -1, sizeof(memo)); ?????????????????? ?????????????????? ????????????????scanf("%d %d", &n, &s); ????????????????if (!n && !s)return 0; ?????????????????? ????????????????printf("%ld\n", comb(n, 0, 0)); ?????????????????? ?????????????????? ????????} ?????????? } ?? int comb(int N, int S, int num) { ????????int i, j; ?????????? ????????if (s == S && !N)return 1; ?????????? ????????if (num == 101 || !N)return 0; ?????????? ????????if (memo[N][S][num] != -1)return memo[N][S][num]; ?????????? ?????????? ????????return memo[N][S][num] = comb(N - 1, S + num, num + 1) + comb(N, S, num + 1); ?????????? }
main.c:3:1: error: expected identifier or '(' before '?' token 3 | ?? | ^ main.c:5:1: error: expected identifier or '(' before '?' token 5 | ?? | ^ main.c:8:1: error: expected identifier or '(' before '?' token 8 | ?? | ^ main.c:28:1: error: expected identifier or '(' before '?' token 28 | ?? | ^
s682537937
p00097
C
#include<stdio.h> #define MAX 101 int j; int A[MAX]; for(j=0;j<MAX;j++)A[j]=j; int cnt=0; void dfs(int i,int rest,int d,int n){ if(i<MAX){ if(d==n){ if(rest==0){cnt++;return;} else return; } if(rest<0)return;/*sを超える*/ dfs(i+1,rest-A[i],d+1,n);/*A[i]を選ぶ*/ dfs(i+1,rest,d,n);/*A[i]を選ばない*/ } return; } int main(){ int n,s; while(1){ scanf("%d %d",&n,&s); if(n==0 && s==0)break; if(s > 55)printf("0\n"); else { cnt=0; dfs(0,s,0,n); printf("%d\n",cnt); } } return 0; }
main.c:5:1: error: expected identifier or '(' before 'for' 5 | for(j=0;j<MAX;j++)A[j]=j; | ^~~ main.c:5:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 5 | for(j=0;j<MAX;j++)A[j]=j; | ^ main.c:5:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token 5 | for(j=0;j<MAX;j++)A[j]=j; | ^~