submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s401057651
p04029
C++
#include <bits/stdc++.h> using namespace std; int main() { int N ; cin >> N >> end; cout << ( N * N + 1 ) / 2 << endl; }
a.cc: In function 'int main()': a.cc:6:12: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and '<unresolved overloaded function type>') 6 | cin >> N >> end; | ~~~~~~~~~^~~~~~ In file included from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127, from a.cc:1: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'bool&' 170 | operator>>(bool& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short int&' 174 | operator>>(short& __n); | ~~~~~~~^~~ /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short unsigned int&' 177 | operator>>(unsigned short& __n) | ~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'int&' 181 | operator>>(int& __n); | ~~~~~^~~ /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned int&' 184 | operator>>(unsigned int& __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long int&' 188 | operator>>(long& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long unsigned int&' 192 | operator>>(unsigned long& __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long int&' 199 | operator>>(long long& __n) | ~~~~~~~~~~~^~~ /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long unsigned int&' 203 | operator>>(unsigned long long& __n) | ~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 219 | operator>>(float& __f) | ^~~~~~~~ /usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'float&' 219 | operator>>(float& __f) | ~~~~~~~^~~ /usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 223 | operator>>(double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'double&' 223 | operator>>(double& __f) | ~~~~~~~~^~~ /usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 227 | operator>>(long double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long double&' 227 | operator>>(long double& __f) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'void*&' 328 | operator>>(void*& __p) | ~~~~~~~^~~ /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]' 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ^~~~~~~~ /usr/include/c++/14/istream:133:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::ios_base& (*)(std::ios_base&)' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:352:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; __streambuf_type = std::basic_streambuf<char>]' 352 | operator>>(__streambuf_type* __sb); | ^~~~~~~~ /usr/include/c++/14/istream:352:36: note: no known conversion for argument 1 from '<unresolved overlo
s743076172
p04029
C++
#include <bits/stdc++.h> using namespace std; int main() { int N ; cin >> N >> ; cout << ( N * N + 1 ) / 2 << endl; }
a.cc: In function 'int main()': a.cc:6:15: error: expected primary-expression before ';' token 6 | cin >> N >> ; | ^
s503309626
p04029
C
#include<stdio.h> int main() { int n, sum; scanf("%d",&n); sum=(n*(n+1))/2; } return 0;
main.c:9:1: error: expected identifier or '(' before 'return' 9 | return 0; | ^~~~~~
s337997523
p04029
C++
#include <bits/stdc++.h> int main() { int n; std::cin>>n; std::cout<<n*(n+1)/2<<endl; return 0; }
a.cc: In function 'int main()': a.cc:6:27: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 6 | std::cout<<n*(n+1)/2<<endl; | ^~~~ | std::endl In file included from /usr/include/c++/14/istream:41, from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127, from a.cc:1: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s983284176
p04029
C++
#include<iostream> using namespace std; int main(){ int a,ans=0; cin>>a; for(int i=1;i<=a;i++){ ans+i=ans; } cout>>ans; return 0; }
a.cc: In function 'int main()': a.cc:7:8: error: lvalue required as left operand of assignment 7 | ans+i=ans; | ~~~^~ a.cc:9:7: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int') 9 | cout>>ans; | ~~~~^~~~~ | | | | | int | std::ostream {aka std::basic_ostream<char>} a.cc:9:7: note: candidate: 'operator>>(int, int)' (built-in) 9 | cout>>ans; | ~~~~^~~~~ a.cc:9:7: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int' In file included from /usr/include/c++/14/string:55, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 835 | operator>>(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed: a.cc:9:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 9 | cout>>ans; | ^~~ 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>>ans; | ^~~~ 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:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 9 | cout>>ans; | ^~~ /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:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 9 | cout>>ans; | ^~~ /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:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 9 | cout>>ans; | ^~~ /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:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 9 | cout>>ans; | ^~~ /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:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 9 | cout>>ans; | ^~~ /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:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 9 | cout>>ans; | ^~~ /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 = int&]': a.cc:9:9: required from here 9 | cout>>ans; | ^~~ /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) | ^~~~~~~~
s276853413
p04029
C++
#include<bits/stdc++.h> using namespace std; int main() { int N,sum; cin>>N; for (int i=o;i<N;i++){ sum +=i; } cout<<sum<<endl; }
a.cc: In function 'int main()': a.cc:8:14: error: 'o' was not declared in this scope 8 | for (int i=o;i<N;i++){ | ^
s976821240
p04029
C++
#include <bits/stdc++.h> #include <cstdio> using namespace std; int main() { int N; cin >> N; printf(N * (N + 1) / 2); }
a.cc: In function 'int main()': a.cc:9:28: error: invalid conversion from 'int' to 'const char*' [-fpermissive] 9 | printf(N * (N + 1) / 2); | ~~~~~~~~~~~~^~~ | | | int In file included from /usr/include/c++/14/cstdio:42, from /usr/include/c++/14/ext/string_conversions.h:45, from /usr/include/c++/14/bits/basic_string.h:4154, from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52, from a.cc:1: /usr/include/stdio.h:363:43: note: initializing argument 1 of 'int printf(const char*, ...)' 363 | extern int printf (const char *__restrict __format, ...); | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
s772054167
p04029
C
#include<stdio.h> int main() { int a,b,N; clrscr(); printf("enter a number"); scanf("%d",&N); a=1; b=0; while(a<=N) { b=b+a; a=a+1; } printf("%d",b); getch(); }
main.c: In function 'main': main.c:6:7: error: implicit declaration of function 'clrscr' [-Wimplicit-function-declaration] 6 | clrscr(); | ^~~~~~ main.c:17:7: error: implicit declaration of function 'getch'; did you mean 'getc'? [-Wimplicit-function-declaration] 17 | getch(); | ^~~~~ | getc
s587757563
p04029
C
#include<stdio.h> void main() { int a,b,N; clrscr(); printf("enter a number"); scanf("%d",&N); a=1; b=0; while(a<=N) { b=b+a; a=a+1; } printf("%d",b); getch(); }
main.c: In function 'main': main.c:7:7: error: implicit declaration of function 'clrscr' [-Wimplicit-function-declaration] 7 | clrscr(); | ^~~~~~ main.c:18:7: error: implicit declaration of function 'getch'; did you mean 'getc'? [-Wimplicit-function-declaration] 18 | getch(); | ^~~~~ | getc
s186254726
p04029
C
#include<stdio.h> #include<conio.h> void main() { int a,b,N; clrscr(); printf("enter a number"); scanf("%d",&N); a=1; b=0; while(a<=N) { b=b+a; a=a+1; } printf("%d",b); getch(); }
main.c:2:13: fatal error: conio.h: No such file or directory 2 | #include<conio.h> | ^~~~~~~~~ compilation terminated.
s703865535
p04029
C++
#include<stdio.h> void main() { int a,b,N; clrscr(); printf("enter a number"); scanf("%d",&N); a=1; b=0; while(a<=N) { b=b+a; a=a+1; } printf("%d",b); getch(); }
a.cc:4:5: error: '::main' must return 'int' 4 | void main() | ^~~~ a.cc: In function 'int main()': a.cc:7:7: error: 'clrscr' was not declared in this scope 7 | clrscr(); | ^~~~~~ a.cc:18:7: error: 'getch' was not declared in this scope; did you mean 'getc'? 18 | getch(); | ^~~~~ | getc
s691555854
p04029
C++
#include<stdio.h> #include<conio.h> void main() { int a,b,N; clrscr(); scanf("%d",&N); a=1; b=0; while(a<=N) { b=b+a; a=a+1; } printf("%d",b); getch(); }
a.cc:2:13: fatal error: conio.h: No such file or directory 2 | #include<conio.h> | ^~~~~~~~~ compilation terminated.
s213206355
p04029
Java
import java.util.*; class Main{ public static void main(String[] arg){ Scanner stdIn=new Scanner(System.in); int N=stdIn.nextInt(); int total=0; for(int i=1;i<=N;i++){ int total+=i; } System.out.println(total); } }
Main.java:8: error: ';' expected int total+=i; ^ Main.java:8: error: not a statement int total+=i; ^ 2 errors
s129921501
p04029
C
#include<stdio.h> #include<conio.h> void main() { int a,b,N; clrscr(); printf("enter a number"); scanf("%d",&N); a=1; b=0; while(a<=N) { b=b+a; a=a+1; } printf("%d",b); getch(); }
main.c:2:9: fatal error: conio.h: No such file or directory 2 | #include<conio.h> | ^~~~~~~~~ compilation terminated.
s541242780
p04029
C++
#include<stdio.h> #include<conio.h> void main() { int a,b,N; clrscr(); printf("enter a number"); scanf("%d",&N); a=1; b=0; while(a<=N) { b=b+a; a=a+1; } printf("%d",b); getch(); }
a.cc:2:9: fatal error: conio.h: No such file or directory 2 | #include<conio.h> | ^~~~~~~~~ compilation terminated.
s082536167
p04029
C++
#include<stdio.h> void main() { int a,b,N; clrscr(); printf("enter a number"); scanf("%d",&N); a=1; b=0; while(a<=N) { b=b+a; a=a+1; } printf("%d",b); getch(); }
a.cc:2:1: error: '::main' must return 'int' 2 | void main() | ^~~~ a.cc: In function 'int main()': a.cc:5:3: error: 'clrscr' was not declared in this scope 5 | clrscr(); | ^~~~~~ a.cc:16:3: error: 'getch' was not declared in this scope; did you mean 'getc'? 16 | getch(); | ^~~~~ | getc
s171726535
p04029
C++
#include<stdio.h> #include<conio.h> void main() { int a,b,N; clrscr(); printf("enter a number"); scanf("%d",&N); a=1; b=0; while(a<=N) { b=b+a; a=a+1; } printf("%d",b); getch(); }
a.cc:2:9: fatal error: conio.h: No such file or directory 2 | #include<conio.h> | ^~~~~~~~~ compilation terminated.
s627488874
p04029
C++
#include <iostream> using namespace std; int main(){ int n; cin << n; cout << (1 + n) * n / 2 << endl; return 0; }
a.cc: In function 'int main()': a.cc:6:7: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 6 | cin << n; | ~~~ ^~ ~ | | | | | int | std::istream {aka std::basic_istream<char>} a.cc:6:7: note: candidate: 'operator<<(int, int)' (built-in) 6 | cin << n; | ~~~~^~~~ a.cc:6:7: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int' In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, from /usr/include/c++/14/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/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)' 763 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed: a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 6 | cin << n; | ^ /usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 4077 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed: a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 6 | cin << n; | ^ 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:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)' 125 | operator<<(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed: a.cc:6:3: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte' 6 | cin << n; | ^~~ In file included from /usr/include/c++/14/bits/ios_base.h:46: /usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)' 339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e) | ^~~~~~~~ /usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed: a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 6 | cin << n; | ^ /usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)' 563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c) | ^~~~~~~~ /usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed: a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 6 | cin << n; | ^ /usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)' 573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed: a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 6 | cin << n; | ^ /usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)' 579 | operator<<(basic_ostream<char, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed: a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 6 | cin << n; | ^ /usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)' 590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed: a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 6 | cin << n; | ^ /usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)' 595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed: a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 6 | cin << n; | ^ /usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)' 654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed: a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 6 | cin << n; | ^ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)' 307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed: a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 6 | cin << n; | ^ /usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)' 671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed: a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 6 | cin << n; | ^ /usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)' 684 | operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:684:5: note: template argument deduction/substitution failed: a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 6 | cin << n; | ^ /usr/include/c++/14/ostream:689:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const unsigned char*)' 689 | operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:689:5: note: template argument deduction/substitution failed: a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 6 | cin << n; | ^ /usr/include/c++/14/ostream:810:5: note: candidate: 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&)' 810 | operator<<(_Ostream&& __os, const _Tp& __x) | ^~~~~~~~ /usr/include/c++/14/ostream:810:5: note: template argument deduction/substitution failed: /usr/include/c++/14/ostream: In substitution of 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = std::basic_istream<char>&; _Tp = int]': a.cc:6:10: required from here 6 | cin << n; | ^ /usr/include/c++/14/ostream:810:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 810 | operator<<(_Ostream&& __os, const _Tp& __x) | ^~~~~~~~
s445936822
p04029
C++
N=int(input()) ans =0 for i in range(0,N+1): ans+=i print(ans)
a.cc:1:1: error: 'N' does not name a type 1 | N=int(input()) | ^
s843159451
p04029
C++
// #pragma comment(linker, "/stack:200000000") // #pragma GCC optimize("O3") // #pragma GCC optimize("Ofast") // #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") // #pragma GCC optimize("unroll-loops") #include<bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #ifdef on_linux #include <sys/resource.h> #endif using namespace std; using namespace __gnu_pbds; #define sz(x) (int)((x).size()) #define all(x) (x).begin(), (x).end() #define mem0(x) memset(x, 0, sizeof (x)) #define mem1(x) memset(x, -1, sizeof (x)) #define sleep(x) std::this_thread::sleep_for(std::chrono::milliseconds(x)) #define DECIMAL(n) std::cout << std::fixed << std::setprecision(n); #define rep(i,a,b) for(int32_t i = (a); i < (b); ++i) #define between(i,x,y) ((i) >= (x) && (i) <= (y)) // #define clamp(i,x,y) clamp(i, x, y) #define sqr(a) ((a) * (a)) #define pii pair<int32_t, int32_t> #define pll pair<long long, long long> #define mp make_pair #define fi first #define sc second #define pb push_back #define ppb pop_back #define pf push_front #define ppf pop_front #define lbd lower_bound #define ubd upper_bound #define int long long #define ll long long template<typename T, typename U> istream& operator>>(istream& in, pair<T, U> &a) {in >> a.first >> a.second; return in;} template<typename T, typename U> ostream& operator<<(ostream& out, pair<T, U> a) {out << "{" << a.first << ", " << a.second << "}"; return out;} template<typename T, typename U> static inline void remin(T &x, U y) {if (y < x) {x = y;}} template<typename T, typename U> static inline void remax(T &x, U y) {if (x < y) {x = y;}} static mt19937_64 gen(chrono::duration_cast<chrono::nanoseconds>(chrono::high_resolution_clock::now().time_since_epoch()).count()); inline long long toint(const string &s) {stringstream ss; ss << s; long long x; ss >> x; return x;} inline string tostring(long long number) {stringstream ss; ss << number; return ss.str();} inline string tobin(long long x) {return bitset<63>(x).to_string();} void alllower(string &u) {transform(u.begin(), u.end(), u.begin(), ::tolower); return;} void allupper(string &u) {transform(u.begin(), u.end(), u.begin(), ::toupper); return;} template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; // find_by_order(k) returns iterator to kth element starting from 0; // order_of_key(k) returns count of elements strictly smaller than k; // erase, insert same as normal set const long double PI = 3.14159265358979323846264338; const long double eps = 1e-12; const long long fftmod = 998244353; const long long MOD = 1e9 + 7; const long long INF = 1e18; const int32_t N = 1e5 + 10; const int32_t NN = 1e6 + 10; inline void dobbysolver(int testcase) { int n; cin >> n; cout < n*(n + 1) / 2; return; } int32_t main() { #ifdef on_linux rlimit cpu_time {.rlim_cur = 2, .rlim_max = RLIM_INFINITY}; setrlimit(RLIMIT_CPU, &cpu_time); #endif ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); int TESTS = 1; //cin >> TESTS; for (int i = 1; i <= TESTS; ++i) { // cout << "Case #" << i << ": "; dobbysolver(i); if (i != TESTS) cout << '\n'; } return 0; }
a.cc: In function 'void dobbysolver(long long int)': a.cc:75:14: error: no match for 'operator<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'long long int') 75 | cout < n*(n + 1) / 2; | ~~~~ ^ ~~~~~~~~~~~~~ | | | | | long long int | std::ostream {aka std::basic_ostream<char>} a.cc:75:14: note: candidate: 'operator<(int, long long int)' (built-in) 75 | cout < n*(n + 1) / 2; | ~~~~~^~~~~~~~~~~~~~~ a.cc:75:14: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int' In file included from /usr/include/c++/14/regex:68, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181, from a.cc:7: /usr/include/c++/14/bits/regex.h:1143:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const sub_match<_BiIter>&)' 1143 | operator<(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1143:5: note: template argument deduction/substitution failed: a.cc:75:28: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 75 | cout < n*(n + 1) / 2; | ^ /usr/include/c++/14/bits/regex.h:1224:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)' 1224 | operator<(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1224:5: note: template argument deduction/substitution failed: a.cc:75:28: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>' 75 | cout < n*(n + 1) / 2; | ^ /usr/include/c++/14/bits/regex.h:1317:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)' 1317 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1317:5: note: template argument deduction/substitution failed: a.cc:75:28: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 75 | cout < n*(n + 1) / 2; | ^ /usr/include/c++/14/bits/regex.h:1391:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)' 1391 | operator<(typename iterator_traits<_Bi_iter>::value_type const* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1391:5: note: template argument deduction/substitution failed: a.cc:75:28: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'long long int' 75 | cout < n*(n + 1) / 2; | ^ /usr/include/c++/14/bits/regex.h:1485:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)' 1485 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1485:5: note: template argument deduction/substitution failed: a.cc:75:28: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 75 | cout < n*(n + 1) / 2; | ^ /usr/include/c++/14/bits/regex.h:1560:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)' 1560 | operator<(typename iterator_traits<_Bi_iter>::value_type const& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1560:5: note: template argument deduction/substitution failed: a.cc:75:28: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'long long int' 75 | cout < n*(n + 1) / 2; | ^ /usr/include/c++/14/bits/regex.h:1660:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)' 1660 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1660:5: note: template argument deduction/substitution failed: a.cc:75:28: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 75 | cout < n*(n + 1) / 2; | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed: a.cc:75:28: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::pair<_T1, _T2>' 75 | cout < n*(n + 1) / 2; | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 448 | operator<(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed: a.cc:75:28: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 75 | cout < n*(n + 1) / 2; | ^ /usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 493 | operator<(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed: a.cc:75:28: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 75 | cout < n*(n + 1) / 2; | ^ /usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1694 | operator<(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed: a.cc:75:28: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 75 | cout < n*(n + 1) / 2; | ^ /usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1760 | operator<(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed: a.cc:75:28: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 75 | cout < n*(n + 1) / 2; | ^ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 673 | operator< (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed: a.cc:75:28: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 75 | cout < n*(n + 1) / 2; | ^ /usr/include/c++/14/string_view:680:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 680 | operator< (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:680:5: note: template argument deduction/substitution failed: a.cc:75:28: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 75 | cout < n*(n + 1) / 2; | ^ /usr/include/c++/14/string_view:688:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 688 | operator< (__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:688:5: note: template argument deduction/substitution failed: a.cc:75:28: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'long long int' 75 | cout < n*(n + 1) / 2; | ^ /usr/include/c++/14/bits/basic_string.h:3874:5: note: candidate: 'template<class _Cha
s543515831
p04029
C++
#include <bits/stdc++.h> using namespace std; int main{ int N; cin>>N; cout<<N*(N+1)/2<<endl; }
a.cc:4:5: error: cannot declare '::main' to be a global variable 4 | int main{ | ^~~~ a.cc:5:3: error: expected primary-expression before 'int' 5 | int N; | ^~~ a.cc:5:3: error: expected '}' before 'int' a.cc:4:9: note: to match this '{' 4 | int main{ | ^ a.cc:6:3: error: 'cin' does not name a type 6 | cin>>N; | ^~~ a.cc:7:3: error: 'cout' does not name a type 7 | cout<<N*(N+1)/2<<endl; | ^~~~ a.cc:8:1: error: expected declaration before '}' token 8 | } | ^
s640884794
p04029
C
#include<stdio.h> int main(void) { int n,i,r; scanf("%d",&n); r=0; for(i=1;i<=n;i++) r=r+i; printf("%d",r); return 0; } ~
main.c:18:1: error: expected identifier or '(' before '~' token 18 | ~ | ^
s547865249
p04029
C
#include <stdio.h> 2 int main(void) 3 { 4 int a,b,i; 5 a=0;b=0;i=0; 6 scanf("%d",&a); 7 for(i=0;i<a;i++); 8 b=b+i; 9 10 printf("%d\n",b); 11 return 0; 12 }
main.c:2:3: error: expected identifier or '(' before numeric constant 2 | 2 int main(void) | ^
s039592620
p04029
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef double dd; #define all(v) v.begin(),v.end() #define endl "\n" #define clr(n, r) memset(n,r,sizeof(n)); void fast() { cin.tie(0); cin.sync_with_stdio(0); } ll n, m; int main() { fast(); cin>>n; cout<<(n*(n+1))/2; }#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef double dd; #define all(v) v.begin(),v.end() #define endl "\n" #define clr(n, r) memset(n,r,sizeof(n)); void fast() { cin.tie(0); cin.sync_with_stdio(0); } ll n, m; int main() { fast(); cin>>n; cout<<(n*(n+1))/2; }
a.cc:24:2: error: stray '#' in program 24 | }#include <bits/stdc++.h> | ^ a.cc:24:3: error: 'include' does not name a type 24 | }#include <bits/stdc++.h> | ^~~~~~~ a.cc:33:6: error: redefinition of 'void fast()' 33 | void fast() { | ^~~~ a.cc:10:6: note: 'void fast()' previously defined here 10 | void fast() { | ^~~~ a.cc:39:4: error: redefinition of 'll n' 39 | ll n, m; | ^ a.cc:16:4: note: 'll n' previously declared here 16 | ll n, m; | ^ a.cc:39:7: error: redefinition of 'll m' 39 | ll n, m; | ^ a.cc:16:7: note: 'll m' previously declared here 16 | ll n, m; | ^ a.cc:42:5: error: redefinition of 'int main()' 42 | int main() { | ^~~~ a.cc:19:5: note: 'int main()' previously defined here 19 | int main() { | ^~~~
s122349654
p04029
C++
#include<iostream> using namespace std; int main(){ int n; cin>>n; cout<<(n*n(n+1))/2; }
a.cc: In function 'int main()': a.cc:6:13: error: 'n' cannot be used as a function 6 | cout<<(n*n(n+1))/2; | ~^~~~~
s199085074
p04029
C++
#include <bits/stdc++.h> int main(){ int n; cin >> n; cout << n*((n+1)/2) <<endl; }
a.cc: In function 'int main()': a.cc:4:16: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 4 | int n; cin >> n; | ^~~ | std::cin In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146, from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:5:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 5 | cout << n*((n+1)/2) <<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:5:31: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 5 | cout << n*((n+1)/2) <<endl; | ^~~~ | std::endl In file included from /usr/include/c++/14/istream:41, from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s070306042
p04029
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; cout<<n*(n+1)/2<,endl; }
a.cc: In function 'int main()': a.cc:7:19: error: expected primary-expression before ',' token 7 | cout<<n*(n+1)/2<,endl; | ^
s730911533
p04029
C++
#include <iostream> int n; using namespace std; int main(){ cin >> n; cout <<n*(n+1)/2 }
a.cc: In function 'int main()': a.cc:6:19: error: expected ';' before '}' token 6 | cout <<n*(n+1)/2 | ^ | ; 7 | } | ~
s638188007
p04029
C++
#include <iostream> using namespace std ; int main() { int N ; cin >> N ; int i = 1 ; int sum = 0 ; while( i <= N ){ sum += i ; i++; } cout << sum << \n ; return 0 ; }
a.cc:16:20: error: stray '\' in program 16 | cout << sum << \n ; | ^ a.cc: In function 'int main()': a.cc:16:21: error: 'n' was not declared in this scope 16 | cout << sum << \n ; | ^
s321842800
p04029
C++
#include <bits/stdc++.h> using namespace std; using ll=long long; const ll MOD=1000000007; int main() { int N; cin N; cout << N*(N+1)/2 << endl; }
a.cc: In function 'int main()': a.cc:9:6: error: expected ';' before 'N' 9 | cin N; | ^~ | ;
s675774204
p04029
C++
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int sum = 0; for (i=0; i<n; i++) sum += i+1; cout << sum << endl; }
a.cc: In function 'int main()': a.cc:10:14: error: 'i' was not declared in this scope 10 | for (i=0; i<n; i++) | ^
s793313336
p04029
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N; cin >> N; cout << N(N+1) << endl; }
a.cc: In function 'int main()': a.cc:7:12: error: 'N' cannot be used as a function 7 | cout << N(N+1) << endl; | ~^~~~~
s752910410
p04029
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; class Main { public static void main(String[] args) throws Exception { try { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int N = Integer.parseInt(br.readLine()); int result = getSum(N); } catch (IOException | NumberFormatException e) { e.printStackTrace(); System.exit(0); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } private int getSum(int N) { int sum = 0; for(int i = 1; i <= N; i++) { sum += i; } return sum; } }
Main.java:17: error: non-static method getSum(int) cannot be referenced from a static context int result = getSum(N); ^ 1 error
s186956131
p04029
C++
#include <bits/stdc++.h> using namespace std; int main() { int N: cin >> N; cout << (N*(N+1))/2 << endl; }
a.cc: In function 'int main()': a.cc:5:8: error: found ':' in nested-name-specifier, expected '::' 5 | int N: | ^ | :: a.cc:5:7: error: 'N' has not been declared 5 | int N: | ^ a.cc:6:7: error: qualified-id in declaration before '>>' token 6 | cin >> N; | ^~ a.cc:8:12: error: 'N' was not declared in this scope 8 | cout << (N*(N+1))/2 << endl; | ^
s973588947
p04029
C++
#include<bits/stdc++.h> using namespace std; int main(int argc, char **argv){ int n,ans; cin>>n; ans=n*(n+1))/2; printf("%d\n",ans); return 0; }
a.cc: In function 'int main(int, char**)': a.cc:6:16: error: expected ';' before ')' token 6 | ans=n*(n+1))/2; | ^ | ;
s364880917
p04029
C++
#include<bits/stdc++.h> using namespace std; int main(void){ int n,ans; cin>>n; ans=n*(n+1))/2; printf("%d\n",ans); return 0; }
a.cc: In function 'int main()': a.cc:6:16: error: expected ';' before ')' token 6 | ans=n*(n+1))/2; | ^ | ;
s792210480
p04029
C++
#include <iostream> #include <string> int main() { std::str s; std::cin >> s; int i; std::str ans = ""; for (i = 0; i < s.size(); i++) { if (s[i] == '0' || s[i] == '1') ans += s[i]; if (s[i] == 'B') ans.pop_back; } std::cout << ans; return 0; }
a.cc: In function 'int main()': a.cc:6:8: error: 'str' is not a member of 'std' 6 | std::str s; | ^~~ a.cc:7:15: error: 's' was not declared in this scope 7 | std::cin >> s; | ^ a.cc:9:8: error: 'str' is not a member of 'std' 9 | std::str ans = ""; | ^~~ a.cc:11:37: error: 'ans' was not declared in this scope; did you mean 'abs'? 11 | if (s[i] == '0' || s[i] == '1') ans += s[i]; | ^~~ | abs a.cc:12:22: error: 'ans' was not declared in this scope; did you mean 'abs'? 12 | if (s[i] == 'B') ans.pop_back; | ^~~ | abs a.cc:14:16: error: 'ans' was not declared in this scope; did you mean 'abs'? 14 | std::cout << ans; | ^~~ | abs
s558627131
p04029
C++
#include <iostream> int main() { int N; std::cin >> N; std::out << (1+N)*N/2; return 0; }
a.cc: In function 'int main()': a.cc:7:8: error: 'out' is not a member of 'std'; did you mean 'oct'? 7 | std::out << (1+N)*N/2; | ^~~ | oct
s193204907
p04029
C++
#include <bits/stdc++.h> #define rep(i,a,b) for(int i=a; i< (int)(b); ++i) using namespace std; int main(){ cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; int ans=0; rep(0,1,(n+1))ans+=i; cout << ans << endl; }
a.cc: In function 'int main()': a.cc:12:8: error: expected unqualified-id before numeric constant 12 | rep(0,1,(n+1))ans+=i; | ^ a.cc:2:28: note: in definition of macro 'rep' 2 | #define rep(i,a,b) for(int i=a; i< (int)(b); ++i) | ^ a.cc:12:8: error: expected ';' before numeric constant 12 | rep(0,1,(n+1))ans+=i; | ^ a.cc:2:28: note: in definition of macro 'rep' 2 | #define rep(i,a,b) for(int i=a; i< (int)(b); ++i) | ^ a.cc:12:8: error: lvalue required as left operand of assignment 12 | rep(0,1,(n+1))ans+=i; | ^ a.cc:2:28: note: in definition of macro 'rep' 2 | #define rep(i,a,b) for(int i=a; i< (int)(b); ++i) | ^ a.cc:2:44: error: expected ')' before ';' token 2 | #define rep(i,a,b) for(int i=a; i< (int)(b); ++i) | ~ ^ a.cc:12:4: note: in expansion of macro 'rep' 12 | rep(0,1,(n+1))ans+=i; | ^~~ a.cc:12:8: error: lvalue required as increment operand 12 | rep(0,1,(n+1))ans+=i; | ^ a.cc:2:48: note: in definition of macro 'rep' 2 | #define rep(i,a,b) for(int i=a; i< (int)(b); ++i) | ^
s645813029
p04029
C++
#include <bits/stdc++.h> #define rep(i,a,b) for(int i=a; i< (int)(b); ++i) using namespace std; int main(){ cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; int ans=0; rep(0,1,(n+1) ans+=i; cout << ans << endl; }
a.cc:18:1: error: unterminated argument list invoking macro "rep" 18 | | ^ a.cc: In function 'int main()': a.cc:12:4: error: 'rep' was not declared in this scope 12 | rep(0,1,(n+1) ans+=i; | ^~~ a.cc:12:7: error: expected '}' at end of input 12 | rep(0,1,(n+1) ans+=i; | ^ a.cc:6:11: note: to match this '{' 6 | int main(){ | ^
s769218563
p04029
C++
#include <bits/stdc++.h> #define rep(i,a,b) for(int i=a; i< (int)(b); ++i) using namespace std; int main(){ cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; int ans=0; rep(0,1,n+1) ans+=i; cout << ans << endl; }
a.cc: In function 'int main()': a.cc:12:8: error: expected unqualified-id before numeric constant 12 | rep(0,1,n+1) ans+=i; | ^ a.cc:2:28: note: in definition of macro 'rep' 2 | #define rep(i,a,b) for(int i=a; i< (int)(b); ++i) | ^ a.cc:12:8: error: expected ';' before numeric constant 12 | rep(0,1,n+1) ans+=i; | ^ a.cc:2:28: note: in definition of macro 'rep' 2 | #define rep(i,a,b) for(int i=a; i< (int)(b); ++i) | ^ a.cc:12:8: error: lvalue required as left operand of assignment 12 | rep(0,1,n+1) ans+=i; | ^ a.cc:2:28: note: in definition of macro 'rep' 2 | #define rep(i,a,b) for(int i=a; i< (int)(b); ++i) | ^ a.cc:2:44: error: expected ')' before ';' token 2 | #define rep(i,a,b) for(int i=a; i< (int)(b); ++i) | ~ ^ a.cc:12:4: note: in expansion of macro 'rep' 12 | rep(0,1,n+1) ans+=i; | ^~~ a.cc:12:8: error: lvalue required as increment operand 12 | rep(0,1,n+1) ans+=i; | ^ a.cc:2:48: note: in definition of macro 'rep' 2 | #define rep(i,a,b) for(int i=a; i< (int)(b); ++i) | ^
s745900442
p04029
C
#include <stdio.h> #include <stdlib.h> #include <string.h> #define MAX(a,b) (a > b) ? a : b #define MIN(a,b) (a < b) ? a : b const int inf = 1000000000; // 10^9 int c(int n){ int m; if (n == 0) return 1; // 0! = 1 m = c(n - 1); printf("%d") return n + m; } int main(){ int n;scanf("%d",&n); int ans = c(n); printf("%d",&ans); return 0; }
main.c: In function 'c': main.c:13:15: error: expected ';' before 'return' 13 | printf("%d") | ^ | ; 14 | return n + m; | ~~~~~~
s748102084
p04029
C
#include <stdio.h> #include <stdlib.h> #include <string.h> #define MAX(a,b) (a > b) ? a : b #define MIN(a,b) (a < b) ? a : b const int inf = 1000000000; // 10^9 int c(int x){ int y if(x == 0)return 1; y = c(x - 1); return x + y; } int main(){ int n;scanf("%d",&n); c(n); printf("%d",&n); return 0; }
main.c: In function 'c': main.c:10:4: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'if' 10 | if(x == 0)return 1; | ^~ main.c:11:4: error: 'y' undeclared (first use in this function) 11 | y = c(x - 1); | ^ main.c:11:4: note: each undeclared identifier is reported only once for each function it appears in
s221843151
p04029
C++
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef vector<ll> vl; typedef pair<ll, ll> PP; #define rep(i, n) for(ll i = 0; i < ll(n); i++) #define all(v) v.begin(), v.end() bool chmin(ll & a, ll b) { if (b < a) { a = b; return 1; } return 0; } bool chmax(ll & a, ll b) { if (b > a) { a = b; return 1; } return 0; } const ll INF = 999999999999999; const ll MOD = 1000000007; const ll MAX_N=500010; ll a, b, c, d, e, f, p, t, x, y, z, q, m, n, r, h, k, w, l, ans; gragh int main() { cin>>n; cout<<n*(n+1)/2<<endl; }
a.cc:14:1: error: 'gragh' does not name a type 14 | gragh | ^~~~~
s411015191
p04029
C
#include<stdio.h> int main(void){ double n; int c; scanf("%f", &n); c = (1+n)/2*n; print(c); return 0; }
main.c: In function 'main': main.c:8:3: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration] 8 | print(c); | ^~~~~ | printf
s401302595
p04029
C
#include<stdio.h> int main(void){ double n; int c; scanf("%f", &n); c = (1+n)/2*n; print(c); return 0; }
main.c: In function 'main': main.c:8:3: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration] 8 | print(c); | ^~~~~ | printf
s033904592
p04029
C++
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i = 0; i < (int)(n); ++i) using P = pair<int,int> int main(){ int N; cin >> N; int ans = N * (N + 1) / 2; cout << ans << endl; return 0; }
a.cc:4:11: error: two or more data types in declaration of 'type name' 4 | using P = pair<int,int> | ^~~~~~~~~~~~~
s187311273
p04029
C++
#include <iostream> using namespace std; void main() { cin.tie(0); ios::sync_with_stdio(false); int x; cin >> x; cout << (1 + x) * x / 2 << "\n"; }
a.cc:3:1: error: '::main' must return 'int' 3 | void main() { | ^~~~
s970038056
p04029
C++
#include <iostream> using namespace std; void main() { cin.tie(0); ios::sync_with_stdio(false); int x; cin >> x; cout << (1 + x) * x / 2 << "\n"; }
a.cc:3:1: error: '::main' must return 'int' 3 | void main() { | ^~~~
s857485929
p04029
C++
#include <iostream> using namespace std; int main(){ int n; scanf("%d",&n); printf("%d",n*(n+1)/2) }
a.cc: In function 'int main()': a.cc:6:27: error: expected ';' before '}' token 6 | printf("%d",n*(n+1)/2) | ^ | ; 7 | } | ~
s586721840
p04029
C++
#include <iostream> using namespace std; int main(){ int n; scanf("%d",&n); printf("%d",n*(n+1)/2) }
a.cc: In function 'int main()': a.cc:6:27: error: expected ';' before '}' token 6 | printf("%d",n*(n+1)/2) | ^ | ; 7 | } | ~
s440501600
p04029
Java
import java.util.Scanner; public class MAIN { public static void main(String[] args) { Scanner input = new Scanner (System.in); int angka = input.nextInt(); int sum = 0; for (int a=1;a<=angka;a++){ sum+=a; } System.out.println(sum); } }
Main.java:4: error: class MAIN is public, should be declared in a file named MAIN.java public class MAIN { ^ 1 error
s897903598
p04029
Java
import java.util.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int a = sc.nextInt(); System.out.println( a(a+1)/2 ); } }
Main.java:6: error: cannot find symbol System.out.println( a(a+1)/2 ); ^ symbol: method a(int) location: class Main 1 error
s434664617
p04029
C++
#include <iostream> #include <vector> #include <algorithm> #include <string> #include <map> using namespace std; int main() { int N; cin >> N; cout << (N + 1) * N / 2; << endl; return 0; }
a.cc: In function 'int main()': a.cc:12:34: error: expected primary-expression before '<<' token 12 | cout << (N + 1) * N / 2; << endl; | ^~
s358367247
p04029
Java
public class ABC043A { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(), sum = 0; for (int i = 0; i < N; i++) { sum += i; } System.out.println(sum); sc.close(); } }
Main.java:1: error: class ABC043A is public, should be declared in a file named ABC043A.java public class ABC043A { ^ Main.java:4: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class ABC043A Main.java:4: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class ABC043A 3 errors
s721658326
p04029
C++
#include<iostream> int main(){ int n; std::cin>>n; std::cout<<n*(n+1)/2<<endl;}
a.cc: In function 'int main()': a.cc:5:23: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 5 | std::cout<<n*(n+1)/2<<endl;} | ^~~~ | std::endl In file included from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s159073561
p04029
C++
#include <bits/stdc++.h> using namespace std; int main(){ cin>>N; cout<<N*(N+1)/2<<endl; }
a.cc: In function 'int main()': a.cc:4:8: error: 'N' was not declared in this scope 4 | cin>>N; | ^
s726780855
p04029
C++
#include <bits/stdc++.h> using namespace std; int main(void) { int N; cin >> N; cout << N(N+1)/2 << endl; return 0; }
a.cc: In function 'int main()': a.cc:7:12: error: 'N' cannot be used as a function 7 | cout << N(N+1)/2 << endl; | ~^~~~~
s849988245
p04029
C
#include<stdio.h> int main(){ int i=0; int j=0; int sum=0; scanf("%d",&i); for(j=1;j<i+1;j++){ sum = sum+1; } printf("%d",sum); return 0;
main.c: In function 'main': main.c:11:9: error: expected declaration or statement at end of input 11 | return 0; | ^~~~~~
s492263603
p04029
C
include<stdio.h> int main(){ int i=0; int j=0; int sum=0; scanf("%d",&i); for(j=1;j<i+1;j++){ sum = sum+1; } printf("%d",sum); return 0;
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | include<stdio.h> | ^
s728728433
p04029
C++
#include <bits/std++.h> using namespace std; int main(){ int x; cin >> x; cout << (x*(x+1))/2; return 0; }
a.cc:1:10: fatal error: bits/std++.h: No such file or directory 1 | #include <bits/std++.h> | ^~~~~~~~~~~~~~ compilation terminated.
s398362870
p04029
C++
#include <bits/stdc++.h> using namespace std; int main(){ int x; cin >> x; cout >> (x*(x+1))/2; return 0; }
a.cc: In function 'int main()': a.cc:7:14: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int') 7 | cout >> (x*(x+1))/2; | ~~~~ ^~ ~~~~~~~~~~~ | | | | | int | std::ostream {aka std::basic_ostream<char>} a.cc:7:14: note: candidate: 'operator>>(int, int)' (built-in) 7 | cout >> (x*(x+1))/2; | ~~~~~^~~~~~~~~~~~~~ a.cc:7:14: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int' In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41, from a.cc:1: /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:7:9: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 7 | cout >> (x*(x+1))/2; | ^~~~ In file included from /usr/include/c++/14/string:55, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /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:7:27: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 7 | cout >> (x*(x+1))/2; | ^ /usr/include/c++/14/bitset:1597:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, bitset<_Nb>&)' 1597 | operator>>(std::basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x) | ^~~~~~~~ /usr/include/c++/14/bitset:1597:5: note: template argument deduction/substitution failed: a.cc:7:27: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 7 | cout >> (x*(x+1))/2; | ^ In file included from /usr/include/c++/14/istream:1109, from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/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:7:27: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 7 | cout >> (x*(x+1))/2; | ^ /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:7:27: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 7 | cout >> (x*(x+1))/2; | ^ /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:7:27: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 7 | cout >> (x*(x+1))/2; | ^ /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:7:27: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 7 | cout >> (x*(x+1))/2; | ^ /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:7:27: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 7 | cout >> (x*(x+1))/2; | ^ /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:7:27: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 7 | cout >> (x*(x+1))/2; | ^ /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 = int]': a.cc:7:22: required from here 7 | cout >> (x*(x+1))/2; | ^ /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) | ^~~~~~~~ /usr/include/c++/14/complex:509:5: note: candidate: 'template<class _Tp, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, complex<_Tp>&)' 509 | operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x) | ^~~~~~~~ /usr/include/c++/14/complex:509:5: note: template argument deduction/substitution failed: a.cc:7:27: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 7 | cout >> (x*(x+1))/2; | ^ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:143: /usr/include/c++/14/iomanip:76:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Resetiosflags)' 76 | operator>>(basic_istream<_CharT, _Traits>& __is, _Resetiosflags __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:76:5: note: template argument deduction/substitution failed: a.cc:7:27: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 7 | cout >> (x*(x+1))/2; | ^ /usr/include/c++/14/iomanip:106:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setiosflags)' 106 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setiosflags __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:106:5: note: template argument deduction/substitution failed: a.cc:7:27: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 7 | cout >> (x*(x+1))/2; | ^ /usr/include/c++/14/iomanip:137:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setbase)' 137 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setbase __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:137:5: note: template argument deduction/substitution failed: a.cc:7:27: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 7 | cout >> (x*(x+1))/2; | ^ /usr/include/c++/14/iomanip:177:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setfill<_CharT>)' 177 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setfill<_CharT> __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:177:5: note: template argument deduction/substitution failed: a.cc:7:27: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 7 | cout >> (x*(x+1))/2; | ^ /usr/include/c++/14/iomanip:207:5: note: candidate: 'template<class _CharT, class _Traits>
s144413034
p04029
C++
#include <bits/std++.h> using namespace std; int main(){ int x; cin >> x; cout >> (x*(x+1))/2; return 0; }
a.cc:1:10: fatal error: bits/std++.h: No such file or directory 1 | #include <bits/std++.h> | ^~~~~~~~~~~~~~ compilation terminated.
s156047419
p04029
C++
#include "bits/stdc++.h" using namespace std; int main() { int i = 0 ; int N; cin >> N; int a; for (i = 0 ; i < N; i++){ a += N; } } cout<<a;
a.cc:13:3: error: 'cout' does not name a type 13 | cout<<a; | ^~~~
s181343086
p04029
C++
#include "bits/stdc++.h" using namespace std; int main() { int i = 0 ; int N; cin >> N; int a; for (i = 0 ; i < N; i++;){ a += N; } } cout<<a;
a.cc: In function 'int main()': a.cc:9:26: error: expected ')' before ';' token 9 | for (i = 0 ; i < N; i++;){ | ~ ^ | ) a.cc:9:27: error: expected primary-expression before ')' token 9 | for (i = 0 ; i < N; i++;){ | ^ a.cc: At global scope: a.cc:13:3: error: 'cout' does not name a type 13 | cout<<a; | ^~~~
s851837033
p04029
C++
#include "bits/stdc++.h" using namespace std; int main() { int i = 0 ; cin >> N; int a; for (i = 0 ; i < N; i++;){ a += N; } } cout<<a;
a.cc: In function 'int main()': a.cc:6:10: error: 'N' was not declared in this scope 6 | cin >> N; | ^ a.cc:8:26: error: expected ')' before ';' token 8 | for (i = 0 ; i < N; i++;){ | ~ ^ | ) a.cc:8:27: error: expected primary-expression before ')' token 8 | for (i = 0 ; i < N; i++;){ | ^ a.cc: At global scope: a.cc:12:3: error: 'cout' does not name a type 12 | cout<<a; | ^~~~
s918377837
p04029
C++
// ======================================================================================================== // Library // ======================================================================================================== #define _CRT_SECURE_NO_WARNINGS #include <bits/stdc++.h> using namespace std; // competitive macro #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define RFOR(i, a, b) for (int i = (b) - 1; i >= (a); i--) #define REP(i, n) for (int i = 0; i < (n); i++) #define RREP(i ,n) for (int i = (n) - 1; i >= 0; i--) #define LL long long #define ULL unsigned long long void fastIOS() { cin.tie(0); ios::sync_with_stdio(false); } // ======================================================================================================== // ======================================================================================================== int main() { fastIOS(); int n; cin >> n; cout << (n(n+1))/2; return 0; }
a.cc: In function 'int main()': a.cc:31:15: error: 'n' cannot be used as a function 31 | cout << (n(n+1))/2; | ~^~~~~
s733441401
p04029
C
#include <stdio.h> int main(void){ int a,b; scanf("%d",&a); for(i=0;i<a;i++){ b+=i; } }
main.c: In function 'main': main.c:5:7: error: 'i' undeclared (first use in this function) 5 | for(i=0;i<a;i++){ | ^ main.c:5:7: note: each undeclared identifier is reported only once for each function it appears in
s774703629
p04029
Java
import java.util.*; class Main{ public static void main(String[] args){ Scanner scan = new Scanner(System.in); String str = scan.next(); List<String> list = new ArrayList<>(); int j = 0; for(int i = 0; i < str.length(); i++){ if(!(str.charAt(i) == 'B')){ Syring input = String.valueOf(str.charAt(i)); list.add(input); j = j + 1; }else if (!(j == 0)){ list.remove(j - 1); } } for(int k = 0; k<j; k++){ char out = list.get(k); System.out.print(out); } } }
Main.java:11: error: cannot find symbol Syring input = String.valueOf(str.charAt(i)); ^ symbol: class Syring location: class Main Main.java:20: error: incompatible types: String cannot be converted to char char out = list.get(k); ^ 2 errors
s640789471
p04029
Java
import java.util.*; class Main{ public static void main(String[] args){ Scanner scan = new Scanner(System.in); String str = scan.next(); List<char> list = new ArrayList<>(); int j = 0; for(int i = 0; i < str.length(); i++){ if(!(str.charAt(i) == 'B')){ list.add(str.charAt(i)); j = j + 1; }else if (!(j == 0)){ list.remove(j - 1); } } for(int k = 0; k<j; k++){ char out = list.get(k); System.out.print(out); } } }
Main.java:7: error: unexpected type List<char> list = new ArrayList<>(); ^ required: reference found: char 1 error
s882007942
p04029
Java
import java.util.*; class Main{ public static void main(String[] args){ Scanner scan = new Scanner(System.in); String str = scan.next(); ArrayList< character > list = new ArrayList<>(); int j = 0; for(int i = 0; i < str.length(); i++){ if(!(str.charAt(i) == 'B')){ list.add(str.charAt(i)); j = j + 1; }else if (!(j == 0)){ list.remove(j - 1); } } for(int k = 0; k<j; i++){ char out = list.get(k); System.out.print(out); } } }
Main.java:7: error: cannot find symbol ArrayList< character > list = new ArrayList<>(); ^ symbol: class character location: class Main Main.java:18: error: cannot find symbol for(int k = 0; k<j; i++){ ^ symbol: variable i location: class Main 2 errors
s681275889
p04029
Java
import java.util.*; class Main{ public static void main(String[] args){ Scanner scan = new Scanner(System.in); String str = scan.next(); ArrayList<char> list = new ArrayList<>(); int j = 0; for(int i = 0; i < str.length(); i++){ if(!(str.charAt(i) == 'B')){ list.add(str.charAt(i)); j = j + 1; }else if (!(j == 0)){ list.remove(j - 1); } } } }
Main.java:7: error: unexpected type ArrayList<char> list = new ArrayList<>(); ^ required: reference found: char 1 error
s186303255
p04029
Java
import java.util.*; class Main{ public static void main(String[] args){ Scanner scan = new Scanner(System.in); String str = scan.next(); ArrayList<String> list = new ArrayList<>(); int j = 0; for(int i = 0; i < str.length(); i++){ if(!(str.charAt(i) == B)){ list.add(str.charAt(i)); j = j + 1; }else if (!(j == 0)){ list.remove(j - 1); } } } }
Main.java:10: error: cannot find symbol if(!(str.charAt(i) == B)){ ^ symbol: variable B location: class Main Main.java:11: error: incompatible types: char cannot be converted to String list.add(str.charAt(i)); ^ Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output 2 errors
s888869467
p04029
Java
import java.util.* class Main{ public static void main(String[] args){ Scanner scan = new Scanner(System.in); String str = scan.next(); int N = Integer.parseInt(str); int ans = (1 + N)*N/2; System.out.println(ans); } }
Main.java:1: error: ';' expected import java.util.* ^ 1 error
s386188021
p04029
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N;cin>>N; cout<<N(N+1)/2<<endl; }
a.cc: In function 'int main()': a.cc:6:10: error: 'N' cannot be used as a function 6 | cout<<N(N+1)/2<<endl; | ~^~~~~
s479671041
p04029
C++
#include <iostream> #include <iomanip> #include <vector> #include <utility> #include <map> #include <algorithm> #include <queue> #include <cmath> #include <numeric> using namespace std; struct aaa{aaa(){cin.tie(nullptr); ios::sync_with_stdio(false); cout<<fixed<<setprecision(20);};}aaa; template <class T>ostream &operator<<(ostream &o,const vector<T>&v){o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;} #define debug(v) {cout<<"\033[1;36m[debug]\033[m "<<#v<<" : "<<v<<endl;} typedef long long int64; int main() { int n; cin >> n; cout << n*(n+1)/2 << endl;1 }
a.cc: In function 'int main()': a.cc:22:32: error: expected ';' before '}' token 22 | cout << n*(n+1)/2 << endl;1 | ^ | ; 23 | 24 | } | ~
s543847907
p04029
C++
#include<iostream> using namepsace std; int main(){ int n; cin>>n; cout<<(n*(n+1))/2; }
a.cc:2:7: error: expected nested-name-specifier before 'namepsace' 2 | using namepsace std; | ^~~~~~~~~ a.cc: In function 'int main()': a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 6 | cin>>n; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:7:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 7 | cout<<(n*(n+1))/2; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~
s776200002
p04029
C++
#include <iostream> int main(){ int n; int sum; sum = n * (n + 1) / 2; cout << sum << endl; return 0; }
a.cc: In function 'int main()': a.cc:7:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 7 | cout << sum << endl; | ^~~~ | std::cout In file included from a.cc:1: /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:7:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 7 | cout << sum << 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) | ^~~~
s568377451
p04029
C++
#include <iostream> int main(){ int n; int sum; sum = n * (n + 1) / 2; cout << sum << endl; }
a.cc: In function 'int main()': a.cc:7:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 7 | cout << sum << endl; | ^~~~ | std::cout In file included from a.cc:1: /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:7:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 7 | cout << sum << 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) | ^~~~
s733758615
p04029
C++
#inlclude<bits/stdc++.h> using namespace std; int main(){ int n;cin>>n; int sum = 0; for(int i=1; i<=n; i++) sum+=i; cout<<sum<<endl; }
a.cc:1:2: error: invalid preprocessing directive #inlclude; did you mean #include? 1 | #inlclude<bits/stdc++.h> | ^~~~~~~~ | include a.cc: In function 'int main()': a.cc:4:15: error: 'cin' was not declared in this scope 4 | int n;cin>>n; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | #inlclude<bits/stdc++.h> a.cc:7:9: error: 'cout' was not declared in this scope 7 | cout<<sum<<endl; | ^~~~ a.cc:7:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:7:20: error: 'endl' was not declared in this scope 7 | cout<<sum<<endl; | ^~~~ a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' +++ |+#include <ostream> 1 | #inlclude<bits/stdc++.h>
s298793877
p04029
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; int a=0; for(int i=1;i<=n;i++){ a=a+i } cout <<a; }
a.cc: In function 'int main()': a.cc:8:10: error: expected ';' before '}' token 8 | a=a+i | ^ | ; 9 | } | ~
s207631939
p04029
C++
#include <iostream> #include <string> using namespace std; main(){ string s; string a; std::cin >> s; a = 0.5*s(1 + s); cout << a << endl; }
a.cc:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 6 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:15:21: error: no match for 'operator+' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 15 | a = 0.5*s(1 + s); | ~ ^ ~ | | | | int std::string {aka std::__cxx11::basic_string<char>} In file included from /usr/include/c++/14/string:48, 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_iterator.h:627:5: note: candidate: 'template<class _Iterator> constexpr std::reverse_iterator<_Iterator> std::operator+(typename reverse_iterator<_Iterator>::difference_type, const reverse_iterator<_Iterator>&)' 627 | operator+(typename reverse_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:627:5: note: template argument deduction/substitution failed: a.cc:15:23: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 15 | a = 0.5*s(1 + s); | ^ /usr/include/c++/14/bits/stl_iterator.h:1798:5: note: candidate: 'template<class _Iterator> constexpr std::move_iterator<_IteratorL> std::operator+(typename move_iterator<_IteratorL>::difference_type, const move_iterator<_IteratorL>&)' 1798 | operator+(typename move_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1798:5: note: template argument deduction/substitution failed: a.cc:15:23: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 15 | a = 0.5*s(1 + s); | ^ In file included from /usr/include/c++/14/string:54: /usr/include/c++/14/bits/basic_string.h:3598:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3598 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3598:5: note: template argument deduction/substitution failed: a.cc:15:23: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 15 | a = 0.5*s(1 + s); | ^ /usr/include/c++/14/bits/basic_string.h:3616:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3616 | operator+(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3616:5: note: template argument deduction/substitution failed: a.cc:15:23: note: mismatched types 'const _CharT*' and 'int' 15 | a = 0.5*s(1 + s); | ^ /usr/include/c++/14/bits/basic_string.h:3635:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3635 | operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3635:5: note: template argument deduction/substitution failed: a.cc:15:23: note: deduced conflicting types for parameter '_CharT' ('int' and 'char') 15 | a = 0.5*s(1 + s); | ^ /usr/include/c++/14/bits/basic_string.h:3652:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3652 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3652:5: note: template argument deduction/substitution failed: a.cc:15:23: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 15 | a = 0.5*s(1 + s); | ^ /usr/include/c++/14/bits/basic_string.h:3670:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)' 3670 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3670:5: note: template argument deduction/substitution failed: a.cc:15:23: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 15 | a = 0.5*s(1 + s); | ^ /usr/include/c++/14/bits/basic_string.h:3682:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3682 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3682:5: note: template argument deduction/substitution failed: a.cc:15:23: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 15 | a = 0.5*s(1 + s); | ^ /usr/include/c++/14/bits/basic_string.h:3689:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3689 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3689:5: note: template argument deduction/substitution failed: a.cc:15:23: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 15 | a = 0.5*s(1 + s); | ^ /usr/include/c++/14/bits/basic_string.h:3696:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3696 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3696:5: note: template argument deduction/substitution failed: a.cc:15:23: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 15 | a = 0.5*s(1 + s); | ^ /usr/include/c++/14/bits/basic_string.h:3719:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3719 | operator+(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3719:5: note: template argument deduction/substitution failed: a.cc:15:23: note: mismatched types 'const _CharT*' and 'int' 15 | a = 0.5*s(1 + s); | ^ /usr/include/c++/14/bits/basic_string.h:3726:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3726 | operator+(_CharT __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3726:5: note: template argument deduction/substitution failed: a.cc:15:23: note: deduced conflicting types for parameter '_CharT' ('int' and 'char') 15 | a = 0.5*s(1 + s); | ^ /usr/include/c++/14/bits/basic_string.h:3733:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const _CharT*)' 3733 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3733:5: note: template argument deduction/substitution failed: a.cc:15:23: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 15 | a = 0.5*s(1 + s); | ^ /usr/include/c++/14/bits/basic_string.h:3740:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, _CharT)' 3740 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3740:5: note: template argument deduction/substitution failed: a.cc:15:23: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 15 | a = 0.5*s(1 + s); | ^
s539900383
p04029
C
#include <stdio.h> int main(void){ int sum=0,max; scanf("%d",&max); for(counter=1;counter<=max;counter++){ sum+=counter; } printf("%d",&sum); return 0; }
main.c: In function 'main': main.c:5:9: error: 'counter' undeclared (first use in this function) 5 | for(counter=1;counter<=max;counter++){ | ^~~~~~~ main.c:5:9: note: each undeclared identifier is reported only once for each function it appears in
s928109771
p04029
Java
package ProblemSolve; import java.util.Scanner; public class Problem1 { public static void main(String[] args) { int n, sum = 0; Scanner input = new Scanner(System.in); n = input.nextInt(); if (n >= 1 && n <= 100) { for (int i = 1; i <= n; i++) { sum = sum + i; } System.out.println(sum); } } }
Main.java:6: error: class Problem1 is public, should be declared in a file named Problem1.java public class Problem1 { ^ 1 error
s829028559
p04029
Java
import java.util.Scanner; { public class Problem1.java { public static void main(String[] args) { int n, sum = 0; Scanner input = new Scanner(System.in); n = input.nextInt(); if (n >= 1 && n <= 100) { for (int i = 1; i <= n; i++) { sum = sum + i; } System.out.println(sum); } } } }
Main.java:3: error: class, interface, enum, or record expected { ^ Main.java:5: error: '{' expected public class Problem1.java { ^ Main.java:28: error: class, interface, enum, or record expected } ^ 3 errors
s366622417
p04029
Java
import java.util.Scanner; public class Problem1.java { public static void main(String[] args) { int n, sum = 0; Scanner input = new Scanner(System.in); n = input.nextInt(); if (n >= 1 && n <= 100) { for (int i = 1; i <= n; i++) { sum = sum + i; } System.out.println(sum); } } }
Main.java:3: error: '{' expected public class Problem1.java { ^ 1 error
s651055226
p04029
Java
import java.util.Scanner; public class Problem1 { public static void main(String[] args) { int n, sum = 0; Scanner input = new Scanner(System.in); n = input.nextInt(); if (n >= 1 && n <= 100) { for (int i = 1; i <= n; i++) { sum = sum + i; } System.out.println(sum); } } }
Main.java:3: error: class Problem1 is public, should be declared in a file named Problem1.java public class Problem1 { ^ 1 error
s641844722
p04029
Java
import java.util.Scanner; public class Problem1 { public static void main(String[] args) { int n, sum = 0; Scanner input = new Scanner(System.in); n = input.nextInt(); if (n >= 1 && n <= 100) { for (int i = 1; i <= n; i++) { sum = sum + i; } System.out.println(sum); } } }
Main.java:3: error: class Problem1 is public, should be declared in a file named Problem1.java public class Problem1 { ^ 1 error
s450048817
p04029
Java
import java.util.Scanner; public class Main { public static void main(String args[]) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); ans=(n*(n+1))/2; System.out.println(ans); sc.close(); } }
Main.java:8: error: cannot find symbol ans=(n*(n+1))/2; ^ symbol: variable ans location: class Main Main.java:9: error: cannot find symbol System.out.println(ans); ^ symbol: variable ans location: class Main 2 errors
s817425024
p04029
Java
import java.util.Scanner public class Main { public static void main(String args[]) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); ans=(n*(n+1))/2; System.out.println(ans); } }
Main.java:1: error: ';' expected import java.util.Scanner ^ 1 error
s849175801
p04029
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; cout << N*(N+1)/2 << endl; ]
a.cc: In function 'int main()': a.cc:8:3: error: expected primary-expression before ']' token 8 | ] | ^ a.cc:8:4: error: expected '}' at end of input 8 | ] | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s292610826
p04029
C
#include<stdio.h> int main(void){ int i,n,sum; scanf("%d",&n); for(i = 1,i <= n,i++) sum += i; printf(sum); return 0; }
main.c: In function 'main': main.c:5:23: error: expected ';' before ')' token 5 | for(i = 1,i <= n,i++) sum += i; | ^ | ; main.c:5:23: error: expected expression before ')' token main.c:6:10: error: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion] 6 | printf(sum); | ^~~ | | | int In file included from main.c:1: /usr/include/stdio.h:363:43: note: expected 'const char * restrict' but argument is of type 'int' 363 | extern int printf (const char *__restrict __format, ...); | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
s832185743
p04029
C
#include<stdio.h> int main(void){ int i,n,sum; for(i = 1,i <= n,i++) sum += i; printf(sum); return 0; }
main.c: In function 'main': main.c:4:23: error: expected ';' before ')' token 4 | for(i = 1,i <= n,i++) sum += i; | ^ | ; main.c:4:23: error: expected expression before ')' token main.c:5:10: error: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion] 5 | printf(sum); | ^~~ | | | int In file included from main.c:1: /usr/include/stdio.h:363:43: note: expected 'const char * restrict' but argument is of type 'int' 363 | extern int printf (const char *__restrict __format, ...); | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
s317848646
p04029
C
#include〈stdio.h〉 int main() { int n; int i=0; scanf("%d", &n); i = n * (n + 1) / 2; printf("%d",i ); return 0; }
main.c:1:9: error: #include expects "FILENAME" or <FILENAME> 1 | #include〈stdio.h〉 | ^~ main.c: In function 'main': main.c:6:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 6 | scanf("%d", &n); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | #include〈stdio.h〉 main.c:6:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 6 | scanf("%d", &n); | ^~~~~ main.c:6:9: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:10:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 10 | printf("%d",i ); | ^~~~~~ main.c:10:9: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:10:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:10:9: note: include '<stdio.h>' or provide a declaration of 'printf'
s446224516
p04029
C++
#include <iostream> #include <vector> #include <iostream> #include <cstdio> #include <map> #include <unordered_map> #include <set> #include <unordered_set> #include <algorithm> #include <cmath> #include <queue> #include <deque> #include <stack> #define ll long long #define pb push_back #define vi vector<int> #define sz(a) (int((a).size())) #define mp make_pair #define f first #define s second #define pii pair<int, int> using namespace std; const int mod = 998244353; const int inf = (int)2e9; const ll INF = (ll)2e18; const int N = 100100; int main() { ios_base::sync_with_stdio(0), cin.tie(0); cin >> n; cout << n * (n + 1) / 2; return 0; }
a.cc: In function 'int main()': a.cc:33:16: error: 'n' was not declared in this scope 33 | cin >> n; | ^
s009821614
p04029
C++
using namespace std; int main(){ int n, ans=0; cin >> n; for(int i = 1; i <= n; i++){ ans+=i; } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:5:3: error: 'cin' was not declared in this scope 5 | cin >> n; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | a.cc:9:3: error: 'cout' was not declared in this scope 9 | cout << ans << endl; | ^~~~ a.cc:9:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:9:18: error: 'endl' was not declared in this scope 9 | cout << ans << endl; | ^~~~ a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' +++ |+#include <ostream> 1 |
s944281962
p04029
C++
#include <bits.\h++> int main(){ int n, ans=0; cin >> n; for(int i = 1; i <= n; i++){ ans+=i; } cout << ans << endl; }
a.cc:1:10: fatal error: bits.\h++: No such file or directory 1 | #include <bits.\h++> | ^~~~~~~~~~~ compilation terminated.
s259614575
p04029
C++
#include<bits/stdc++.h> using namesapce std; int main() { int n; cin>>n; cout<<n*(n-1)/2<<"\n"; return 0; }
a.cc:2:7: error: expected nested-name-specifier before 'namesapce' 2 | using namesapce std; | ^~~~~~~~~ a.cc: In function 'int main()': a.cc:7:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 7 | cin>>n; | ^~~ | std::cin In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146, from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:8:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 8 | cout<<n*(n-1)/2<<"\n"; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~
s108078365
p04029
Java
package abc043; import java.util.Scanner; public class Abc043 { public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ //スキャナ宣言 Scanner sc = new Scanner(System.in); //子供の人数Nを入力 int N = sc.nextInt(); //N人の子供に対して合計何個のキャンディーがいるかを算出する。 int candySum = 0; for (int i = 1; i <= N; i++) { candySum = candySum + i; } //結果の出力 System.out.println(candySum); } }
Main.java:5: error: class Abc043 is public, should be declared in a file named Abc043.java public class Abc043 { ^ 1 error
s783846771
p04029
C++
#include<iostream> using namespace std; int main(){ int n,i,a; cin>>n; for(i=1,i<=n,i++){ a += i; } cout<<a; return 0; }
a.cc: In function 'int main()': a.cc:9:19: error: expected ';' before ')' token 9 | for(i=1,i<=n,i++){ | ^ | ; a.cc:15:3: error: expected primary-expression before 'return' 15 | return 0; | ^~~~~~ a.cc:13:11: error: expected ')' before 'return' 13 | cout<<a; | ^ | ) 14 | 15 | return 0; | ~~~~~~ a.cc:9:6: note: to match this '(' 9 | for(i=1,i<=n,i++){ | ^