submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s292623747
p04029
C++
#include <stdio.h>int main() { int N; scanf("%d", &N); printf("%d\n", N*(N+1)/2); return 0;}
a.cc:1:23: warning: extra tokens at end of #include directive 1 | #include <stdio.h>int main() { int N; scanf("%d", &N); printf("%d\n", N*(N+1)/2); return 0;} | ^~~~ a.cc:1:10: fatal error: stdio.h>in: No such file or directory 1 | #include <stdio.h>int main() { int N; scanf("%d", &N); printf("%d\n", N*(N+1)/2); return 0;} | ^~~~~~~~~~~~ compilation terminated.
s443250142
p04029
C
#include <stdio.h> int main(){ int A, B; char str[20]; bool valid = true; scanf("%d %d", &A, &B); scanf("%s", str); if(str[A] != '-'){ valid = false; } for(int i = 0; str[i] != '\0'; i++){ if(i != A){ if(str[i] < '0' || str [i] > '9'){ valid = false; break; } } } (valid) ? puts("Yes") : puts("No"); return 0; }
main.c: In function 'main': main.c:6:9: error: unknown type name 'bool' 6 | bool valid = true; | ^~~~ main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>' 1 | #include <stdio.h> +++ |+#include <stdbool.h> 2 | main.c:6:22: error: 'true' undeclared (first use in this function) 6 | bool valid = true; | ^~~~ main.c:6:22: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>' main.c:6:22: note: each undeclared identifier is reported only once for each function it appears in main.c:11:25: error: 'false' undeclared (first use in this function) 11 | valid = false; | ^~~~~ main.c:11:25: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
s651536449
p04029
C
i = 1 i<3 #include <stdio.h> int main(){ int N; int ans = 0; scanf("%d", &N); for (int i = 1; i <= N; i++ ){ ans+=i; } printf("%d", ans); return 0; }
main.c:1:1: warning: data definition has no type or storage class 1 | i = 1 | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int] main.c:2:1: error: expected ',' or ';' before 'i' 2 | i<3 | ^ In file included from /usr/include/stdio.h:47, from main.c:3: /usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:28:43: error: unknown type name 'size_t' 28 | size_t __nbytes); | ^~~~~~ /usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:1:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' +++ |+#include <stddef.h> 1 | /* Copyright (C) 1991-2025 Free Software Foundation, Inc. /usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:37:44: error: unknown type name 'size_t' 37 | size_t __nbytes); | ^~~~~~ /usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:37:44: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:57:3: error: unknown type name 'cookie_read_function_t'; did you mean 'cookie_seek_function_t'? 57 | cookie_read_function_t *read; /* Read bytes. */ | ^~~~~~~~~~~~~~~~~~~~~~ | cookie_seek_function_t /usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:58:3: error: unknown type name 'cookie_write_function_t'; did you mean 'cookie_close_function_t'? 58 | cookie_write_function_t *write; /* Write bytes. */ | ^~~~~~~~~~~~~~~~~~~~~~~ | cookie_close_function_t /usr/include/stdio.h:314:35: error: unknown type name 'size_t' 314 | extern FILE *fmemopen (void *__s, size_t __len, const char *__modes) | ^~~~~~ /usr/include/stdio.h:130:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' 129 | #include <bits/stdio_lim.h> +++ |+#include <stddef.h> 130 | /usr/include/stdio.h:320:47: error: unknown type name 'size_t' 320 | extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __THROW | ^~~~~~ /usr/include/stdio.h:320:47: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:340:34: error: unknown type name 'size_t' 340 | int __modes, size_t __n) __THROW __nonnull ((1)); | ^~~~~~ /usr/include/stdio.h:340:34: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:346:24: error: unknown type name 'size_t' 346 | size_t __size) __THROW __nonnull ((1)); | ^~~~~~ /usr/include/stdio.h:346:24: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:385:44: error: unknown type name 'size_t' 385 | extern int snprintf (char *__restrict __s, size_t __maxlen, | ^~~~~~ /usr/include/stdio.h:385:44: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:389:45: error: unknown type name 'size_t' 389 | extern int vsnprintf (char *__restrict __s, size_t __maxlen, | ^~~~~~ /usr/include/stdio.h:389:45: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:690:30: error: unknown type name 'size_t' 690 | size_t *__restrict __n, int __delimiter, | ^~~~~~ /usr/include/stdio.h:690:30: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:693:28: error: unknown type name 'size_t' 693 | size_t *__restrict __n, int __delimiter, | ^~~~~~ /usr/include/stdio.h:693:28: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:698:27: error: unknown type name 'size_t' 698 | size_t *__restrict __n, | ^~~~~~ /usr/include/stdio.h:698:27: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:728:8: error: unknown type name 'size_t' 728 | extern size_t fread (void *__restrict __ptr, size_t __size, | ^~~~~~ /usr/include/stdio.h:728:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:728:46: error: unknown type name 'size_t' 728 | extern size_t fread (void *__restrict __ptr, size_t __size, | ^~~~~~ /usr/include/stdio.h:728:46: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:729:22: error: unknown type name 'size_t' 729 | size_t __n, FILE *__restrict __stream) __wur | ^~~~~~ /usr/include/stdio.h:729:22: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:735:8: error: unknown type name 'size_t' 735 | extern size_t fwrite (const void *__restrict __ptr, size_t __size, | ^~~~~~ /usr/include/stdio.h:735:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:735:53: error: unknown type name 'size_t' 735 | extern size_t fwrite (const void *__restrict __ptr, size_t __size, | ^~~~~~ /usr/include/stdio.h:735:53: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:736:23: error: unknown type name 'size_t' 736 | size_t __n, FILE *__restrict __s) __nonnull((4)); | ^~~~~~ /usr/include/stdio.h:736:23: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:756:8: error: unknown type name 'size_t' 756 | extern size_t fread_unlocked (void *__restrict __ptr, size_t __size, | ^~~~~~ /usr/include/stdio.h:756:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:756:55: error: unknown type name 'size_t' 756 | extern size_t fread_unlocked (void *__restrict __ptr, size_t __size, | ^~~~~~ /usr/include/stdio.h:756:55: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:757:31: error: unknown type name 'size_t' 757 | size_t __n, FILE *__restrict __stream) __wur | ^~~~~~ /usr/include/stdio.h:757:31: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:759:8: error: unknown type name 'size_t' 759 | extern size_t fwrite_unlocked (const void *__restrict __ptr, size_t __size, | ^~~~~~ /usr/include/stdio.h:759:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:759:62: error: unknown type name 'size_t' 759 | extern size_t fwrite_unlocked (const void *__restrict __ptr, size_t __size, | ^~~~~~ /usr/include/stdio.h:759:62: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:760:32: error: unknown type name 'size_t' 760 | size_t __n, FILE *__restrict __stream) | ^~~~~~ /usr/include/stdio.h:760:32: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
s089052986
p04029
C++
include <stdio.h> int main() { int a, sum = 0; scanf("%d", &a); float var = 2; int sn = a / var * (2 * 1 + (a - 1) * 1); printf("%d\n", sn); return 0; }
a.cc:1:1: error: 'include' does not name a type 1 | include <stdio.h> | ^~~~~~~
s359001318
p04029
C
#include<stdio.h> int main() { int a,sum = 0; scanf("%d",&a); // 3 int sn = a / double(2)* (2 * 1 + (a-1) * 1); printf("%d",sn); return 0; }
main.c: In function 'main': main.c:6:22: error: expected expression before 'double' 6 | int sn = a / double(2)* (2 * 1 + (a-1) * 1); | ^~~~~~
s842214960
p04029
C++
#include <stdio.h> int main(){ int un; scanf("%d",&un); int res=0; for(int i=1;i<=n;i++){ res+=i } printf("%d",res); return 0; }
a.cc: In function 'int main()': a.cc:6:16: error: 'n' was not declared in this scope 6 | for(int i=1;i<=n;i++){ | ^ a.cc:7:15: error: expected ';' before '}' token 7 | res+=i | ^ | ; 8 | } | ~
s692089731
p04029
C++
else if(a==5&&b==5&&c==7) cout << YES;
a.cc:1:1: error: expected unqualified-id before 'else' 1 | else if(a==5&&b==5&&c==7) cout << YES; | ^~~~
s935731411
p04029
C++
#include <iostream> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); int n; cin >> n; cout << n(n+1)/2; return 0; }
a.cc: In function 'int main()': a.cc:10:14: error: 'n' cannot be used as a function 10 | cout << n(n+1)/2; | ~^~~~~
s273398776
p04029
C++
#include<iostream> using namespace std; int main(){ int N, i, n=0; cin >> N; for (i1; i<N; i++){ n += i + 1; } cout << n << endl; return 0; }
a.cc: In function 'int main()': a.cc:7:10: error: 'i1' was not declared in this scope; did you mean 'i'? 7 | for (i1; i<N; i++){ | ^~ | i
s338871392
p04029
Java
import.java.util.Scanner; public class Main{ public static void main (String [] args) { Scanner input = new Scanner (System.in); int student; System.out.println("Enter the number of Students"); int sum =0; for (int i = 0; i<=students; i++) { sum +=i; System.out.println("The number of candies needed is " +sum); } } }
Main.java:1: error: <identifier> expected import.java.util.Scanner; ^ 1 error
s014764622
p04029
Java
public class candles { public static void main(String[] args) { import java.util.*; public class reverse { public static void main(String[] args) { Scanner input = new Scanner(System.in); int n=input.nextInt(),sum=0; for(int i=1;i<=n;i++) { sum=sum+i; } System.out.println("the sum of all candles is " + sum); } } } } }
Main.java:5: error: illegal start of expression import java.util.*; ^ Main.java:5: error: <identifier> expected import java.util.*; ^ Main.java:5: error: illegal start of expression import java.util.*; ^ Main.java:6: error: illegal start of expression public class reverse { ^ Main.java:23: error: class, interface, enum, or record expected } ^ 5 errors
s043897549
p04029
Java
public static void main(String[] args) { Scanner input = new Scanner(System.in); int n=input.nextInt(),sum=0; for(int i=1;i<=n;i++) { sum=sum+i; } System.out.println("the sum of all candles is " + sum); } }
Main.java:2: error: unnamed classes are a preview feature and are disabled by default. public static void main(String[] args) { ^ (use --enable-preview to enable unnamed classes) Main.java:12: error: class, interface, enum, or record expected } ^ 2 errors
s235928942
p04029
Java
import java.util.Scanner; public class B { public static void main(String[] args) { Scanner input = new Scanner(System.in); int n; int sum = 0; n = input.nextInt(); if (n == 1) { System.out.print("1\nOnly one child. The answer is 1 in this case.\n"); } else if (1 < n && n <= 6) { for (int i = 1; i <= n; i++) { sum = sum + i; } System.out.print(sum + "\nThe answer is "); for (int i = 1; i <= n; i++) { System.out.print(i + " + "); } System.out.println(" = " + sum); } else { if (6 < n) { for (int i = 1; i <= n; i++) { sum = sum + i; } System.out.printf("%d\nThe sum of the integers from 1 to %d is %d. \n", sum, n, sum); } } } }
Main.java:4: error: class B is public, should be declared in a file named B.java public class B { ^ 1 error
s183952952
p04029
Java
import java.util.*; public class reverse { public static void main(String[] args) { Scanner input = new Scanner(System.in); int n=input.nextInt(),sum=0; for(int i=1;i<=n;i++) { sum=sum+i; } System.out.println("the sum of all candles is " + sum); } }
Main.java:2: error: class reverse is public, should be declared in a file named reverse.java public class reverse { ^ 1 error
s394586213
p04029
Java
main Scanner input = new Scanner(System.in); int student; System.out.print("Enter the number of students\n"); student = input.next.Int(); int sum = 0; for (int i = 0; i<= student; i++) { sum += i; System.out.println(" the total candies needed is "+sum); }
Main.java:1: error: class, interface, enum, or record expected main ^ Main.java:3: error: unnamed classes are a preview feature and are disabled by default. int student; ^ (use --enable-preview to enable unnamed classes) Main.java:4: error: class, interface, enum, or record expected System.out.print("Enter the number of students\n"); ^ Main.java:5: error: class, interface, enum, or record expected student = input.next.Int(); ^ Main.java:7: error: class, interface, enum, or record expected for (int i = 0; i<= student; i++) ^ Main.java:7: error: class, interface, enum, or record expected for (int i = 0; i<= student; i++) ^ Main.java:7: error: class, interface, enum, or record expected for (int i = 0; i<= student; i++) ^ Main.java:10: error: class, interface, enum, or record expected System.out.println(" the total candies needed is "+sum); ^ Main.java:11: error: class, interface, enum, or record expected } ^ 9 errors
s343405177
p04029
Java
import java.util.Scanner; public class q1 { public static void main(String[] args) { // TODO Auto-generated method stub Scanner input = new Scanner (System.in); int Student; System.out.println(" Enter the number of Students"); Student = input.nextInt(); int sum =0; for (int i=0;i<=Student;i++) sum+= i; System.out.println("the number of candies in total is "+ sum); } }
Main.java:3: error: class q1 is public, should be declared in a file named q1.java public class q1 { ^ 1 error
s062848994
p04029
Java
import java.util.Scanner; public class { public static void main(String[] args) { // TODO Auto-generated method stub Scanner input = new Scanner (System.in); int Student; System.out.println(" Enter the number of Students"); Student = input.nextInt(); int sum =0; for (int i=0;i<=Student;i++) sum+= i; System.out.println("the number of candies in total is "+ sum); } }
Main.java:3: error: <identifier> expected public class { ^ 1 error
s458737423
p04029
Java
import java.util.Scanner; public class q1 { public static void main(String[] args) { Scanner input = new Scanner (System.in); int Student; System.out.println(" Enter the number of Students"); Student = input.nextInt(); int sum =0; for (int i=0;i<=Student;i++) sum+= i; System.out.println("the number of candies in total is "+ sum); } }
Main.java:3: error: class q1 is public, should be declared in a file named q1.java public class q1 { ^ 1 error
s278029514
p04029
Java
main() Scanner input = new Scanner (System.in); int Student; System.out.println(" Enter the number of Students"); Student = input.nextInt(); int sum =0; for (int i=0;i<=Student;i++) sum+= i; System.out.println("the number of candies in total is "+ sum);
Main.java:1: error: class, interface, enum, or record expected main() ^ Main.java:3: error: unnamed classes are a preview feature and are disabled by default. int Student; ^ (use --enable-preview to enable unnamed classes) Main.java:4: error: class, interface, enum, or record expected System.out.println(" Enter the number of Students"); ^ Main.java:5: error: class, interface, enum, or record expected Student = input.nextInt(); ^ Main.java:7: error: class, interface, enum, or record expected for (int i=0;i<=Student;i++) ^ Main.java:7: error: class, interface, enum, or record expected for (int i=0;i<=Student;i++) ^ Main.java:7: error: class, interface, enum, or record expected for (int i=0;i<=Student;i++) ^ Main.java:9: error: class, interface, enum, or record expected System.out.println("the number of candies in total is "+ sum); ^ 8 errors
s285139099
p04029
Java
public class main { public static void main(String[] args) { Scanner input = new Scanner (System.in); int Student; System.out.println(" Enter the number of Students"); Student = input.nextInt(); int sum =0; for (int i=0;i<=Student;i++) sum+= i; System.out.println("the number of candies in total is "+ sum); } }
Main.java:1: error: class main is public, should be declared in a file named main.java public class main { ^ Main.java:4: error: cannot find symbol Scanner input = new Scanner (System.in); ^ symbol: class Scanner location: class main Main.java:4: error: cannot find symbol Scanner input = new Scanner (System.in); ^ symbol: class Scanner location: class main 3 errors
s576483056
p04029
Java
public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int sum = 0; for(int i=1;i<=n;i++) { sum = sum+i; } System.out.println(sum); } }
Main.java:3: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:3: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s414710285
p04029
Java
import java.util.Scanner; public class main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int humanNum = sc.nextInt(); int count = 0; for(int num = 1; num <= humanNum; num++) { count += num; } System.out.println(count); } }
Main.java:3: error: class main is public, should be declared in a file named main.java public class main { ^ 1 error
s552524666
p04029
Java
import java.util.*; public class Main { public static void main(String[] args) throws Exception{ Scanner scn = new Scanner(System.in); int n = scn.nextInt() int ans = 0; for(int i=1; i<=n; ++i){ ans = ans + n; } System.out.println(ans); } }
Main.java:6: error: ';' expected int n = scn.nextInt() ^ 1 error
s682457868
p04029
Java
import java.util.*; public class Main { public static void main(String[] args) throws Exception{ Scanner scn = new Scanner(System.in); int n = scn.nextInt(); int x = 0; int[] a = new int[n+1]; for(int i=1; i<=a.length; ++i){ a[0]=0; a[i] = a[i-1]+i; } System.out.println(a[i]); } }
Main.java:13: error: cannot find symbol System.out.println(a[i]); ^ symbol: variable i location: class Main 1 error
s251369856
p04029
Java
import java.util.Scanner; public class Main{ public static void (String args[]){ Scanner stdIn = new Scanner(System.in); int n = stdIn.nextInt(); System.out.println(n*(n+1)/2); } }
Main.java:4: error: <identifier> expected public static void (String args[]){ ^ 1 error
s715856359
p04029
C++
#include<iostream> #include<string> #include<algorithm> #include<vector> #include<set> #define rep(i, a, n) for(int i = a; i < n; i++) using namespace std; int sum(int x){ if(x == 0) return x; esle return x + sum(x - 1); } int main(){ int a; cin >> a; int x = sum(a); cout << x; }
a.cc: In function 'int sum(int)': a.cc:10:3: error: 'esle' was not declared in this scope 10 | esle return x + sum(x - 1); | ^~~~ a.cc:11:1: warning: control reaches end of non-void function [-Wreturn-type] 11 | } | ^
s257330265
p04029
C++
#include<iostream> #include<string> #include<algorithm> #include<vector> #include<set> #define rep(i, a, n) for(int i = a; i < n; i++) using namespace std; int sum(int x){ if(x == 0) return x; esle return x + sum(x - 1) } int main(){ int a; cin >> a; int x = sum(a); cout << x; }
a.cc: In function 'int sum(int)': a.cc:10:3: error: 'esle' was not declared in this scope 10 | esle return x + sum(x - 1) | ^~~~ a.cc:11:1: warning: control reaches end of non-void function [-Wreturn-type] 11 | } | ^
s843473433
p04029
C++
#include<bits/stdc++.h> using namespace std; int main() { string s; string v; long long i=0; long long l=0; cin>>s; l=s.size(); for(i=0;i<l;i++) { if(s[i]=='0') { v.push_back('0'); l++; } else if(s[i]=='1') { v.push_back('1'); l++; } else if(s[i]=='B') { if(v!='\0') { v.pop_back(); l--; } } } cout<<v; return 0; }
a.cc: In function 'int main()': a.cc:26:11: error: no match for 'operator!=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 26 | if(v!='\0') | ~^~~~~~ | | | | | char | std::string {aka std::__cxx11::basic_string<char>} In file included from /usr/include/c++/14/regex:68, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181, from a.cc:1: /usr/include/c++/14/bits/regex.h:1132:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator!=(const sub_match<_BiIter>&, const sub_match<_BiIter>&)' 1132 | operator!=(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1132:5: note: template argument deduction/substitution failed: a.cc:26:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 26 | if(v!='\0') | ^~~~ /usr/include/c++/14/bits/regex.h:1212: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>&)' 1212 | operator!=(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1212:5: note: template argument deduction/substitution failed: a.cc:26:13: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 26 | if(v!='\0') | ^~~~ /usr/include/c++/14/bits/regex.h:1305: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>&)' 1305 | operator!=(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1305:5: note: template argument deduction/substitution failed: a.cc:26:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 26 | if(v!='\0') | ^~~~ /usr/include/c++/14/bits/regex.h:1379:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator!=(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)' 1379 | operator!=(typename iterator_traits<_Bi_iter>::value_type const* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1379:5: note: template argument deduction/substitution failed: a.cc:26:13: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 26 | if(v!='\0') | ^~~~ /usr/include/c++/14/bits/regex.h:1473:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator!=(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)' 1473 | operator!=(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1473:5: note: template argument deduction/substitution failed: a.cc:26:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 26 | if(v!='\0') | ^~~~ /usr/include/c++/14/bits/regex.h:1547:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator!=(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)' 1547 | operator!=(typename iterator_traits<_Bi_iter>::value_type const& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1547:5: note: template argument deduction/substitution failed: a.cc:26:13: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 26 | if(v!='\0') | ^~~~ /usr/include/c++/14/bits/regex.h:1647:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator!=(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)' 1647 | operator!=(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1647:5: note: template argument deduction/substitution failed: a.cc:26:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 26 | if(v!='\0') | ^~~~ /usr/include/c++/14/bits/regex.h:2213:5: note: candidate: 'template<class _Bi_iter, class _Alloc> bool std::__cxx11::operator!=(const match_results<_BiIter, _Alloc>&, const match_results<_BiIter, _Alloc>&)' 2213 | operator!=(const match_results<_Bi_iter, _Alloc>& __m1, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:2213:5: note: template argument deduction/substitution failed: a.cc:26:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>' 26 | if(v!='\0') | ^~~~ 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:1052:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator!=(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1052 | operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1052:5: note: template argument deduction/substitution failed: a.cc:26:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 26 | if(v!='\0') | ^~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14/bits/stl_iterator.h:455:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 455 | operator!=(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:455:5: note: template argument deduction/substitution failed: a.cc:26:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 26 | if(v!='\0') | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:500:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 500 | operator!=(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:500:5: note: template argument deduction/substitution failed: a.cc:26:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 26 | if(v!='\0') | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:1686:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1686 | operator!=(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1686:5: note: template argument deduction/substitution failed: a.cc:26:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 26 | if(v!='\0') | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:1753:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1753 | operator!=(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1753:5: note: template argument deduction/substitution failed: a.cc:26:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 26 | if(v!='\0') | ^~~~ In file included from /usr/include/c++/14/bits/char_traits.h:42, from /usr/include/c++/14/string:42, 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/postypes.h:197:5: note: candidate: 'template<class _StateT> bool std::operator!=(const fpos<_StateT>&, const fpos<_StateT>&)' 197 | operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:197:5: note: template argument deduction/substitution failed: a.cc:26:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>' 26 | if(v!='\0') | ^~~~ In file included from /usr/include/c++/14/string:43: /usr/include/c++/14/bits/allocator.h:243:5: note: candidate: 'template<class _T1, class _T2> bool std::operator!=(const allocator<_CharT>&, const allocator<_T2>&)' 243 | operator!=(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:243:5: note: template argument deduction/substitution failed: a.cc:26:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>' 26 | if(v!='\0') | ^~~~ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54: /usr/include/c++/14/string_view:651:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 651 | operator!=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:651:5: note: template argument deduction/substitution failed: a.cc:26:13: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 26 | if(v!='\0') | ^~~~ /usr/include/c++/14/string_view:658:5: note: candidate: 'template<class _Cha
s275899702
p04029
C++
#include<bits/stdc++.h> using namespace std; int main() { vector<string> s; int i=0; int l=0; while(cin>>s[i]) { l++; i++; } for(i=0;i<l;i++) { if(s[i]==0) { s.push_back(0); l++; } else if(s[i]==1) { s.push_back(1); l++; } else if(s[i]=='B') { s.pop_back(); l--; } } for(i=0;i<l;i++) { cout<<s[i]; } return 0; }
a.cc: In function 'int main()': a.cc:18:12: error: no match for 'operator==' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} and 'int') 18 | if(s[i]==0) In file included from /usr/include/c++/14/regex:68, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181, from a.cc:1: /usr/include/c++/14/bits/regex.h:1103:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const sub_match<_BiIter>&)' 1103 | operator==(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1103:5: note: template argument deduction/substitution failed: a.cc:18:14: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 18 | if(s[i]==0) | ^ /usr/include/c++/14/bits/regex.h:1199: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>&)' 1199 | operator==(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1199:5: note: template argument deduction/substitution failed: a.cc:18:14: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 18 | if(s[i]==0) | ^ /usr/include/c++/14/bits/regex.h:1274: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>&)' 1274 | operator==(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1274:5: note: template argument deduction/substitution failed: a.cc:18:14: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 18 | if(s[i]==0) | ^ /usr/include/c++/14/bits/regex.h:1366:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)' 1366 | operator==(typename iterator_traits<_Bi_iter>::value_type const* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1366:5: note: template argument deduction/substitution failed: a.cc:18:14: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 18 | if(s[i]==0) | ^ /usr/include/c++/14/bits/regex.h:1441:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)' 1441 | operator==(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1441:5: note: template argument deduction/substitution failed: a.cc:18:14: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 18 | if(s[i]==0) | ^ /usr/include/c++/14/bits/regex.h:1534:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)' 1534 | operator==(typename iterator_traits<_Bi_iter>::value_type const& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1534:5: note: template argument deduction/substitution failed: a.cc:18:14: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 18 | if(s[i]==0) | ^ /usr/include/c++/14/bits/regex.h:1613:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)' 1613 | operator==(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1613:5: note: template argument deduction/substitution failed: a.cc:18:14: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 18 | if(s[i]==0) | ^ /usr/include/c++/14/bits/regex.h:2186:5: note: candidate: 'template<class _Bi_iter, class _Alloc> bool std::__cxx11::operator==(const match_results<_BiIter, _Alloc>&, const match_results<_BiIter, _Alloc>&)' 2186 | operator==(const match_results<_Bi_iter, _Alloc>& __m1, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:2186:5: note: template argument deduction/substitution failed: a.cc:18:14: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>' 18 | if(s[i]==0) | ^ 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:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1033 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1033:5: note: template argument deduction/substitution failed: a.cc:18:14: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 18 | if(s[i]==0) | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 441 | operator==(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:441:5: note: template argument deduction/substitution failed: a.cc:18:14: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 18 | if(s[i]==0) | ^ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 486 | operator==(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: template argument deduction/substitution failed: a.cc:18:14: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 18 | if(s[i]==0) | ^ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1667 | operator==(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: template argument deduction/substitution failed: a.cc:18:14: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 18 | if(s[i]==0) | ^ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1737 | operator==(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: template argument deduction/substitution failed: a.cc:18:14: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 18 | if(s[i]==0) | ^ In file included from /usr/include/c++/14/bits/char_traits.h:42, from /usr/include/c++/14/string:42, 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/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)' 192 | operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:192:5: note: template argument deduction/substitution failed: a.cc:18:14: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>' 18 | if(s[i]==0) | ^ In file included from /usr/include/c++/14/string:43: /usr/include/c++/14/bits/allocator.h:235:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const allocator<_C
s797063727
p04029
C++
#include<bits/stdc++.h> using namespace std; int main() { int n,sum=0; cin>>n; for(i=0;i<n;i++) { sum+=i; } cout<<sum; return 0; }
a.cc: In function 'int main()': a.cc:7:7: error: 'i' was not declared in this scope 7 | for(i=0;i<n;i++) | ^
s083418421
p04029
C++
#include<bits/stdc++.h> using namespace std; int main() { int N; cin >> N; int ans = 0; for(int i = 0; i < N; i++) { ans += (i + 1) } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:10:23: error: expected ';' before '}' token 10 | ans += (i + 1) | ^ | ; 11 | } | ~
s137990491
p04029
C++
int main() { string ss, ans=""; cin >> ss; for(ll i=0;i<ss.size();i++) { if(ss[i]=='1' || ss[i]=='0') ans+=ss[i]; else { if(ans.size()) ans.pop_back(); } } cout << ans; }
a.cc: In function 'int main()': a.cc:3:5: error: 'string' was not declared in this scope 3 | string ss, ans=""; | ^~~~~~ a.cc:4:5: error: 'cin' was not declared in this scope 4 | cin >> ss; | ^~~ a.cc:4:12: error: 'ss' was not declared in this scope 4 | cin >> ss; | ^~ a.cc:5:9: error: 'll' was not declared in this scope 5 | for(ll i=0;i<ss.size();i++) | ^~ a.cc:5:16: error: 'i' was not declared in this scope 5 | for(ll i=0;i<ss.size();i++) | ^ a.cc:8:38: error: 'ans' was not declared in this scope 8 | if(ss[i]=='1' || ss[i]=='0') ans+=ss[i]; | ^~~ a.cc:12:16: error: 'ans' was not declared in this scope 12 | if(ans.size()) ans.pop_back(); | ^~~ a.cc:15:5: error: 'cout' was not declared in this scope 15 | cout << ans; | ^~~~ a.cc:15:13: error: 'ans' was not declared in this scope 15 | cout << ans; | ^~~
s656810460
p04029
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N; cin >> N; int M = N; if(N==1){ cout << 1 <<end; } else{ N-=1 for(int i=0;i<N;N--){ M+=N } cout << M << endl; } }
a.cc: In function 'int main()': a.cc:8:15: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>') 8 | cout << 1 <<end; | ~~~~~~~~~~^~~~~ In file included from /usr/include/c++/14/istream:41, from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127, from a.cc:1: /usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'} 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]' 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ^~~~~~~~ /usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::ios_base& (*)(std::ios_base&)' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 174 | operator<<(long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long int' 174 | operator<<(long __n) | ~~~~~^~~ /usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 178 | operator<<(unsigned long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long unsigned int' 178 | operator<<(unsigned long __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 182 | operator<<(bool __n) | ^~~~~~~~ /usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'bool' 182 | operator<<(bool __n) | ~~~~~^~~ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]' 96 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short int' 97 | operator<<(short __n) | ~~~~~~^~~ /usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 189 | operator<<(unsigned short __n) | ^~~~~~~~ /usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short unsigned int' 189 | operator<<(unsigned short __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]' 110 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'int' 111 | operator<<(int __n) | ~~~~^~~ /usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 200 | operator<<(unsigned int __n) | ^~~~~~~~ /usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned int' 200 | operator<<(unsigned int __n) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 211 | operator<<(long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long int' 211 | operator<<(long long __n) | ~~~~~~~~~~^~~ /usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 215 | operator<<(unsigned long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long unsigned int' 215 | operator<<(unsigned long long __n) | ~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 231 | operator<<(double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'double' 231 | operator<<(double __f) | ~~~~~~~^~~ /usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 235 | operator<<(float __f) | ^~~~~~~~ /usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'float' 235 | operator<<(float __f) | ~~~~~~^~~ /usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 243 | operator<<(long double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long double' 243 | operator<<(long double __f) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 301 | operator<<(const void* __p) | ^~~~~~~~ /usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'const void*' 301 | operator<<(const void* __p) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:306:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::nullptr_t) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; std::nullptr_t = std::nullptr_t]' 306 | opera
s026347408
p04029
C++
#include <iostream> using namespace std; int main(void){ int N; cin >> N; for (int i = 1; i <= N; i++){ int s = 0; s = s + i; } cout << s << endl; return 0; }
a.cc: In function 'int main()': a.cc:10:12: error: 's' was not declared in this scope 10 | cout << s << endl; | ^
s230028519
p04029
C++
#include <iostream> using namespace std; int main(void){ int N; cin >> N; for (int i = 1; i <= N; i++){ int s = 0; s = s + i; cout << s << endl; return 0; }
a.cc: In function 'int main()': a.cc:12:2: error: expected '}' at end of input 12 | } | ^ a.cc:3:15: note: to match this '{' 3 | int main(void){ | ^
s769641616
p04029
C++
#include <iostream> using namespace std; int main() { int n; cin >> n; print((n * (n+1))/2); return 0; }
a.cc: In function 'int main()': a.cc:7:9: error: 'print' was not declared in this scope; did you mean 'printf'? 7 | print((n * (n+1))/2); | ^~~~~ | printf
s800356673
p04029
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N;cin>>N; int sum =o; for (int i=1;i<=n;i++){ sum+=i;} cout<<sum; return 0 ;}
a.cc: In function 'int main()': a.cc:5:12: error: 'o' was not declared in this scope 5 | int sum =o; | ^ a.cc:6:19: error: 'n' was not declared in this scope 6 | for (int i=1;i<=n;i++){ | ^
s177515162
p04029
C++
#incliude <iostream> using namespace std; int main(){ int n; int t; cin>>n; for(int i=0;i<n;i++){ t=t+i; i++; } cout<<t<<endl; }
a.cc:1:2: error: invalid preprocessing directive #incliude; did you mean #include? 1 | #incliude <iostream> | ^~~~~~~~ | include a.cc: In function 'int main()': a.cc:7:5: error: 'cin' was not declared in this scope 7 | 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 | #incliude <iostream> a.cc:12:5: error: 'cout' was not declared in this scope 12 | cout<<t<<endl; | ^~~~ a.cc:12:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:12:14: error: 'endl' was not declared in this scope 12 | cout<<t<<endl; | ^~~~ a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' +++ |+#include <ostream> 1 | #incliude <iostream>
s645273535
p04029
C++
#incliude <iostream> using namespace std; int main(){ int n; int t; cin>>n; for(int i=0;i<n;i++){ t=t+i i++ } cout<<t<<endl; }
a.cc:1:2: error: invalid preprocessing directive #incliude; did you mean #include? 1 | #incliude <iostream> | ^~~~~~~~ | include a.cc: In function 'int main()': a.cc:7:5: error: 'cin' was not declared in this scope 7 | 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 | #incliude <iostream> a.cc:9:14: error: expected ';' before 'i' 9 | t=t+i | ^ | ; 10 | i++ | ~ a.cc:12:5: error: 'cout' was not declared in this scope 12 | cout<<t<<endl; | ^~~~ a.cc:12:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:12:14: error: 'endl' was not declared in this scope 12 | cout<<t<<endl; | ^~~~ a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' +++ |+#include <ostream> 1 | #incliude <iostream>
s989766072
p04029
C++
#incliude <iostream> using namespace std; int main(){ int n; int t; cin>>n; for(int i=0;i<n;i++){ t=t+i i++ } cout<<a<<endl; }
a.cc:1:2: error: invalid preprocessing directive #incliude; did you mean #include? 1 | #incliude <iostream> | ^~~~~~~~ | include a.cc: In function 'int main()': a.cc:7:5: error: 'cin' was not declared in this scope 7 | 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 | #incliude <iostream> a.cc:9:14: error: expected ';' before 'i' 9 | t=t+i | ^ | ; 10 | i++ | ~ a.cc:12:5: error: 'cout' was not declared in this scope 12 | cout<<a<<endl; | ^~~~ a.cc:12:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:12:11: error: 'a' was not declared in this scope 12 | cout<<a<<endl; | ^ a.cc:12:14: error: 'endl' was not declared in this scope 12 | cout<<a<<endl; | ^~~~ a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' +++ |+#include <ostream> 1 | #incliude <iostream>
s560497096
p04029
C++
#include<iostream> using namespace std; int main () { int sum=o,i,n; cin>>n; for( i=1;i<n;i++) { sum=sum+i; } cout<<sum<<endl; return 0; }
a.cc: In function 'int main()': a.cc:5:9: error: 'o' was not declared in this scope 5 | int sum=o,i,n; | ^ a.cc:6:6: error: 'n' was not declared in this scope 6 | cin>>n; | ^ a.cc:7:6: error: 'i' was not declared in this scope 7 | for( i=1;i<n;i++) | ^
s505827333
p04029
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using ll = long long; using P = pair<int,string>; int main() { int n; cin >> n; int sum = 0; for(int i = 1; i<= n ;i++){ sum+=i; } cout << sum <<< endl; }
a.cc: In function 'int main()': a.cc:14:17: error: expected primary-expression before '<' token 14 | cout << sum <<< endl; | ^
s624118190
p04029
Java
import java.util.Scanner; public class ABC043_A { public static void main (String[] args) { int sum = 0; Scanner sc = new Scanner(System.in); int n = sc.nextInt(); for(int i = 0; i <= n; i++) { sum += i; } System.out.println(sum); } }
Main.java:3: error: class ABC043_A is public, should be declared in a file named ABC043_A.java public class ABC043_A { ^ 1 error
s302318267
p04029
C
#include<iostream> using namespace std; int main() { int s=0,t,i; cin>>t; for(i=1;i<=t;i++) { s=s+i; } cout<<s<<endl; }
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s281640396
p04029
C++
#include<bits/stdc+.h> using namespace std; int main (void){ int n ; cin >> n ; int c=0; for(int i=0; i <= n ; i++){ c = c +i; } cout << c ; }
a.cc:1:9: fatal error: bits/stdc+.h: No such file or directory 1 | #include<bits/stdc+.h> | ^~~~~~~~~~~~~~ compilation terminated.
s103767291
p04029
C++
#include<bits/stdc+.h> using namespace std; int main (void){ int n ; cin >> n ; int c=0; for(int i=0; i < n ; i++){ c = c +i; } cout << c ; }
a.cc:1:9: fatal error: bits/stdc+.h: No such file or directory 1 | #include<bits/stdc+.h> | ^~~~~~~~~~~~~~ compilation terminated.
s072871271
p04029
C
#include <stdio.h> int main(){ int n; if(scanf("%d", &n) == 1){}; print("%d", (n * (n + 1) / 2)); }
main.c: In function 'main': main.c:6:9: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration] 6 | print("%d", (n * (n + 1) / 2)); | ^~~~~ | printf
s372608929
p04029
C
#include <stdio.h> int main(){ int n; if(scanf(%d, &n) == 1){}; printf("%d", (n * (n + 1) / 2)); }
main.c: In function 'main': main.c:5:18: error: expected expression before '%' token 5 | if(scanf(%d, &n) == 1){}; | ^
s456016042
p04029
C
#include <stdio.h> int main(){ int n; if(scanf(%d, &n) == 1){}; print("%d", (n * (n + 1) / 2)); }
main.c: In function 'main': main.c:5:18: error: expected expression before '%' token 5 | if(scanf(%d, &n) == 1){}; | ^ main.c:6:9: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration] 6 | print("%d", (n * (n + 1) / 2)); | ^~~~~ | printf
s217066629
p04029
C
#include <stdio.h> int main(){ int n; if(scanf(%d, n) == 1){}; print("%d", (n * (n + 1) / 2)) }
main.c: In function 'main': main.c:5:18: error: expected expression before '%' token 5 | if(scanf(%d, n) == 1){}; | ^ main.c:6:9: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration] 6 | print("%d", (n * (n + 1) / 2)) | ^~~~~ | printf main.c:6:39: error: expected ';' before '}' token 6 | print("%d", (n * (n + 1) / 2)) | ^ | ; 7 | } | ~
s829144877
p04029
C
#include <stdio.h> int main(){ int a; if(scanf(%d, n) == 1){}; print("%d", (n * (n + 1) / 2)) }
main.c: In function 'main': main.c:5:18: error: expected expression before '%' token 5 | if(scanf(%d, n) == 1){}; | ^ main.c:6:9: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration] 6 | print("%d", (n * (n + 1) / 2)) | ^~~~~ | printf main.c:6:22: error: 'n' undeclared (first use in this function) 6 | print("%d", (n * (n + 1) / 2)) | ^ main.c:6:22: note: each undeclared identifier is reported only once for each function it appears in main.c:6:39: error: expected ';' before '}' token 6 | print("%d", (n * (n + 1) / 2)) | ^ | ; 7 | } | ~
s660317165
p04029
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N; cin>> N; count =0; for(int i=0;i<N+1;i++){ count +=i; } count<< count <<endl; rerturn 0; }
a.cc: In function 'int main()': a.cc:7:9: error: overloaded function with no contextual type information 7 | count =0; | ^ a.cc:9:12: error: overloaded function with no contextual type information 9 | count +=i; | ^ a.cc:12:9: error: invalid operands of types '<unresolved overloaded function type>' and '<unresolved overloaded function type>' to binary 'operator<<' 12 | count<< count <<endl; | ~~~~~^~~~~~~~ a.cc:14:1: error: 'rerturn' was not declared in this scope 14 | rerturn 0; | ^~~~~~~
s376478927
p04029
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N,S; cin >> N; S=(N*(N+1))/2; cout >> S>>endl; return 0; }
a.cc: In function 'int main()': a.cc:9:7: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int') 9 | cout >> S>>endl; | ~~~~ ^~ ~ | | | | | int | std::ostream {aka std::basic_ostream<char>} a.cc:9:7: note: candidate: 'operator>>(int, int)' (built-in) 9 | cout >> S>>endl; | ~~~~~^~~~ 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/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:9:2: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 9 | cout >> S>>endl; | ^~~~ 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:9:10: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 9 | cout >> S>>endl; | ^ /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:9:10: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 9 | cout >> S>>endl; | ^ 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:9:10: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 9 | cout >> S>>endl; | ^ /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:10: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 9 | cout >> S>>endl; | ^ /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:10: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 9 | cout >> S>>endl; | ^ /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:10: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 9 | cout >> S>>endl; | ^ /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:10: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 9 | cout >> S>>endl; | ^ /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:10: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 9 | cout >> S>>endl; | ^ /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:10: required from here 9 | cout >> S>>endl; | ^ /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:9:10: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 9 | cout >> S>>endl; | ^ 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:9:10: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 9 | cout >> S>>endl; | ^ /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:9:10: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 9 | cout >> S>>endl; | ^ /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:9:10: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 9 | cout >> S>>endl; | ^ /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:9:10: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 9 | cout >> S>>endl; | ^ /usr/include/c++/14/iomanip:207:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setprecision)' 207 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setprecision __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:207:5: note: template argument deduction/substitution failed: a.cc:9:10: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 9 | cout >> S>>endl; | ^ /usr/include/c++/14/iomanip:237:5: note:
s545823928
p04029
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N; cin >> N; cout>> N*(N+1) /2 >>endl; return 0; }
a.cc: In function 'int main()': a.cc:8:7: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int') 8 | cout>> N*(N+1) /2 >>endl; | ~~~~^~ ~~~~~~~~~~ | | | | | int | std::ostream {aka std::basic_ostream<char>} a.cc:8:7: note: candidate: 'operator>>(int, int)' (built-in) 8 | cout>> N*(N+1) /2 >>endl; | ~~~~^~~~~~~~~~~~~ a.cc:8:7: 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:8:3: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 8 | cout>> N*(N+1) /2 >>endl; | ^~~~ 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:8:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 8 | cout>> N*(N+1) /2 >>endl; | ^ /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:8:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 8 | cout>> N*(N+1) /2 >>endl; | ^ 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:8:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 8 | cout>> N*(N+1) /2 >>endl; | ^ /usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)' 849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed: a.cc:8:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 8 | cout>> N*(N+1) /2 >>endl; | ^ /usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)' 854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed: a.cc:8:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 8 | cout>> N*(N+1) /2 >>endl; | ^ /usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)' 896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed: a.cc:8:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 8 | cout>> N*(N+1) /2 >>endl; | ^ /usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)' 939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed: a.cc:8:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 8 | cout>> N*(N+1) /2 >>endl; | ^ /usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)' 945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed: a.cc:8:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 8 | cout>> N*(N+1) /2 >>endl; | ^ /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:8:19: required from here 8 | cout>> N*(N+1) /2 >>endl; | ^ /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:8:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 8 | cout>> N*(N+1) /2 >>endl; | ^ 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:8:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 8 | cout>> N*(N+1) /2 >>endl; | ^ /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:8:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 8 | cout>> N*(N+1) /2 >>endl; | ^ /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:8:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 8 | cout>> N*(N+1) /2 >>endl; | ^ /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:8:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 8 | cout>> N*(N+1) /2 >>endl; | ^ /usr/include/c++/14/iomanip:207:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setprecision)' 207 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setprecisio
s242364341
p04029
Java
import java.util.Scanner; public class Main{ Scanner sc = new Scanner(System.in); int N =sc.nextInt(); int S=N*(N+1)/2; public static void main(String[] args){ System.out.println(S); } }
Main.java:8: error: non-static variable S cannot be referenced from a static context System.out.println(S); ^ 1 error
s454038092
p04029
Java
import java.util.Scanner; public class Main{ int N; Scanner sc = new Scanner(System.in); int N =sc.nextInt(); int S=N*(N+1)/2; public static void main(String[] args){ System.out.println(S); } }
Main.java:6: error: variable N is already defined in class Main int N =sc.nextInt(); ^ Main.java:9: error: non-static variable S cannot be referenced from a static context System.out.println(S); ^ 2 errors
s187317654
p04029
Java
import java.util.Scanner; public class Main{ int N; Scanner sc = new Scanner(System.in); int N =sc.nextInt(); int S=N*(N+1)/2 public static void main(String[] args){ System.out.println(S); } }
Main.java:7: error: ';' expected int S=N*(N+1)/2 ^ 1 error
s124560695
p04029
Java
import java.util.Scanner; public class Main{ Scanner sc = new Scanner(System.in); int N =sc.nextInt(); public static void main(String[] args){ System.out.println(N*(N+1)/2); } }
Main.java:8: error: non-static variable N cannot be referenced from a static context System.out.println(N*(N+1)/2); ^ Main.java:8: error: non-static variable N cannot be referenced from a static context System.out.println(N*(N+1)/2); ^ 2 errors
s912025247
p04029
Java
import java.util.Scanner; public class Main{ int N; Scanner sc = new Scanner(System.in); int N =sc.nextInt(); public static void main(String[] args){ System.out.println((N*(N+1))/2); } }
Main.java:6: error: variable N is already defined in class Main int N =sc.nextInt(); ^ Main.java:9: error: non-static variable N cannot be referenced from a static context System.out.println((N*(N+1))/2); ^ Main.java:9: error: non-static variable N cannot be referenced from a static context System.out.println((N*(N+1))/2); ^ 3 errors
s023330088
p04029
Java
import java.util.Scanner; public class Main{ Scanner sc = new Scanner(System.in); int N =sc.nextInt(); public static void main(String[] args){ System.out.println((N*(N+1))/2); } }
Main.java:9: error: non-static variable N cannot be referenced from a static context System.out.println((N*(N+1))/2); ^ Main.java:9: error: non-static variable N cannot be referenced from a static context System.out.println((N*(N+1))/2); ^ 2 errors
s232029642
p04029
Java
import java.util.scanner; public class Main{ Scanner sc = new Scanner(System.in); int N =sc.nextInt(); public static void main(String[] args){ System.out.println((N*(N+1))/2); } }
Main.java:1: error: cannot find symbol import java.util.scanner; ^ symbol: class scanner location: package java.util Main.java:5: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:5: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:9: error: non-static variable N cannot be referenced from a static context System.out.println((N*(N+1))/2); ^ Main.java:9: error: non-static variable N cannot be referenced from a static context System.out.println((N*(N+1))/2); ^ 5 errors
s021333240
p04029
Java
import java.util.Scanner; public class Main{ Main(); Scanner sc = new Scanner(System.in); int N =sc.nextInt(); public static void main(String[] args){ System.out.println((N*(N+1))/2); } }
Main.java:4: error: missing method body, or declare abstract Main(); ^ Main.java:10: error: non-static variable N cannot be referenced from a static context System.out.println((N*(N+1))/2); ^ Main.java:10: error: non-static variable N cannot be referenced from a static context System.out.println((N*(N+1))/2); ^ 3 errors
s787367180
p04029
Java
import java.util.scanner; public class Main{ Main(); Scanner sc = new Scanner(System.in); int N =sc.nextInt(); public static void main(String[] args){ System.out.println((N*(N+1))/2); } }
Main.java:1: error: cannot find symbol import java.util.scanner; ^ symbol: class scanner location: package java.util Main.java:6: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:4: error: missing method body, or declare abstract Main(); ^ Main.java:6: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:10: error: non-static variable N cannot be referenced from a static context System.out.println((N*(N+1))/2); ^ Main.java:10: error: non-static variable N cannot be referenced from a static context System.out.println((N*(N+1))/2); ^ 6 errors
s906770216
p04029
Java
import java.util.scanner; public class Main{ Main(); Scanner sc = new Scanner(System.in); int N =sc.nextInt(); public static void main(String[] args){ System.out.println((N*(N+1)/2); } }
Main.java:10: error: ')' or ',' expected System.out.println((N*(N+1)/2); ^ 1 error
s974186676
p04029
C++
#include<bits/stdc++.h> using namespace std; int main() { int i,n, sum=0; cin>>n; for(i=n; i<=100; i++){ sum=sum+i} cout<<sum; } return 0; }
a.cc: In function 'int main()': a.cc:8:10: error: expected ';' before '}' token 8 | sum=sum+i} | ^ | ; a.cc: At global scope: a.cc:12:1: error: expected unqualified-id before 'return' 12 | return 0; | ^~~~~~ a.cc:13:1: error: expected declaration before '}' token 13 | } | ^
s484673483
p04029
C++
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; int suming(n){ if(n == 0){ return 0; } return n+(suming(n-1)); } int main(){ int N ,ans; cin >> N; ans = suming(N); cout << ans << endl; }
a.cc:5:12: error: 'n' was not declared in this scope; did you mean 'yn'? 5 | int suming(n){ | ^ | yn a.cc: In function 'int main()': a.cc:15:14: error: 'suming' cannot be used as a function 15 | ans = suming(N); | ~~~~~~^~~
s739808239
p04029
C++
#include <bits/stdc++.h> using namespace std; int main() { int S=0; int N; cin >> N; for(i=0; i<N; i++) { S += i; } cout << S << endl; }
a.cc: In function 'int main()': a.cc:10:7: error: 'i' was not declared in this scope 10 | for(i=0; i<N; i++) { | ^
s839851093
p04029
Java
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String str = sc.nextLine(); String ans = ""; for (int i=0;i<str.length();i++) { char c = str.charAt(i); if (c=='0') ans = ans+'0'; else if (c=='1') ans = ans+'1'; else if (c=='B') { if (str.length()==0) continue; else str = str.substring(0,str.length()); } } System.out.print(ans); } }
Main.java:2: error: class Solution is public, should be declared in a file named Solution.java public class Solution ^ 1 error
s970495563
p04029
Java
class Main { public static void main(String[] args) { int a ; Scanner input = new Scanner(System.in); a=input.nextInt(); System.out.println(a*(a+1)/2); } }
Main.java:4: error: cannot find symbol Scanner input = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:4: error: cannot find symbol Scanner input = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s911065879
p04029
C++
#include <bits/stdc++.h> using namespace std; int main() { int n; cin << n; int ans = 1/2 * n * (n + 1); cout << ans << endl; }
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/regex:68, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181, from a.cc:1: /usr/include/c++/14/bits/regex.h:1715:5: note: candidate: 'template<class _Ch_type, class _Ch_traits, class _Bi_iter> std::basic_ostream<_CharT, _Traits>& std::__cxx11::operator<<(std::basic_ostream<_CharT, _Traits>&, const sub_match<_Bi_iter>&)' 1715 | operator<<(basic_ostream<_Ch_type, _Ch_traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1715: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/x86_64-linux-gnu/c++/14/bits/stdc++.h:41: /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/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: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; | ^ /usr/include/c++/14/bitset:1687:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const bitset<_Nb>&)' 1687 | operator<<(std::basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bitset:1687: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/ios_base.h:46, from /usr/include/c++/14/streambuf:43, from /usr/include/c++/14/bits/streambuf_iterator.h:35, from /usr/include/c++/14/iterator:66, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54: /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; | ^ In file included from /usr/include/c++/14/memory:80, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:56: /usr/include/c++/14/bits/shared_ptr.h:70:5: note: candidate: 'template<class _Ch, class _Tr, class _Tp, __gnu_cxx::_Lock_policy _Lp> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __shared_ptr<_Tp, _Lp>&)' 70 | operator<<(std::basic_ostream<_Ch, _Tr>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/shared_ptr.h:70: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/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: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
s416123696
p04029
C++
#include <bits/stdc++.h> using namespace std; int main() { int n; cin << n; int ans = 0; for (int i = 1; i <= n; i++) { ans += i; } cout << ans << endl; }
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/regex:68, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181, from a.cc:1: /usr/include/c++/14/bits/regex.h:1715:5: note: candidate: 'template<class _Ch_type, class _Ch_traits, class _Bi_iter> std::basic_ostream<_CharT, _Traits>& std::__cxx11::operator<<(std::basic_ostream<_CharT, _Traits>&, const sub_match<_Bi_iter>&)' 1715 | operator<<(basic_ostream<_Ch_type, _Ch_traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1715: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/x86_64-linux-gnu/c++/14/bits/stdc++.h:41: /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/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: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; | ^ /usr/include/c++/14/bitset:1687:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const bitset<_Nb>&)' 1687 | operator<<(std::basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bitset:1687: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/ios_base.h:46, from /usr/include/c++/14/streambuf:43, from /usr/include/c++/14/bits/streambuf_iterator.h:35, from /usr/include/c++/14/iterator:66, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54: /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; | ^ In file included from /usr/include/c++/14/memory:80, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:56: /usr/include/c++/14/bits/shared_ptr.h:70:5: note: candidate: 'template<class _Ch, class _Tr, class _Tp, __gnu_cxx::_Lock_policy _Lp> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __shared_ptr<_Tp, _Lp>&)' 70 | operator<<(std::basic_ostream<_Ch, _Tr>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/shared_ptr.h:70: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/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: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
s522964192
p04029
C++
#include <bits/stdc++> using namespace std; int main() { int n; int ans; for (int i = 1; i <= n; i++) { ans += n; } cout << ans << endl; }
a.cc:1:10: fatal error: bits/stdc++: No such file or directory 1 | #include <bits/stdc++> | ^~~~~~~~~~~~~ compilation terminated.
s143107617
p04029
C++
#include<bits/stdc++.h> using namesspace std; int32_t main() { int n; cin>>n; cout<<n*(n+1)/2<<endl; return 0; }
a.cc:2:7: error: expected nested-name-specifier before 'namesspace' 2 | using namesspace std; | ^~~~~~~~~~ a.cc: In function 'int32_t main()': a.cc:7:3: 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:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 8 | 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:8:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 8 | 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) | ^~~~
s627975065
p04029
Java
import java.util.*; import java.lang.*; class Main{ public static void main(String[] args){ Scanner in=new Scanner (System.in); int s=0; int n=in.nextInt; for(int i=1;i<=n;i++) { s=s+i; } System.out.println(s); } }
Main.java:7: error: cannot find symbol int n=in.nextInt; ^ symbol: variable nextInt location: variable in of type Scanner 1 error
s570695158
p04029
C
#include<stdio.h> int main() { int n,i,s=0; scanf("%d",&ni); for(i=1;i<=n;i++) s=s+i; printf("%d\n",s); return 0; }
main.c: In function 'main': main.c:7:14: error: 'ni' undeclared (first use in this function); did you mean 'i'? 7 | scanf("%d",&ni); | ^~ | i main.c:7:14: note: each undeclared identifier is reported only once for each function it appears in
s927532541
p04029
C
#include<stdio.h> int main() { int n,i,s=0; scanf("%d",&n); for(i=1;i<=n;i++) s=s+i; printf("%d\n",s); return 0 }
main.c: In function 'main': main.c:13:10: error: expected ';' before '}' token 13 | return 0 | ^ | ; 14 | } | ~
s508263549
p04029
C++
#include <bits/stdc++.h> using namespace std; int main() { int n, sum; cin >> n; for(int i=0; i>n; i++) { sum = sum+n } cout << sum; }
a.cc: In function 'int main()': a.cc:10:16: error: expected ';' before '}' token 10 | sum = sum+n | ^ | ; 11 | } | ~
s094420555
p04029
C++
#include <bits/stdc++.h> #define ll long long #define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end))) // rep(i, 1, 5) --> {1,2,3,4} // rep(i, 5, 1) --> {4,3,2,1} // rep(it, end(v), begin(v)) --> *it using namespace std; int main() { int n; ci >> n; cout << n*(n+1)/2; return 0; }
a.cc: In function 'int main()': a.cc:10:3: error: 'ci' was not declared in this scope 10 | ci >> n; | ^~
s359097552
p04029
C++
#include <bits/stdc++.h> using namespace std; int main() { string s,S; cin >> s ; for(int i=0;i<s.size();i++){ if(s.at(i) == '0'){ S = S + '0'; } else if(s,at(i) == '1'){ S = S + '1'; } else{ S.at(S.size()--) = ''; } } cout << S << endl; }
a.cc:18:26: error: empty character constant 18 | S.at(S.size()--) = ''; | ^~ a.cc: In function 'int main()': a.cc:13:15: error: 'at' was not declared in this scope 13 | else if(s,at(i) == '1'){ | ^~ a.cc:18:18: error: lvalue required as decrement operand 18 | S.at(S.size()--) = ''; | ~~~~~~^~
s814600977
p04029
Java
import java.util.*; public class Main{ public void main(String[] args){ Scanner sc = new Scanner(System.in); // 整数の入力 int N = sc.nextInt(); // 合計の計算 sum for (int i=1; i<=N; i++) { sum += i; } // 出力 System.out.println(sum); } }
Main.java:8: error: not a statement sum ^ Main.java:8: error: ';' expected sum ^ 2 errors
s617513315
p04029
Java
import java.util.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); // 整数の入力 int n = sc.nextInt(); int i = 0; if(n == 1){ System.out.println(1); }else{ for(i = 1 ; n-1 ;){ i + i++; } } } }
Main.java:12: error: not a statement i + i++; ^ 1 error
s121211010
p04029
Java
public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); System.out.println((sc.nextInt()*(sc.nextInt()+1))/2); } }
Main.java:3: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:3: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s908435730
p04029
Java
public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); System.out.println((sc.nextInt()*(sc.nextInt()+))/2); } }
Main.java:4: error: illegal start of expression System.out.println((sc.nextInt()*(sc.nextInt()+))/2); ^ 1 error
s559813786
p04029
C++
#include<iostream> using namespace std; int facctorialMethod(int k); int main(){ int N; cin >> N; int facctorialMethod(int k){ int sum = 1; for (int i = 1; i <= k; ++i){ sum *= i; } return sum; } cout << facctorialMethod(N) << endl; }
a.cc: In function 'int main()': a.cc:10:30: error: a function-definition is not allowed here before '{' token 10 | int facctorialMethod(int k){ | ^
s285098244
p04029
C++
#include<iostream> using namespace std; int facctorialMethod(int k); int main(){ int N; cin >> N; int facctorialMethod(int k){ int sum = 1; for (int i = 1; i <= k; ++i) { sum *= i; } return sum; } cout << facctorialMethod(N) << endl; }
a.cc: In function 'int main()': a.cc:10:30: error: a function-definition is not allowed here before '{' token 10 | int facctorialMethod(int k){ | ^
s127614402
p04029
C++
#include <bits/stdc++.h> using namespace std; int main () { int N; cin >> N; int answer = N!; cout << answer << endl; }
a.cc: In function 'int main()': a.cc:8:17: error: expected ',' or ';' before '!' token 8 | int answer = N!; | ^
s083054136
p04029
C++
#include <bits/stdc++.h> using namespace std; int main () { int N; cin >> N; cout << N! << endl; }
a.cc: In function 'int main()': a.cc:8:12: error: expected ';' before '!' token 8 | cout << N! << endl; | ^ | ;
s650966213
p04029
C++
#include <bits/stdc++.h> using namespace std; int main () { int N; cin << N; cout << N! << endl; }
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/regex:68, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181, from a.cc:1: /usr/include/c++/14/bits/regex.h:1715:5: note: candidate: 'template<class _Ch_type, class _Ch_traits, class _Bi_iter> std::basic_ostream<_CharT, _Traits>& std::__cxx11::operator<<(std::basic_ostream<_CharT, _Traits>&, const sub_match<_Bi_iter>&)' 1715 | operator<<(basic_ostream<_Ch_type, _Ch_traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1715: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/x86_64-linux-gnu/c++/14/bits/stdc++.h:41: /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/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: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; | ^ /usr/include/c++/14/bitset:1687:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const bitset<_Nb>&)' 1687 | operator<<(std::basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bitset:1687: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/ios_base.h:46, from /usr/include/c++/14/streambuf:43, from /usr/include/c++/14/bits/streambuf_iterator.h:35, from /usr/include/c++/14/iterator:66, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54: /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; | ^ In file included from /usr/include/c++/14/memory:80, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:56: /usr/include/c++/14/bits/shared_ptr.h:70:5: note: candidate: 'template<class _Ch, class _Tr, class _Tp, __gnu_cxx::_Lock_policy _Lp> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __shared_ptr<_Tp, _Lp>&)' 70 | operator<<(std::basic_ostream<_Ch, _Tr>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/shared_ptr.h:70: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/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: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
s095819254
p04029
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; cout << (1+N)N/2 << endl; }
a.cc: In function 'int main()': a.cc:7:16: error: expected ';' before 'N' 7 | cout << (1+N)N/2 << endl; | ^ | ;
s088605665
p04029
C++
#include <bits/stdc++.h> #define _GLIBCXX_DEBUG #define rep(i ,n) for(int i = 0 ; i < (n) ; i ++ ) #define all(x) (x).begin(),(x).end() using namespace std; using ll = long long; using vin=vector<int>; const int inf=1e9+7; const ll INF=1e18; int main() { string s; cin>>s; int n=s.size(); ///// rep(i,n){ if(s[i]=='0'){ a.push_back(0); } if(s[i]=='1'){ a.push_back(1); } else{ a.pop_back(); } } int b=a.size(); rep(u,b){ cout<<a[u]; } cout<<endl; }
a.cc: In function 'int main()': a.cc:20:7: error: 'a' was not declared in this scope 20 | a.push_back(0); | ^ a.cc:23:7: error: 'a' was not declared in this scope 23 | a.push_back(1); | ^ a.cc:26:7: error: 'a' was not declared in this scope 26 | a.pop_back(); | ^ a.cc:29:9: error: 'a' was not declared in this scope 29 | int b=a.size(); | ^
s791314750
p04029
C++
#include <bits/stdc++.h> using namespace std; using ll = long long int; using P = pair<int, int>; #define loop(i, n) for(int i = 0;i < n;i++) int main(void){ int n; cin >> n; cout << n*(n+1)/2 return 0; }
a.cc: In function 'int main()': a.cc:14:22: error: expected ';' before 'return' 14 | cout << n*(n+1)/2 | ^ | ; 15 | 16 | return 0; | ~~~~~~
s224571529
p04029
C++
#include<bits/c++std.h> using namespace std; int main(void){ int n; cin >> n; cout << (n+n+1)/2 << endl; }
a.cc:1:9: fatal error: bits/c++std.h: No such file or directory 1 | #include<bits/c++std.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s911445514
p04029
C++
//8 may 2020 //count of solved problems : 2 #include<bits/stdc++.h> using namespace std; const int mod=1e9+7; int n; int main(){ cin>>n; ll sum=0; for(int i=1;i<=n;i++)sum+=i; cout<<sum; }
a.cc: In function 'int main()': a.cc:12:9: error: 'll' was not declared in this scope 12 | ll sum=0; | ^~ a.cc:13:30: error: 'sum' was not declared in this scope 13 | for(int i=1;i<=n;i++)sum+=i; | ^~~ a.cc:14:23: error: 'sum' was not declared in this scope 14 | cout<<sum; | ^~~
s076542842
p04029
C++
#include<iostream> #include<string> #include<cstdio> #include<vector> #include<cmath> #include<algorithm> #include<functional> #include<iomanip> #include<queue> #include<ciso646> #include<random> #include<map> #include<set> #include<bitset> #include<stack> #include<unordered_map> #include<utility> #include<cassert> #include<complex> #include<numeric> #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ul; typedef unsigned int ui; typedef pair<int, int>P; typedef pair<ll, ll> LP; typedef long double ld; typedef pair<ld, ld> LDP; typedef vector<vector<ll>> mat; typedef vector<ll> vec; #define rep(i,n) for(int i=0;i<n;i++) #define per(i,n) for(int i=n-1;i>=0;i--) #define Rep(i,sta,n) for(int i=sta;i<n;i++) #define rep1(i,n) for(int i=1;i<=n;i++) #define per1(i,n) for(int i=n;i>=1;i--) #define Rep1(i,sta,n) for(int i=sta;i<=n;i++) #define all(v) (v).begin(),(v).end() const ll mod = 1000000007; const ll INF = mod * mod; const ld eps = 1e-12; const ld pi = acos(-1.0); //int qp(int a,ll b){int ans=1;do{if(b&1)ans=1ll*ans*a%mo;a=1ll*a*a%mo;}while(b>>=1);return ans;} ll qp(ll a,ll b,int mo){int ans=1;do{if(b&1)ans=1ll*ans*a%mo;a=1ll*a*a%mo;}while(b>>=1);return ans;} ll gcd(ll a,ll b){return b?gcd(b,a%b):a;} // 最大公約数 ll lcm (ll a, ll b){return a/gcd(a,b)*b;} // 最小公倍数 int dx[4] = { 0,1,0,-1 }; int dy[4] = { 1,0,-1,0 }; template<typename T> istream &operator>>(istream &is, vector<T> &vec){ for (auto &v : vec) is >> v; return is; } template<typename T> ostream &operator<<(ostream &os, const vector<T> &vec){ os << "["; for (auto v : vec) os << v << ","; os << "]"; return os; } template<typename T> ostream &operator<<(ostream &os, const deque<T> &vec){ os << "deq["; for (auto v : vec) os << v << ","; os << "]"; return os; } template<typename T> ostream &operator<<(ostream &os, const set<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; } template<typename T> ostream &operator<<(ostream &os, const unordered_set<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; } template<typename T> ostream &operator<<(ostream &os, const multiset<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; } template<typename T> ostream &operator<<(ostream &os, const unordered_multiset<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; } template<typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &pa){ os << "(" << pa.first << "," << pa.second << ")"; return os; } template<typename TK, typename TV> ostream &operator<<(ostream &os, const map<TK, TV> &mp){ os << "{"; for (auto v : mp) os << v.first << "=>" << v.second << ","; os << "}"; return os; } template<typename TK, typename TV> ostream &operator<<(ostream &os, const unordered_map<TK, TV> &mp){ os << "{"; for (auto v : mp) os << v.first << "=>" << v.second << ","; os << "}"; return os; } template<typename T> void ndarray(vector<T> &vec, int len) { vec.resize(len); } template<typename T, typename... Args> void ndarray(vector<T> &vec, int len, Args... args) { vec.resize(len); for (auto &v : vec) ndarray(v, args...); } template<typename T> bool chmax(T &m, const T q) { if (m < q) {m = q; return true;} else return false; } template<typename T> bool chmin(T &m, const T q) { if (q < m) {m = q; return true;} else return false; } template<typename T1, typename T2> pair<T1, T2> operator+(const pair<T1, T2> &l, const pair<T1, T2> &r) { return make_pair(l.first + r.first, l.second + r.second); } template<typename T1, typename T2> pair<T1, T2> operator-(const pair<T1, T2> &l, const pair<T1, T2> &r) { return make_pair(l.first - r.first, l.second - r.second); } template<typename T1, typename T2> pair<T1, T2> operator<(const pair<T1, T2> l, const pair<T1, T2> r) { return (l.first < r.first); } template<typename T1, typename T2> pair<T1, T2> operator>(const pair<T1, T2> l, const pair<T1, T2> r) { return (l.first > r.first); } void solve() { int a; cin >>a; int ans = 0; rep1(i,a){ans+=a*a}; cout << ans << endl; } signed main() { ios::sync_with_stdio(false); cin.tie(0); std::cout << fixed << setprecision(10); solve(); return 0; }
a.cc: In function 'void solve()': a.cc:75:23: error: expected ';' before '}' token 75 | rep1(i,a){ans+=a*a}; | ^ | ;
s221311986
p04029
C++
#include "pch.h" #include <bits/stdc++.h> using namespace std; int main() { long n; cin >> n; cout << n * (n + 1) / 2 << endl; return 0; }
a.cc:1:10: fatal error: pch.h: No such file or directory 1 | #include "pch.h" | ^~~~~~~ compilation terminated.
s830592505
p04029
C
#include<stdio.h> #include <string.h> int main(){ char str[10]; //初期の入力 char out[10]; //出力用 int l, p=0; //l:長さチェック p;行列の長さ把握 scanf("%s",&str); l = strlen(str); //入力された文章の長さをチェック for(i=0;i<l;i++){ if(str[i] == '0'){ out[i] = '0'; p++; }else if(str[i] == '1'){ out[i] = '1'; p++ }else{p--;} } printf("%s",out); return 0; }
main.c: In function 'main': main.c:12:7: error: 'i' undeclared (first use in this function) 12 | for(i=0;i<l;i++){ | ^ main.c:12:7: note: each undeclared identifier is reported only once for each function it appears in main.c:18:10: error: expected ';' before '}' token 18 | p++ | ^ | ; 19 | }else{p--;} | ~
s742116988
p04029
C
#include<stdio.h> int main(){ int a,ans=0; scanf("%d",&a); for(i=1;i<=a;i++){ ans+=a; } printf("%d",ans); return 0; }
main.c: In function 'main': main.c:6:7: error: 'i' undeclared (first use in this function) 6 | for(i=1;i<=a;i++){ | ^ main.c:6:7: note: each undeclared identifier is reported only once for each function it appears in
s180633971
p04029
C++
n=input() print(n*(n+1)//2)
a.cc:1:1: error: 'n' does not name a type 1 | n=input() | ^
s993296681
p04029
Java
public class Main { public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ Scanner scan = new Scanner(System.in); int N = scan.nextInt(); int sum = 0; for(int i = 1; i <= N; i++) { sum += i; } System.out.println(sum); scan.close(); } }
Main.java:5: error: cannot find symbol Scanner scan = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:5: error: cannot find symbol Scanner scan = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s427995191
p04029
Java
import java.util.*; public class Main { public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int sum = 0; if(int i = 1; i <= a; i++) { sum += i; } System.out.println(sum); } }
Main.java:9: error: '.class' expected if(int i = 1; i <= a; i++) { ^ Main.java:9: error: not a statement if(int i = 1; i <= a; i++) { ^ Main.java:9: error: ';' expected if(int i = 1; i <= a; i++) { ^ 3 errors