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...
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")...
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...
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...
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++) { su...
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; } ...
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 revers...
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"); } ...
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...
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+=...
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...
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...
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...
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 "...
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 ...
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'...
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_strin...
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]=...
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 ...
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; | ...
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/...
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 '<i...
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 '<i...
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 '<i...
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)); ...
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)) ...
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)) ...
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 over...
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: 'o...
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<...
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 ...
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 s...
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...
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 declar...
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';...
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 err...
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: 'operat...
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: 'operat...
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/inc...
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() ...
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 operan...
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: 'operat...
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){ ...
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(); | ...
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 th...
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> #in...
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'){ ...
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++ | ...
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++) { ...
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++) { ...