submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s401057651
p04029
C++
#include <bits/stdc++.h> using namespace std; int main() { int N ; cin >> N >> end; cout << ( N * N + 1 ) / 2 << endl; }
a.cc: In function 'int main()': a.cc:6:12: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and '<unresolved overloaded function type>') 6 | cin >> N >> end; | ~~~~~~~~~^~~~~~ In file included from /usr/include/c++/14/sstream:4...
s743076172
p04029
C++
#include <bits/stdc++.h> using namespace std; int main() { int N ; cin >> N >> ; cout << ( N * N + 1 ) / 2 << endl; }
a.cc: In function 'int main()': a.cc:6:15: error: expected primary-expression before ';' token 6 | cin >> N >> ; | ^
s503309626
p04029
C
#include<stdio.h> int main() { int n, sum; scanf("%d",&n); sum=(n*(n+1))/2; } return 0;
main.c:9:1: error: expected identifier or '(' before 'return' 9 | return 0; | ^~~~~~
s337997523
p04029
C++
#include <bits/stdc++.h> int main() { int n; std::cin>>n; std::cout<<n*(n+1)/2<<endl; return 0; }
a.cc: In function 'int main()': a.cc:6:27: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 6 | std::cout<<n*(n+1)/2<<endl; | ^~~~ | std::endl In file included from /usr/include/c++/14/istream:41, from /usr/i...
s983284176
p04029
C++
#include<iostream> using namespace std; int main(){ int a,ans=0; cin>>a; for(int i=1;i<=a;i++){ ans+i=ans; } cout>>ans; return 0; }
a.cc: In function 'int main()': a.cc:7:8: error: lvalue required as left operand of assignment 7 | ans+i=ans; | ~~~^~ a.cc:9:7: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int') 9 | cout>>ans; | ~~~~^~~~~ | | | ...
s276853413
p04029
C++
#include<bits/stdc++.h> using namespace std; int main() { int N,sum; cin>>N; for (int i=o;i<N;i++){ sum +=i; } cout<<sum<<endl; }
a.cc: In function 'int main()': a.cc:8:14: error: 'o' was not declared in this scope 8 | for (int i=o;i<N;i++){ | ^
s976821240
p04029
C++
#include <bits/stdc++.h> #include <cstdio> using namespace std; int main() { int N; cin >> N; printf(N * (N + 1) / 2); }
a.cc: In function 'int main()': a.cc:9:28: error: invalid conversion from 'int' to 'const char*' [-fpermissive] 9 | printf(N * (N + 1) / 2); | ~~~~~~~~~~~~^~~ | | | int In file included from /usr/include/c++/14/cstdio:42,...
s772054167
p04029
C
#include<stdio.h> int main() { int a,b,N; clrscr(); printf("enter a number"); scanf("%d",&N); a=1; b=0; while(a<=N) { b=b+a; a=a+1; } printf("%d",b); getch(); }
main.c: In function 'main': main.c:6:7: error: implicit declaration of function 'clrscr' [-Wimplicit-function-declaration] 6 | clrscr(); | ^~~~~~ main.c:17:7: error: implicit declaration of function 'getch'; did you mean 'getc'? [-Wimplicit-function-declaration] 17 | getch(); | ...
s587757563
p04029
C
#include<stdio.h> void main() { int a,b,N; clrscr(); printf("enter a number"); scanf("%d",&N); a=1; b=0; while(a<=N) { b=b+a; a=a+1; } printf("%d",b); getch(); }
main.c: In function 'main': main.c:7:7: error: implicit declaration of function 'clrscr' [-Wimplicit-function-declaration] 7 | clrscr(); | ^~~~~~ main.c:18:7: error: implicit declaration of function 'getch'; did you mean 'getc'? [-Wimplicit-function-declaration] 18 | getch(); | ...
s186254726
p04029
C
#include<stdio.h> #include<conio.h> void main() { int a,b,N; clrscr(); printf("enter a number"); scanf("%d",&N); a=1; b=0; while(a<=N) { b=b+a; a=a+1; } printf("%d",b); getch(); }
main.c:2:13: fatal error: conio.h: No such file or directory 2 | #include<conio.h> | ^~~~~~~~~ compilation terminated.
s703865535
p04029
C++
#include<stdio.h> void main() { int a,b,N; clrscr(); printf("enter a number"); scanf("%d",&N); a=1; b=0; while(a<=N) { b=b+a; a=a+1; } printf("%d",b); getch(); }
a.cc:4:5: error: '::main' must return 'int' 4 | void main() | ^~~~ a.cc: In function 'int main()': a.cc:7:7: error: 'clrscr' was not declared in this scope 7 | clrscr(); | ^~~~~~ a.cc:18:7: error: 'getch' was not declared in this scope; did you mean 'getc'? 18 | getch();...
s691555854
p04029
C++
#include<stdio.h> #include<conio.h> void main() { int a,b,N; clrscr(); scanf("%d",&N); a=1; b=0; while(a<=N) { b=b+a; a=a+1; } printf("%d",b); getch(); }
a.cc:2:13: fatal error: conio.h: No such file or directory 2 | #include<conio.h> | ^~~~~~~~~ compilation terminated.
s213206355
p04029
Java
import java.util.*; class Main{ public static void main(String[] arg){ Scanner stdIn=new Scanner(System.in); int N=stdIn.nextInt(); int total=0; for(int i=1;i<=N;i++){ int total+=i; } System.out.println(total); } }
Main.java:8: error: ';' expected int total+=i; ^ Main.java:8: error: not a statement int total+=i; ^ 2 errors
s129921501
p04029
C
#include<stdio.h> #include<conio.h> void main() { int a,b,N; clrscr(); printf("enter a number"); scanf("%d",&N); a=1; b=0; while(a<=N) { b=b+a; a=a+1; } printf("%d",b); getch(); }
main.c:2:9: fatal error: conio.h: No such file or directory 2 | #include<conio.h> | ^~~~~~~~~ compilation terminated.
s541242780
p04029
C++
#include<stdio.h> #include<conio.h> void main() { int a,b,N; clrscr(); printf("enter a number"); scanf("%d",&N); a=1; b=0; while(a<=N) { b=b+a; a=a+1; } printf("%d",b); getch(); }
a.cc:2:9: fatal error: conio.h: No such file or directory 2 | #include<conio.h> | ^~~~~~~~~ compilation terminated.
s082536167
p04029
C++
#include<stdio.h> void main() { int a,b,N; clrscr(); printf("enter a number"); scanf("%d",&N); a=1; b=0; while(a<=N) { b=b+a; a=a+1; } printf("%d",b); getch(); }
a.cc:2:1: error: '::main' must return 'int' 2 | void main() | ^~~~ a.cc: In function 'int main()': a.cc:5:3: error: 'clrscr' was not declared in this scope 5 | clrscr(); | ^~~~~~ a.cc:16:3: error: 'getch' was not declared in this scope; did you mean 'getc'? 16 | getch(); | ^~~~~ ...
s171726535
p04029
C++
#include<stdio.h> #include<conio.h> void main() { int a,b,N; clrscr(); printf("enter a number"); scanf("%d",&N); a=1; b=0; while(a<=N) { b=b+a; a=a+1; } printf("%d",b); getch(); }
a.cc:2:9: fatal error: conio.h: No such file or directory 2 | #include<conio.h> | ^~~~~~~~~ compilation terminated.
s627488874
p04029
C++
#include <iostream> using namespace std; int main(){ int n; cin << n; cout << (1 + n) * n / 2 << endl; return 0; }
a.cc: In function 'int main()': a.cc:6:7: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 6 | cin << n; | ~~~ ^~ ~ | | | | | int | std::istream {aka std::basic_istream<char>} a.cc:6:7: note: candidate: 'operat...
s445936822
p04029
C++
N=int(input()) ans =0 for i in range(0,N+1): ans+=i print(ans)
a.cc:1:1: error: 'N' does not name a type 1 | N=int(input()) | ^
s843159451
p04029
C++
// #pragma comment(linker, "/stack:200000000") // #pragma GCC optimize("O3") // #pragma GCC optimize("Ofast") // #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") // #pragma GCC optimize("unroll-loops") #include<bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tre...
a.cc: In function 'void dobbysolver(long long int)': a.cc:75:14: error: no match for 'operator<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'long long int') 75 | cout < n*(n + 1) / 2; | ~~~~ ^ ~~~~~~~~~~~~~ | | | | | ...
s543515831
p04029
C++
#include <bits/stdc++.h> using namespace std; int main{ int N; cin>>N; cout<<N*(N+1)/2<<endl; }
a.cc:4:5: error: cannot declare '::main' to be a global variable 4 | int main{ | ^~~~ a.cc:5:3: error: expected primary-expression before 'int' 5 | int N; | ^~~ a.cc:5:3: error: expected '}' before 'int' a.cc:4:9: note: to match this '{' 4 | int main{ | ^ a.cc:6:3: error: '...
s640884794
p04029
C
#include<stdio.h> int main(void) { int n,i,r; scanf("%d",&n); r=0; for(i=1;i<=n;i++) r=r+i; printf("%d",r); return 0; } ~
main.c:18:1: error: expected identifier or '(' before '~' token 18 | ~ | ^
s547865249
p04029
C
#include <stdio.h> 2 int main(void) 3 { 4 int a,b,i; 5 a=0;b=0;i=0; 6 scanf("%d",&a); 7 for(i=0;i<a;i++); 8 b=b+i; 9 10 printf("%d\n",b); 11 return 0; 12 }
main.c:2:3: error: expected identifier or '(' before numeric constant 2 | 2 int main(void) | ^
s039592620
p04029
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef double dd; #define all(v) v.begin(),v.end() #define endl "\n" #define clr(n, r) memset(n,r,sizeof(n)); void fast() { cin.tie(0); cin.sync_with_stdio(0); } ll n, m; int main() { fast(); cin>>n; cout<<(n*(n+1))/2; }#inc...
a.cc:24:2: error: stray '#' in program 24 | }#include <bits/stdc++.h> | ^ a.cc:24:3: error: 'include' does not name a type 24 | }#include <bits/stdc++.h> | ^~~~~~~ a.cc:33:6: error: redefinition of 'void fast()' 33 | void fast() { | ^~~~ a.cc:10:6: note: 'void fast()' previously defin...
s122349654
p04029
C++
#include<iostream> using namespace std; int main(){ int n; cin>>n; cout<<(n*n(n+1))/2; }
a.cc: In function 'int main()': a.cc:6:13: error: 'n' cannot be used as a function 6 | cout<<(n*n(n+1))/2; | ~^~~~~
s199085074
p04029
C++
#include <bits/stdc++.h> int main(){ int n; cin >> n; cout << n*((n+1)/2) <<endl; }
a.cc: In function 'int main()': a.cc:4:16: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 4 | int n; cin >> n; | ^~~ | std::cin In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146, from a.cc:1: /usr/in...
s070306042
p04029
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; cout<<n*(n+1)/2<,endl; }
a.cc: In function 'int main()': a.cc:7:19: error: expected primary-expression before ',' token 7 | cout<<n*(n+1)/2<,endl; | ^
s730911533
p04029
C++
#include <iostream> int n; using namespace std; int main(){ cin >> n; cout <<n*(n+1)/2 }
a.cc: In function 'int main()': a.cc:6:19: error: expected ';' before '}' token 6 | cout <<n*(n+1)/2 | ^ | ; 7 | } | ~
s638188007
p04029
C++
#include <iostream> using namespace std ; int main() { int N ; cin >> N ; int i = 1 ; int sum = 0 ; while( i <= N ){ sum += i ; i++; } cout << sum << \n ; return 0 ; }
a.cc:16:20: error: stray '\' in program 16 | cout << sum << \n ; | ^ a.cc: In function 'int main()': a.cc:16:21: error: 'n' was not declared in this scope 16 | cout << sum << \n ; | ^
s321842800
p04029
C++
#include <bits/stdc++.h> using namespace std; using ll=long long; const ll MOD=1000000007; int main() { int N; cin N; cout << N*(N+1)/2 << endl; }
a.cc: In function 'int main()': a.cc:9:6: error: expected ';' before 'N' 9 | cin N; | ^~ | ;
s675774204
p04029
C++
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int sum = 0; for (i=0; i<n; i++) sum += i+1; cout << sum << endl; }
a.cc: In function 'int main()': a.cc:10:14: error: 'i' was not declared in this scope 10 | for (i=0; i<n; i++) | ^
s793313336
p04029
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N; cin >> N; cout << N(N+1) << endl; }
a.cc: In function 'int main()': a.cc:7:12: error: 'N' cannot be used as a function 7 | cout << N(N+1) << endl; | ~^~~~~
s752910410
p04029
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; class Main { public static void main(String[] args) throws Exception { try { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int N = Int...
Main.java:17: error: non-static method getSum(int) cannot be referenced from a static context int result = getSum(N); ^ 1 error
s186956131
p04029
C++
#include <bits/stdc++.h> using namespace std; int main() { int N: cin >> N; cout << (N*(N+1))/2 << endl; }
a.cc: In function 'int main()': a.cc:5:8: error: found ':' in nested-name-specifier, expected '::' 5 | int N: | ^ | :: a.cc:5:7: error: 'N' has not been declared 5 | int N: | ^ a.cc:6:7: error: qualified-id in declaration before '>>' token 6 | cin >> N; | ...
s973588947
p04029
C++
#include<bits/stdc++.h> using namespace std; int main(int argc, char **argv){ int n,ans; cin>>n; ans=n*(n+1))/2; printf("%d\n",ans); return 0; }
a.cc: In function 'int main(int, char**)': a.cc:6:16: error: expected ';' before ')' token 6 | ans=n*(n+1))/2; | ^ | ;
s364880917
p04029
C++
#include<bits/stdc++.h> using namespace std; int main(void){ int n,ans; cin>>n; ans=n*(n+1))/2; printf("%d\n",ans); return 0; }
a.cc: In function 'int main()': a.cc:6:16: error: expected ';' before ')' token 6 | ans=n*(n+1))/2; | ^ | ;
s792210480
p04029
C++
#include <iostream> #include <string> int main() { std::str s; std::cin >> s; int i; std::str ans = ""; for (i = 0; i < s.size(); i++) { if (s[i] == '0' || s[i] == '1') ans += s[i]; if (s[i] == 'B') ans.pop_back; } std::cout << ans; return 0; }
a.cc: In function 'int main()': a.cc:6:8: error: 'str' is not a member of 'std' 6 | std::str s; | ^~~ a.cc:7:15: error: 's' was not declared in this scope 7 | std::cin >> s; | ^ a.cc:9:8: error: 'str' is not a member of 'std' 9 | std::str ans = ""; | ^~~ a...
s558627131
p04029
C++
#include <iostream> int main() { int N; std::cin >> N; std::out << (1+N)*N/2; return 0; }
a.cc: In function 'int main()': a.cc:7:8: error: 'out' is not a member of 'std'; did you mean 'oct'? 7 | std::out << (1+N)*N/2; | ^~~ | oct
s193204907
p04029
C++
#include <bits/stdc++.h> #define rep(i,a,b) for(int i=a; i< (int)(b); ++i) using namespace std; int main(){ cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; int ans=0; rep(0,1,(n+1))ans+=i; cout << ans << endl; }
a.cc: In function 'int main()': a.cc:12:8: error: expected unqualified-id before numeric constant 12 | rep(0,1,(n+1))ans+=i; | ^ a.cc:2:28: note: in definition of macro 'rep' 2 | #define rep(i,a,b) for(int i=a; i< (int)(b); ++i) | ^ a.cc:12:8: error: expected ';' ...
s645813029
p04029
C++
#include <bits/stdc++.h> #define rep(i,a,b) for(int i=a; i< (int)(b); ++i) using namespace std; int main(){ cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; int ans=0; rep(0,1,(n+1) ans+=i; cout << ans << endl; }
a.cc:18:1: error: unterminated argument list invoking macro "rep" 18 | | ^ a.cc: In function 'int main()': a.cc:12:4: error: 'rep' was not declared in this scope 12 | rep(0,1,(n+1) ans+=i; | ^~~ a.cc:12:7: error: expected '}' at end of input 12 | rep(0,1,(n+1) ans+=i; | ^ a.cc...
s769218563
p04029
C++
#include <bits/stdc++.h> #define rep(i,a,b) for(int i=a; i< (int)(b); ++i) using namespace std; int main(){ cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; int ans=0; rep(0,1,n+1) ans+=i; cout << ans << endl; }
a.cc: In function 'int main()': a.cc:12:8: error: expected unqualified-id before numeric constant 12 | rep(0,1,n+1) ans+=i; | ^ a.cc:2:28: note: in definition of macro 'rep' 2 | #define rep(i,a,b) for(int i=a; i< (int)(b); ++i) | ^ a.cc:12:8: error: expected ';' b...
s745900442
p04029
C
#include <stdio.h> #include <stdlib.h> #include <string.h> #define MAX(a,b) (a > b) ? a : b #define MIN(a,b) (a < b) ? a : b const int inf = 1000000000; // 10^9 int c(int n){ int m; if (n == 0) return 1; // 0! = 1 m = c(n - 1); printf("%d") return n + m; } int main(){ int n;scanf("%d",&n); int a...
main.c: In function 'c': main.c:13:15: error: expected ';' before 'return' 13 | printf("%d") | ^ | ; 14 | return n + m; | ~~~~~~
s748102084
p04029
C
#include <stdio.h> #include <stdlib.h> #include <string.h> #define MAX(a,b) (a > b) ? a : b #define MIN(a,b) (a < b) ? a : b const int inf = 1000000000; // 10^9 int c(int x){ int y if(x == 0)return 1; y = c(x - 1); return x + y; } int main(){ int n;scanf("%d",&n); c(n); printf("%d",&n); return ...
main.c: In function 'c': main.c:10:4: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'if' 10 | if(x == 0)return 1; | ^~ main.c:11:4: error: 'y' undeclared (first use in this function) 11 | y = c(x - 1); | ^ main.c:11:4: note: each undeclared identifier is reported only once...
s221843151
p04029
C++
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef vector<ll> vl; typedef pair<ll, ll> PP; #define rep(i, n) for(ll i = 0; i < ll(n); i++) #define all(v) v.begin(), v.end() bool chmin(ll & a, ll b) { if (b < a) { a = b; return 1; } return 0; } bool chmax(ll & a, ll b) { if (b > a) { a = b;...
a.cc:14:1: error: 'gragh' does not name a type 14 | gragh | ^~~~~
s411015191
p04029
C
#include<stdio.h> int main(void){ double n; int c; scanf("%f", &n); c = (1+n)/2*n; print(c); return 0; }
main.c: In function 'main': main.c:8:3: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration] 8 | print(c); | ^~~~~ | printf
s401302595
p04029
C
#include<stdio.h> int main(void){ double n; int c; scanf("%f", &n); c = (1+n)/2*n; print(c); return 0; }
main.c: In function 'main': main.c:8:3: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration] 8 | print(c); | ^~~~~ | printf
s033904592
p04029
C++
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i = 0; i < (int)(n); ++i) using P = pair<int,int> int main(){ int N; cin >> N; int ans = N * (N + 1) / 2; cout << ans << endl; return 0; }
a.cc:4:11: error: two or more data types in declaration of 'type name' 4 | using P = pair<int,int> | ^~~~~~~~~~~~~
s187311273
p04029
C++
#include <iostream> using namespace std; void main() { cin.tie(0); ios::sync_with_stdio(false); int x; cin >> x; cout << (1 + x) * x / 2 << "\n"; }
a.cc:3:1: error: '::main' must return 'int' 3 | void main() { | ^~~~
s970038056
p04029
C++
#include <iostream> using namespace std; void main() { cin.tie(0); ios::sync_with_stdio(false); int x; cin >> x; cout << (1 + x) * x / 2 << "\n"; }
a.cc:3:1: error: '::main' must return 'int' 3 | void main() { | ^~~~
s857485929
p04029
C++
#include <iostream> using namespace std; int main(){ int n; scanf("%d",&n); printf("%d",n*(n+1)/2) }
a.cc: In function 'int main()': a.cc:6:27: error: expected ';' before '}' token 6 | printf("%d",n*(n+1)/2) | ^ | ; 7 | } | ~
s586721840
p04029
C++
#include <iostream> using namespace std; int main(){ int n; scanf("%d",&n); printf("%d",n*(n+1)/2) }
a.cc: In function 'int main()': a.cc:6:27: error: expected ';' before '}' token 6 | printf("%d",n*(n+1)/2) | ^ | ; 7 | } | ~
s440501600
p04029
Java
import java.util.Scanner; public class MAIN { public static void main(String[] args) { Scanner input = new Scanner (System.in); int angka = input.nextInt(); int sum = 0; for (int a=1;a<=angka;a++){ sum+=a; } System.out.println(sum); } }
Main.java:4: error: class MAIN is public, should be declared in a file named MAIN.java public class MAIN { ^ 1 error
s897903598
p04029
Java
import java.util.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int a = sc.nextInt(); System.out.println( a(a+1)/2 ); } }
Main.java:6: error: cannot find symbol System.out.println( a(a+1)/2 ); ^ symbol: method a(int) location: class Main 1 error
s434664617
p04029
C++
#include <iostream> #include <vector> #include <algorithm> #include <string> #include <map> using namespace std; int main() { int N; cin >> N; cout << (N + 1) * N / 2; << endl; return 0; }
a.cc: In function 'int main()': a.cc:12:34: error: expected primary-expression before '<<' token 12 | cout << (N + 1) * N / 2; << endl; | ^~
s358367247
p04029
Java
public class ABC043A { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(), sum = 0; for (int i = 0; i < N; i++) { sum += i; } System.out.println(sum); sc.close(); } }
Main.java:1: error: class ABC043A is public, should be declared in a file named ABC043A.java public class ABC043A { ^ Main.java:4: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class ABC043A Main.java:4: error: cannot find symbol Sc...
s721658326
p04029
C++
#include<iostream> int main(){ int n; std::cin>>n; std::cout<<n*(n+1)/2<<endl;}
a.cc: In function 'int main()': a.cc:5:23: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 5 | std::cout<<n*(n+1)/2<<endl;} | ^~~~ | std::endl In file included from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/inc...
s159073561
p04029
C++
#include <bits/stdc++.h> using namespace std; int main(){ cin>>N; cout<<N*(N+1)/2<<endl; }
a.cc: In function 'int main()': a.cc:4:8: error: 'N' was not declared in this scope 4 | cin>>N; | ^
s726780855
p04029
C++
#include <bits/stdc++.h> using namespace std; int main(void) { int N; cin >> N; cout << N(N+1)/2 << endl; return 0; }
a.cc: In function 'int main()': a.cc:7:12: error: 'N' cannot be used as a function 7 | cout << N(N+1)/2 << endl; | ~^~~~~
s849988245
p04029
C
#include<stdio.h> int main(){ int i=0; int j=0; int sum=0; scanf("%d",&i); for(j=1;j<i+1;j++){ sum = sum+1; } printf("%d",sum); return 0;
main.c: In function 'main': main.c:11:9: error: expected declaration or statement at end of input 11 | return 0; | ^~~~~~
s492263603
p04029
C
include<stdio.h> int main(){ int i=0; int j=0; int sum=0; scanf("%d",&i); for(j=1;j<i+1;j++){ sum = sum+1; } printf("%d",sum); return 0;
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | include<stdio.h> | ^
s728728433
p04029
C++
#include <bits/std++.h> using namespace std; int main(){ int x; cin >> x; cout << (x*(x+1))/2; return 0; }
a.cc:1:10: fatal error: bits/std++.h: No such file or directory 1 | #include <bits/std++.h> | ^~~~~~~~~~~~~~ compilation terminated.
s398362870
p04029
C++
#include <bits/stdc++.h> using namespace std; int main(){ int x; cin >> x; cout >> (x*(x+1))/2; return 0; }
a.cc: In function 'int main()': a.cc:7:14: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int') 7 | cout >> (x*(x+1))/2; | ~~~~ ^~ ~~~~~~~~~~~ | | | | | int | std::...
s144413034
p04029
C++
#include <bits/std++.h> using namespace std; int main(){ int x; cin >> x; cout >> (x*(x+1))/2; return 0; }
a.cc:1:10: fatal error: bits/std++.h: No such file or directory 1 | #include <bits/std++.h> | ^~~~~~~~~~~~~~ compilation terminated.
s156047419
p04029
C++
#include "bits/stdc++.h" using namespace std; int main() { int i = 0 ; int N; cin >> N; int a; for (i = 0 ; i < N; i++){ a += N; } } cout<<a;
a.cc:13:3: error: 'cout' does not name a type 13 | cout<<a; | ^~~~
s181343086
p04029
C++
#include "bits/stdc++.h" using namespace std; int main() { int i = 0 ; int N; cin >> N; int a; for (i = 0 ; i < N; i++;){ a += N; } } cout<<a;
a.cc: In function 'int main()': a.cc:9:26: error: expected ')' before ';' token 9 | for (i = 0 ; i < N; i++;){ | ~ ^ | ) a.cc:9:27: error: expected primary-expression before ')' token 9 | for (i = 0 ; i < N; i++;){ | ...
s851837033
p04029
C++
#include "bits/stdc++.h" using namespace std; int main() { int i = 0 ; cin >> N; int a; for (i = 0 ; i < N; i++;){ a += N; } } cout<<a;
a.cc: In function 'int main()': a.cc:6:10: error: 'N' was not declared in this scope 6 | cin >> N; | ^ a.cc:8:26: error: expected ')' before ';' token 8 | for (i = 0 ; i < N; i++;){ | ~ ^ | ) a.cc:8:27: error: expected primary-expres...
s918377837
p04029
C++
// ======================================================================================================== // Library // ======================================================================================================== #define _CRT_SECURE_NO_WARNINGS #include <bits/stdc++.h> using namespace std; // competitiv...
a.cc: In function 'int main()': a.cc:31:15: error: 'n' cannot be used as a function 31 | cout << (n(n+1))/2; | ~^~~~~
s733441401
p04029
C
#include <stdio.h> int main(void){ int a,b; scanf("%d",&a); for(i=0;i<a;i++){ b+=i; } }
main.c: In function 'main': main.c:5:7: error: 'i' undeclared (first use in this function) 5 | for(i=0;i<a;i++){ | ^ main.c:5:7: note: each undeclared identifier is reported only once for each function it appears in
s774703629
p04029
Java
import java.util.*; class Main{ public static void main(String[] args){ Scanner scan = new Scanner(System.in); String str = scan.next(); List<String> list = new ArrayList<>(); int j = 0; for(int i = 0; i < str.length(); i++){ if(!(str.charAt(i) == 'B')){ ...
Main.java:11: error: cannot find symbol Syring input = String.valueOf(str.charAt(i)); ^ symbol: class Syring location: class Main Main.java:20: error: incompatible types: String cannot be converted to char char out = list.get(k); ^ 2 errors
s640789471
p04029
Java
import java.util.*; class Main{ public static void main(String[] args){ Scanner scan = new Scanner(System.in); String str = scan.next(); List<char> list = new ArrayList<>(); int j = 0; for(int i = 0; i < str.length(); i++){ if(!(str.charAt(i) == 'B')){ lis...
Main.java:7: error: unexpected type List<char> list = new ArrayList<>(); ^ required: reference found: char 1 error
s882007942
p04029
Java
import java.util.*; class Main{ public static void main(String[] args){ Scanner scan = new Scanner(System.in); String str = scan.next(); ArrayList< character > list = new ArrayList<>(); int j = 0; for(int i = 0; i < str.length(); i++){ if(!(str.charAt(i) == 'B')){ ...
Main.java:7: error: cannot find symbol ArrayList< character > list = new ArrayList<>(); ^ symbol: class character location: class Main Main.java:18: error: cannot find symbol for(int k = 0; k<j; i++){ ^ symbol: variable i location: class Main 2 erro...
s681275889
p04029
Java
import java.util.*; class Main{ public static void main(String[] args){ Scanner scan = new Scanner(System.in); String str = scan.next(); ArrayList<char> list = new ArrayList<>(); int j = 0; for(int i = 0; i < str.length(); i++){ if(!(str.charAt(i) == 'B')){ ...
Main.java:7: error: unexpected type ArrayList<char> list = new ArrayList<>(); ^ required: reference found: char 1 error
s186303255
p04029
Java
import java.util.*; class Main{ public static void main(String[] args){ Scanner scan = new Scanner(System.in); String str = scan.next(); ArrayList<String> list = new ArrayList<>(); int j = 0; for(int i = 0; i < str.length(); i++){ if(!(str.charAt(i) == B)){ ...
Main.java:10: error: cannot find symbol if(!(str.charAt(i) == B)){ ^ symbol: variable B location: class Main Main.java:11: error: incompatible types: char cannot be converted to String list.add(str.charAt(i)); ^ Note: Some messag...
s888869467
p04029
Java
import java.util.* class Main{ public static void main(String[] args){ Scanner scan = new Scanner(System.in); String str = scan.next(); int N = Integer.parseInt(str); int ans = (1 + N)*N/2; System.out.println(ans); } }
Main.java:1: error: ';' expected import java.util.* ^ 1 error
s386188021
p04029
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N;cin>>N; cout<<N(N+1)/2<<endl; }
a.cc: In function 'int main()': a.cc:6:10: error: 'N' cannot be used as a function 6 | cout<<N(N+1)/2<<endl; | ~^~~~~
s479671041
p04029
C++
#include <iostream> #include <iomanip> #include <vector> #include <utility> #include <map> #include <algorithm> #include <queue> #include <cmath> #include <numeric> using namespace std; struct aaa{aaa(){cin.tie(nullptr); ios::sync_with_stdio(false); cout<<fixed<<setprecision(20);};}aaa; template <class T>ostream &oper...
a.cc: In function 'int main()': a.cc:22:32: error: expected ';' before '}' token 22 | cout << n*(n+1)/2 << endl;1 | ^ | ; 23 | 24 | } | ~
s543847907
p04029
C++
#include<iostream> using namepsace std; int main(){ int n; cin>>n; cout<<(n*(n+1))/2; }
a.cc:2:7: error: expected nested-name-specifier before 'namepsace' 2 | using namepsace std; | ^~~~~~~~~ a.cc: In function 'int main()': a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 6 | cin>>n; | ^~~ | std::cin In file included from a.cc:1: /usr/in...
s776200002
p04029
C++
#include <iostream> int main(){ int n; int sum; sum = n * (n + 1) / 2; cout << sum << endl; return 0; }
a.cc: In function 'int main()': a.cc:7:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 7 | cout << sum << endl; | ^~~~ | std::cout In file included from a.cc:1: /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ...
s568377451
p04029
C++
#include <iostream> int main(){ int n; int sum; sum = n * (n + 1) / 2; cout << sum << endl; }
a.cc: In function 'int main()': a.cc:7:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 7 | cout << sum << endl; | ^~~~ | std::cout In file included from a.cc:1: /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ...
s733758615
p04029
C++
#inlclude<bits/stdc++.h> using namespace std; int main(){ int n;cin>>n; int sum = 0; for(int i=1; i<=n; i++) sum+=i; cout<<sum<<endl; }
a.cc:1:2: error: invalid preprocessing directive #inlclude; did you mean #include? 1 | #inlclude<bits/stdc++.h> | ^~~~~~~~ | include a.cc: In function 'int main()': a.cc:4:15: error: 'cin' was not declared in this scope 4 | int n;cin>>n; | ^~~ a.cc:1:1: note: 'std::cin'...
s298793877
p04029
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; int a=0; for(int i=1;i<=n;i++){ a=a+i } cout <<a; }
a.cc: In function 'int main()': a.cc:8:10: error: expected ';' before '}' token 8 | a=a+i | ^ | ; 9 | } | ~
s207631939
p04029
C++
#include <iostream> #include <string> using namespace std; main(){ string s; string a; std::cin >> s; a = 0.5*s(1 + s); cout << a << endl; }
a.cc:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 6 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:15:21: error: no match for 'operator+' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 15 | a = 0.5*s(1 + s); | ...
s539900383
p04029
C
#include <stdio.h> int main(void){ int sum=0,max; scanf("%d",&max); for(counter=1;counter<=max;counter++){ sum+=counter; } printf("%d",&sum); return 0; }
main.c: In function 'main': main.c:5:9: error: 'counter' undeclared (first use in this function) 5 | for(counter=1;counter<=max;counter++){ | ^~~~~~~ main.c:5:9: note: each undeclared identifier is reported only once for each function it appears in
s928109771
p04029
Java
package ProblemSolve; import java.util.Scanner; public class Problem1 { public static void main(String[] args) { int n, sum = 0; Scanner input = new Scanner(System.in); n = input.nextInt(); if (n >= 1 && n <= 100) { for (int i = 1; i <= n; i++) { ...
Main.java:6: error: class Problem1 is public, should be declared in a file named Problem1.java public class Problem1 { ^ 1 error
s829028559
p04029
Java
import java.util.Scanner; { public class Problem1.java { public static void main(String[] args) { int n, sum = 0; Scanner input = new Scanner(System.in); n = input.nextInt(); if (n >= 1 && n <= 100) { for (int i = 1; i <= n; i++) { sum = sum + i; ...
Main.java:3: error: class, interface, enum, or record expected { ^ Main.java:5: error: '{' expected public class Problem1.java { ^ Main.java:28: error: class, interface, enum, or record expected } ^ 3 errors
s366622417
p04029
Java
import java.util.Scanner; public class Problem1.java { public static void main(String[] args) { int n, sum = 0; Scanner input = new Scanner(System.in); n = input.nextInt(); if (n >= 1 && n <= 100) { for (int i = 1; i <= n; i++) { sum = sum + i; ...
Main.java:3: error: '{' expected public class Problem1.java { ^ 1 error
s651055226
p04029
Java
import java.util.Scanner; public class Problem1 { public static void main(String[] args) { int n, sum = 0; Scanner input = new Scanner(System.in); n = input.nextInt(); if (n >= 1 && n <= 100) { for (int i = 1; i <= n; i++) { sum = sum + i; ...
Main.java:3: error: class Problem1 is public, should be declared in a file named Problem1.java public class Problem1 { ^ 1 error
s641844722
p04029
Java
import java.util.Scanner; public class Problem1 { public static void main(String[] args) { int n, sum = 0; Scanner input = new Scanner(System.in); n = input.nextInt(); if (n >= 1 && n <= 100) { for (int i = 1; i <= n; i++) { sum = sum + i; ...
Main.java:3: error: class Problem1 is public, should be declared in a file named Problem1.java public class Problem1 { ^ 1 error
s450048817
p04029
Java
import java.util.Scanner; public class Main { public static void main(String args[]) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); ans=(n*(n+1))/2; System.out.println(ans); sc.close(); } }
Main.java:8: error: cannot find symbol ans=(n*(n+1))/2; ^ symbol: variable ans location: class Main Main.java:9: error: cannot find symbol System.out.println(ans); ^ symbol: variable ans location: class Main 2 errors
s817425024
p04029
Java
import java.util.Scanner public class Main { public static void main(String args[]) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); ans=(n*(n+1))/2; System.out.println(ans); } }
Main.java:1: error: ';' expected import java.util.Scanner ^ 1 error
s849175801
p04029
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; cout << N*(N+1)/2 << endl; ]
a.cc: In function 'int main()': a.cc:8:3: error: expected primary-expression before ']' token 8 | ] | ^ a.cc:8:4: error: expected '}' at end of input 8 | ] | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s292610826
p04029
C
#include<stdio.h> int main(void){ int i,n,sum; scanf("%d",&n); for(i = 1,i <= n,i++) sum += i; printf(sum); return 0; }
main.c: In function 'main': main.c:5:23: error: expected ';' before ')' token 5 | for(i = 1,i <= n,i++) sum += i; | ^ | ; main.c:5:23: error: expected expression before ')' token main.c:6:10: error: passing argument 1 of 'printf' makes pointer from integer w...
s832185743
p04029
C
#include<stdio.h> int main(void){ int i,n,sum; for(i = 1,i <= n,i++) sum += i; printf(sum); return 0; }
main.c: In function 'main': main.c:4:23: error: expected ';' before ')' token 4 | for(i = 1,i <= n,i++) sum += i; | ^ | ; main.c:4:23: error: expected expression before ')' token main.c:5:10: error: passing argument 1 of 'printf' makes pointer from integer w...
s317848646
p04029
C
#include〈stdio.h〉 int main() { int n; int i=0; scanf("%d", &n); i = n * (n + 1) / 2; printf("%d",i ); return 0; }
main.c:1:9: error: #include expects "FILENAME" or <FILENAME> 1 | #include〈stdio.h〉 | ^~ main.c: In function 'main': main.c:6:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 6 | scanf("%d", &n); | ^~~~~ main.c:1:1: note: include '<stdio.h>'...
s446224516
p04029
C++
#include <iostream> #include <vector> #include <iostream> #include <cstdio> #include <map> #include <unordered_map> #include <set> #include <unordered_set> #include <algorithm> #include <cmath> #include <queue> #include <deque> #include <stack> #define ll long long #define pb push_back #define vi vector<int> #define ...
a.cc: In function 'int main()': a.cc:33:16: error: 'n' was not declared in this scope 33 | cin >> n; | ^
s009821614
p04029
C++
using namespace std; int main(){ int n, ans=0; cin >> n; for(int i = 1; i <= n; i++){ ans+=i; } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:5:3: error: 'cin' was not declared in this scope 5 | cin >> n; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | a.cc:9:3: error: 'cout' was not declared in ...
s944281962
p04029
C++
#include <bits.\h++> int main(){ int n, ans=0; cin >> n; for(int i = 1; i <= n; i++){ ans+=i; } cout << ans << endl; }
a.cc:1:10: fatal error: bits.\h++: No such file or directory 1 | #include <bits.\h++> | ^~~~~~~~~~~ compilation terminated.
s259614575
p04029
C++
#include<bits/stdc++.h> using namesapce std; int main() { int n; cin>>n; cout<<n*(n-1)/2<<"\n"; return 0; }
a.cc:2:7: error: expected nested-name-specifier before 'namesapce' 2 | using namesapce std; | ^~~~~~~~~ a.cc: In function 'int main()': a.cc:7:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 7 | cin>>n; | ^~~ | std::cin In file included fr...
s108078365
p04029
Java
package abc043; import java.util.Scanner; public class Abc043 { public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ //スキャナ宣言 Scanner sc = new Scanner(System.in); //子供の人数Nを入力 int N = sc.nextInt(); //N人の子供に対して合計何個のキャンディーがいるかを算出する。 int candySum = 0; for (int i = 1; i <= N; i++) { can...
Main.java:5: error: class Abc043 is public, should be declared in a file named Abc043.java public class Abc043 { ^ 1 error
s783846771
p04029
C++
#include<iostream> using namespace std; int main(){ int n,i,a; cin>>n; for(i=1,i<=n,i++){ a += i; } cout<<a; return 0; }
a.cc: In function 'int main()': a.cc:9:19: error: expected ';' before ')' token 9 | for(i=1,i<=n,i++){ | ^ | ; a.cc:15:3: error: expected primary-expression before 'return' 15 | return 0; | ^~~~~~ a.cc:13:11: error: expected ')' before 'return' 13 | ...