submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s341392620
p04029
C
#include<stdio.h> int main(){ int n; scanf("%d",&n); printf("%d",n*(n+1)/2;); return 0; }
main.c: In function 'main': main.c:5:24: error: expected ')' before ';' token 5 | printf("%d",n*(n+1)/2;); | ~ ^ | )
s433489636
p04029
C++
#include<bits/sdc++.h> using namespace std; int main() { int N; cin >> N; int ans; for(int i=1; i<=N; i++) ans+=i; cout << ans << endl; }
a.cc:1:9: fatal error: bits/sdc++.h: No such file or directory 1 | #include<bits/sdc++.h> | ^~~~~~~~~~~~~~ compilation terminated.
s746487682
p04029
C++
#include <iostream> #include <string> using namespace std; int main() { int N; int A = 0; cin >> N; for (int i = 0, i < N, i++){ A == A + i; } cout << A << endl; }
a.cc: In function 'int main()': a.cc:9:20: error: expected ';' before '<' token 9 | for (int i = 0, i < N, i++){ | ^~ | ; a.cc:9:21: error: expected primary-expression before '<' token 9 | for (int i = 0, i < N, i++){ | ^ a.cc:9:29:...
s985287503
p04029
C++
#include <iostream> #include <string> using namespace std; int main() { int N; int A = 0; cin >> N; for ( i = 0, i < N, i++){ A == A + i; } cout << A << endl; }
a.cc: In function 'int main()': a.cc:9:9: error: 'i' was not declared in this scope 9 | for ( i = 0, i < N, i++){ | ^ a.cc:13:1: error: expected primary-expression before '}' token 13 | } | ^ a.cc:12:21: error: expected ')' before '}' token 12 | cout << A << endl; | ...
s004210620
p04029
C++
#include <iostream> #include <string> using namespace std; int main() { int N; int A = 0; cin >> N; for ( i = 0, i < N, 1++){ A == A + i; } cout << A << endl; }
a.cc: In function 'int main()': a.cc:9:9: error: 'i' was not declared in this scope 9 | for ( i = 0, i < N, 1++){ | ^ a.cc:9:23: error: lvalue required as increment operand 9 | for ( i = 0, i < N, 1++){ | ^ a.cc:13:1: error: expected primary-expression before '}' to...
s175776585
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 sum; for (int i = 1; i <= n; i++) { sum += i; } System.out.println(sum); ...
Main.java:10: error: variable sum might not have been initialized sum += i; ^ Main.java:14: error: variable sum might not have been initialized System.out.println(sum); ^ 2 errors
s574279378
p04029
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner scan = new Scanner(System.in); int a = scan.nextInt(); int p =0; for(int i = 1;i<=0;i++){ p+=i; } System.out.println(p); }
Main.java:12: error: reached end of file while parsing } ^ 1 error
s993875826
p04029
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; int sum(int x){ int s; s = n+sum(n-1); return s; } cout << sum(n) <<endl;
a.cc: In function 'int main()': a.cc:6:17: error: a function-definition is not allowed here before '{' token 6 | int sum(int x){ | ^ a.cc:11:11: error: 'sum' was not declared in this scope 11 | cout << sum(n) <<endl; | ^~~ a.cc:11:25: error: expected '}' at end of input ...
s854427103
p04029
C++
#include <bits/stdc++.h> using namespace std; int main() { int n,t; t =0 cin >> n; for(int i=0;i <n ;i++){ t = t + i + 1; } cout << t <<endl; }
a.cc: In function 'int main()': a.cc:6:7: error: expected ';' before 'cin' 6 | t =0 | ^ | ; 7 | cin >> n; | ~~~
s562047959
p04029
C++
#include <bits/stdc++.h> using namespace std; int main() { int n,t; cin >> n; for(int i=0;i <n ;i++){ t = t + i + 1 } cout << t <<endl; }
a.cc: In function 'int main()': a.cc:8:18: error: expected ';' before '}' token 8 | t = t + i + 1 | ^ | ; 9 | } | ~
s012810779
p04029
C++
#include <bits/stdc++.h> using namespace std; int main() { int n,t; cin >> n; for(int i=0;i <N ;i++){ t = t + i + 1 } cout << t <<endl; }
a.cc: In function 'int main()': a.cc:7:18: error: 'N' was not declared in this scope 7 | for(int i=0;i <N ;i++){ | ^ a.cc:8:18: error: expected ';' before '}' token 8 | t = t + i + 1 | ^ | ; 9 | } | ~
s652476240
p04029
C++
N = int(input()) sum = 0 for i in range(1,N+1): sum = sum + i print(sum)
a.cc:1:1: error: 'N' does not name a type 1 | N = int(input()) | ^
s675515556
p04029
C++
#include <bits/std++.h> using namespace std; int main() { int n; cin >> n; int answer=0; for(int i=1;i<=n;i++) { answer+=i; } cout << answer << endl; return 0; }
a.cc:1:10: fatal error: bits/std++.h: No such file or directory 1 | #include <bits/std++.h> | ^~~~~~~~~~~~~~ compilation terminated.
s843344708
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(); int can= 0; for(int i = 1; i <= n; i++) { can += i; } System.out.println(can) } }
Main.java:11: error: ';' expected System.out.println(can) ^ 1 error
s878094095
p04029
C++
int main(){ int n; cin >> n; int ans = (1 + n) * n / 2; cout << ans; }
a.cc: In function 'int main()': a.cc:3:5: error: 'cin' was not declared in this scope 3 | cin >> n; | ^~~ a.cc:5:5: error: 'cout' was not declared in this scope 5 | cout << ans; | ^~~~
s565964645
p04029
C++
#include<bits/stdc++.h> using namespace std; #define REP(i, n) for(int i = 0; i < (int)n; i++) const int MOD = 1000000007; // long long a; int main(){ int a; cin >> a; cout << N*(N + 1)/2 << endl; }
a.cc: In function 'int main()': a.cc:9:11: error: 'N' was not declared in this scope 9 | cout << N*(N + 1)/2 << endl; | ^
s171675535
p04029
C++
#include <bits/stdc++.h> using namespace std; int main() { int a: cin >> a; cout << (1+a)*a/2; }
a.cc: In function 'int main()': a.cc:6:3: error: expected initializer before 'cin' 6 | cin >> a; | ^~~ a.cc:7:14: error: 'a' was not declared in this scope 7 | cout << (1+a)*a/2; | ^
s694042632
p04029
C++
#include <bits/stdc++.h> using namespace std; int main() { int a: cin >> a; cout << (1+a)*a/2;
a.cc: In function 'int main()': a.cc:6:3: error: expected initializer before 'cin' 6 | cin >> a; | ^~~ a.cc:7:14: error: 'a' was not declared in this scope 7 | cout << (1+a)*a/2; | ^ a.cc:7:21: error: expected '}' at end of input 7 | cout << (1+a)*a/2; | ...
s110367565
p04029
C++
#include <vector> using namespace std; int main() { int n; cin >> n; cout << (n * (n + 1)) / 2 << endl; }
a.cc: In function 'int main()': a.cc:7:9: error: 'cin' was not declared in this scope 7 | cin >> n; | ^~~ a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 1 | #include <vector> +++ |+#include <iostream> 2 | a.cc:8...
s715587503
p04029
C++
#include <iostream> #include <cstdio> #include <algorithm> #include <cmath> #include <string> #include <vector> #include <list> #include <set> #include <map> #include <queue> #include <stack> #include <cctype> #include <climits> #include <bitset> using namespace std; typedef long double ld; typedef long long int ll; ty...
a.cc: In function 'int main()': a.cc:44:10: error: 'n' cannot be used as a function 44 | cout << n(n+1)/2 << endl; | ~^~~~~
s122581685
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:10: error: 'N' cannot be used as a function 7 | cout<<N(N+1)/2<<endl; | ~^~~~~
s439285415
p04029
C++
#include <bits/stdc++.h> using namespace std; // 0 ~ nの総和を求める int sum(int N) { if (N == 0) { // sum0のケースを場合分け return 0; } // それ以外のケース int s = sum(N - 1); // 1~(n-1)の総和を計算 return s + N; // nを足して返す } int main() { cout << sum(N) << endl; // 6 }
a.cc: In function 'int main()': a.cc:17:15: error: 'N' was not declared in this scope 17 | cout << sum(N) << endl; // 6 | ^
s512479350
p04029
C++
#include <bits/stdc++.h> using namespace std; // 0 ~ nの総和を求める int sum(int n) { if (n == 0) { // sum0のケースを場合分け return 0; } // それ以外のケース int s = sum(n - 1); // 1~(n-1)の総和を計算 return s + n; // nを足して返す cout << sum(n) << endl; // 6 }
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s583433277
p04029
C++
#include <bits/stdc++.h> using namespace std; // 0 ~ nの総和を求める int sum(int n) { if (n == 0) { // sum0のケースを場合分け return 0; } // それ以外のケース int s = sum(n - 1); // 1~(n-1)の総和を計算 return s + n; // nを足して返す } int main() { cout << sum(n) << endl; // 6 }
a.cc: In function 'int main()': a.cc:17:15: error: 'n' was not declared in this scope; did you mean 'yn'? 17 | cout << sum(n) << endl; // 6 | ^ | yn
s257256405
p04029
C++
using System; namespace helloVS { class Program { static void Main(string[] args) { int n = int.Parse(Console.ReadLine()); int ans = n * (n + 1) * (2 * n + 1) / 6; Console.WriteLine("{0}\n", ans); } } }
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:7:26: error: 'string' has not been declared 7 | static void Main(string[] args) | ^~~~~~ a.cc:7:35: error: expected ',' or '...' before 'args' 7 | static...
s207345051
p04029
C++
#include<cstring> #include<cstdio> int main(){ char key[100]; char s[100]; int x = 0; scanf("%s", key); for(int i=0; i>strlen(key); i++){ if(key[i] == "B"){ if(x != 0){ x--; } else{ s[x] = key[i]; x++; } } } printf("%s", s); return 0; }
a.cc: In function 'int main()': a.cc:10:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 10 | if(key[i] == "B"){ | ~~~~~~~^~~~~~
s537391516
p04029
C++
#include<cstdio> using namespace std; int main() { int n; scanf("%d", &n); int x; for(int i = 1; i <= n; i++){ x = i++; } printf("%d", x); return 0;
a.cc: In function 'int main()': a.cc:16:12: error: expected '}' at end of input 16 | return 0; | ^ a.cc:4:1: note: to match this '{' 4 | { | ^
s323721083
p04029
C++
#include<cstdio> using namespace std; int main() { int n; scanf("%d", &n); int x; for(int i = 1; i <= N; i++){ x = i++; } printf("%d", x); return 0; }
a.cc: In function 'int main()': a.cc:11:23: error: 'N' was not declared in this scope 11 | for(int i = 1; i <= N; i++){ | ^
s881201118
p04029
C++
#include<iostream> using namespace std; int main() { int N; cin >> N; int x = 0; for(int i = 1; i >= N; i++){ x = i++ } return x; }
a.cc: In function 'int main()': a.cc:12:12: error: expected ';' before '}' token 12 | x = i++ | ^ | ; 13 | } | ~
s301103369
p04029
C++
#include<iostream> using namespace std; int main() { int N; cin >> N; int x = 0; for(i = 1; i >= N; i++){ x = i++ } return x; }
a.cc: In function 'int main()': a.cc:11:7: error: 'i' was not declared in this scope 11 | for(i = 1; i >= N; i++){ | ^
s943469524
p04029
C++
#include <algorithm> #include <iostream> #include <string> using namespace std; int main() { int a, b; cin >> a >> b >> c; //a = 5; //b = 0; for (int i = 1; i <= a; i++) { b += i * 2; } cout << b << endl; }
a.cc: In function 'int main()': a.cc:7:20: error: 'c' was not declared in this scope 7 | cin >> a >> b >> c; | ^
s223778985
p04029
C++
#include <bits/stdc++.h> using namespace std; int main(){ int a; cin>>a; cout<<((1+a)*a)/2)<<endl; }
a.cc: In function 'int main()': a.cc:6:20: error: expected ';' before ')' token 6 | cout<<((1+a)*a)/2)<<endl; | ^ | ;
s096434096
p04029
C++
#include <bits/stdc++.h> int main(){ int a; cin>>a; cout<<((1+a)*a)/2)<<endl; }
a.cc: In function 'int main()': a.cc:4:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 4 | cin>>a; | ^~~ | 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::c...
s173906311
p04029
C++
#include <bits/stdc++.h< int main(){ int a; cin>>a; cout<<((1+a)*a)/2)<<endl; }
a.cc:1:25: error: missing terminating > character 1 | #include <bits/stdc++.h< | ^ a.cc:1:10: fatal error: bits/stdc++.h<: No such file or directory 1 | #include <bits/stdc++.h< | ^ compilation terminated.
s891307982
p04029
C++
#include<bits/t\stdc++.h> using namespace std; int main(void){ int n; cin >> n; cout << (1+n)*n/2 << endl; }
a.cc:1:9: fatal error: bits/t\stdc++.h: No such file or directory 1 | #include<bits/t\stdc++.h> | ^~~~~~~~~~~~~~~~~ compilation terminated.
s026388883
p04029
C++
#include <stdio.h>int main () {int N; scanf("%d", &N); printf("%d\n", N*(N+1)/2);}
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);} | ^~~~ 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(...
s329835379
p04029
Java
public class Main { public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ Scanner sc = new Scanner(System.in); int n = Integer.parseInt(sc.next()); int sum=0; for(int i=1; i<n+1; i++) { sum += i; } System.out.print(sum); } }
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 2 errors
s680300971
p04029
C++
#include<iostream> #include<string> #include<typeinfo> #include<vector> #include<algorithm> #include<map> #include<iomanip> typedef long long int ll; using namespace std; int main() { int n; cin >> n; int ans; for(int i=1; i<=n; i++){ ans += i; } cout << i << endl; return 0; }
a.cc: In function 'int main()': a.cc:18:17: error: 'i' was not declared in this scope 18 | cout << i << endl; | ^
s529940946
p04029
Java
import java.util.*; public class Main{ public static void main(String[]args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); ans = 0; for(int i = 0; i < N; i++){ ans += i; } System.out.println(ans); } }
Main.java:7: error: cannot find symbol ans = 0; ^ symbol: variable ans location: class Main Main.java:9: error: cannot find symbol ans += i; ^ symbol: variable ans location: class Main Main.java:11: error: cannot find symbol System.out.println(ans); ^ symbol:...
s512488035
p04029
C++
#include<iostream> using namespace std; int main() { int n,sum; cin << n; for(int i=0; i<n;i++) { sum += n+1; } cout >> sum >>endl; }
a.cc: In function 'int main()': a.cc:5:7: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 5 | cin << n; | ~~~ ^~ ~ | | | | | int | std::istream {aka std::basic_istream<char>} a.cc:5:7: note: candidate: 'operat...
s607207406
p04029
C++
#include <iostream> #include <cstdio> using namespace std; int main(){ int N; cin >> N; printf(N(N+1)/2); }
a.cc: In function 'int main()': a.cc:8:11: error: 'N' cannot be used as a function 8 | printf(N(N+1)/2); | ~^~~~~
s709197380
p04029
C++
#include <bits/stdc++.h> #include <stdio.h> #include<iostream> #include<cstdio> #include<bitset> #include<algorithm> #include<vector> #include<list> #include<queue> #include<stack> #include<string> #include<string.h> #include<cmath> #include<utility> #include<functional> #include<map> #include<set> #include<cctype> #in...
a.cc: In function 'int main()': a.cc:161:13: error: no match for 'operator-' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int') 161 | cout<<N*(N-1)/2<<endl; | ~^~ | | | | | int | std::string {aka std::__cxx11::basi...
s236878268
p04029
C
#include<stdio.h> int main(){ int n; scanf("%d", &n); int ans = &n*(&n-1); printf("%d", ans); return 0; }
main.c: In function 'main': main.c:8:17: error: invalid operands to binary * (have 'int *' and 'int *') 8 | int ans = &n*(&n-1); | ~~^~~~~~~ | | | | int * int *
s827462270
p04029
C++
#include<bits/stdc++.h> using namespace std; int main(){
a.cc: In function 'int main()': a.cc:4:12: error: expected '}' at end of input 4 | int main(){ | ~^
s997118500
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 sum=0; for(i=1;i>=n;i++){ sum=sum+i; } System.out.println(sum); } }
Main.java:9: error: cannot find symbol for(i=1;i>=n;i++){ ^ symbol: variable i location: class Main Main.java:9: error: cannot find symbol for(i=1;i>=n;i++){ ^ symbol: variable i location: class Main Main.java:9: error: cannot find symbol for(i=1;i>=n;i++)...
s957373256
p04029
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N; cin>>N; int c=0 for(int count=0;count<N;count++){ c++; } cout<<c<<endl; }
a.cc: In function 'int main()': a.cc:9:3: error: expected ',' or ';' before 'for' 9 | for(int count=0;count<N;count++){ | ^~~ a.cc:9:19: error: parse error in template argument list 9 | for(int count=0;count<N;count++){ | ^~~~~~~ a.cc:9:19: error: statement cannot resolve add...
s227755701
p04029
C++
#include <iostream> using namespace std; int main(void){ int n; cin >> n; for(int i=1; i<=n; i++){ int sum = 0; sum += i; } cout<<sum<<endl; return 0; }
a.cc: In function 'int main()': a.cc:11:11: error: 'sum' was not declared in this scope 11 | cout<<sum<<endl; | ^~~
s088333392
p04029
C++
#include <bits/stdc++.h> #include <numeric> #include<iostream> #include<vector> #include<algorithm> using namespace std; int main(){ int n; cin >> n; cout << (n(n+1))/2 << endl; }
a.cc: In function 'int main()': a.cc:11:15: error: 'n' cannot be used as a function 11 | cout << (n(n+1))/2 << endl; | ~^~~~~
s259325642
p04029
C++
#include <iostream> class ANChildrenAndCandiesABCEdit { public: void solve(std::istream& in, std::ostream& out) { int t; in >> t; out << t*(t+1)/2 << std::endl; } };
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s279843685
p04029
C++
#include<stdio.h> int main(){ int a; scanf("%d",&a); printf("%d"(a+1)*a/2); }
a.cc: In function 'int main()': a.cc:5:16: error: expression cannot be used as a function 5 | printf("%d"(a+1)*a/2); | ~~~~^~~~~
s985759080
p04029
C++
include<stdio.h> int main(){ int a; scanf("%d",&a); printf("%d"(a+1)*a/2); }
a.cc:1:1: error: 'include' does not name a type 1 | include<stdio.h> | ^~~~~~~
s055661018
p04029
C++
#include <iostream> #include <algorithm> #include <math.h> #include <stdio.h> using namespace std; int main(){ int n; cin>>n; int gokei - 0; for(int i=1; i<=n; i++){ gokei += i; } cout<<gokei<<endl; return 0; }
a.cc: In function 'int main()': a.cc:10:15: error: expected initializer before '-' token 10 | int gokei - 0; | ^ a.cc:12:9: error: 'gokei' was not declared in this scope 12 | gokei += i; | ^~~~~ a.cc:14:11: error: 'gokei' was not declared in this scope 14 | cou...
s668607591
p04029
C
#include<stdio.h> int fact(int n); int main(void){ int i; scanf("%d",&i); printf("%d",fact(i)); return 0; } int fact(int n){ if (n==0){ return ; }else{ return(n*fact(n-1)); }
main.c: In function 'fact': main.c:14:5: error: 'return' with no value, in function returning non-void [-Wreturn-mismatch] 14 | return ; | ^~~~~~ main.c:12:5: note: declared here 12 | int fact(int n){ | ^~~~ main.c:17:1: error: expected declaration or statement at end of input 17 | } ...
s136904354
p04029
C
#include<stdio.h> int main(void){ int a,i=0,res=0); for(i<=a;i++){ res +=i; } printf("%d",res); }
main.c: In function 'main': main.c:3:18: error: expected ',' or ';' before ')' token 3 | int a,i=0,res=0); | ^ main.c:4:15: error: expected ';' before ')' token 4 | for(i<=a;i++){ | ^ | ;
s607544510
p04029
C
#include <stdio.h> int main(void) { int n,i,sum=0; scanf("%d",&n); for(i=1;i<=a;i++)sum+=i; printf("%d",sum); return 0; }
main.c: In function 'main': main.c:6:16: error: 'a' undeclared (first use in this function) 6 | for(i=1;i<=a;i++)sum+=i; | ^ main.c:6:16: note: each undeclared identifier is reported only once for each function it appears in
s644510797
p04029
C
#include<stdio.h> int main(void){ int n,t,res=0; scanf("%d",&n); for(t=0,t<=n,t++)res += t; printf("%d",res); return 0; }
main.c: In function 'main': main.c:5:19: error: expected ';' before ')' token 5 | for(t=0,t<=n,t++)res += t; | ^ | ; main.c:5:19: error: expected expression before ')' token
s269572732
p04029
C
#include<stdio.h> int main(void){ int n,t,res; scanf("%d\n",&n); res=0; for(t=0,t<=n,t++)res += t; printf("%d\n",&res); return 0; }
main.c: In function 'main': main.c:6:19: error: expected ';' before ')' token 6 | for(t=0,t<=n,t++)res += t; | ^ | ; main.c:6:19: error: expected expression before ')' token
s607253655
p04029
C
#include<stdio.h> int main(void){ int n,res; scanf("%d\n",&n); res=0; for(t==0,t<=n,t++){ res += t; } printf("%d\n",&res); return 0; }
main.c: In function 'main': main.c:6:7: error: 't' undeclared (first use in this function) 6 | for(t==0,t<=n,t++){ | ^ main.c:6:7: note: each undeclared identifier is reported only once for each function it appears in main.c:6:20: error: expected ';' before ')' token 6 | for(t==0,t<=n,t++){ ...
s428926946
p04029
C++
v#include<stdio.h> #include<stdlib.h> #include<iostream> #include<string> #include<algorithm> #include<vector> #include<limits> #include<numeric> #include<type_traits> #include<math.h> using namespace std; typedef long long ll; #define rep(i, n) for(int i = 0; i < (int)(n); i++) #define repi(i,a,b) for(int i = (int)(...
a.cc:1:2: error: stray '#' in program 1 | v#include<stdio.h> | ^ a.cc:1:1: error: 'v' does not name a type 1 | v#include<stdio.h> | ^ In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, ...
s677513762
p04029
C++
#include<iostream> using namespace std; int main(){ int a,ans=0; cin>>a; for(a;a>0,a--)ans+=a; cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:6:16: error: expected ';' before ')' token 6 | for(a;a>0,a--)ans+=a; | ^ | ;
s191749657
p04029
C++
#include <iostream> using namespace std; int main(){ int N, ans; cin >> N; ans = N (N + 1) / 2; cout << ans << endl; }
a.cc: In function 'int main()': a.cc:6:11: error: 'N' cannot be used as a function 6 | ans = N (N + 1) / 2; | ~~^~~~~~~
s561313071
p04029
C++
#include <bits/stdc++.h> using namespace std; int main() { int n; int sum = 0; cin >> n; for (int i = 0; i < n; i++) { sum += (i+1); } cout >> sum >> endl; return 0; }
a.cc: In function 'int main()': a.cc:12:8: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int') 12 | cout >> sum >> endl; | ~~~~ ^~ ~~~ | | | | | int | std::ostream {aka std::basic_ostream<char>} a.cc:12:8: note: ...
s190015247
p04029
C++
#include <bits/stdc++.h> using namespace std; int main() { int ddd; cin >> ddd ; int aaa; aaa=(ddd*(ddd +1))/2 cout <<aaa << endl; }
a.cc: In function 'int main()': a.cc:8:23: error: expected ';' before 'cout' 8 | aaa=(ddd*(ddd +1))/2 | ^ | ; 9 | cout <<aaa << endl; | ~~~~
s822880507
p04029
C++
#include <iostream> int main() { int N; cin >> N; cout << (1+N)*N / 2 << endl; return 0; }
a.cc: In function 'int main()': a.cc:3:10: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 3 | int N; cin >> N; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ...
s644974765
p04029
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, result = 0; cin >> N; while(N > 0){ result += N; N-- } cout << result << endl; }
a.cc: In function 'int main()': a.cc:10:8: error: expected ';' before '}' token 10 | N-- | ^ | ; 11 | } | ~
s747601465
p04029
C++
#include <iostream> using namespace std; int main (){ int n,sum =0; cin>> n; for(int i = 1;i<=n;i++)sum+=i; cout<<i<<endl; return 0; }
a.cc: In function 'int main()': a.cc:11:9: error: 'i' was not declared in this scope 11 | cout<<i<<endl; | ^
s975897627
p04029
C++
#include <iostream> int main() { int n; cin >> n; int sum = n * (n + 1) * 1 / 2; cout << sum << endl; }
a.cc: In function 'int main()': a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 6 | cin >> n; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to sta...
s617325801
p04029
C++
#include<iostream> #include<algorithm> #include<string> #include<vector> #include<queue> #include<map> #include<math.h> #define rep(i,a,n) for(int (i)=(a);(i)<(n);(i)++) #define rrep(i,a,n) for(int (i)=(a);(i)>=(n);(i)--) #define INF 10000000 typedef long long ll; using namespace std; double euclid_distance(doubl...
a.cc: In function 'void solve()': a.cc:83:14: error: 'n' cannot be used as a function 83 | cout << n(n+1)/2; | ~^~~~~
s960124568
p04029
C++
#include <bits;stdc++.h> using namespace std; int main(){ int N,sum; sum = 0; cin >> N; for(int i = 0; i < N;i++){ sum += i + 1; } cout << sum << endl; }
a.cc:1:10: fatal error: bits;stdc++.h: No such file or directory 1 | #include <bits;stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s592019473
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:12: error: 'N' cannot be used as a function 8 | cout << N(N+1)/2 << endl; | ~^~~~~
s386167978
p04029
Java
import java.util.*; public class Main { public static void main(String[] args) { int count = new Scanner(System.in).nextInt(); int total = 0; for (int ix = 1; ix <= count; ix++) { total += ix; } System.out.println(ix); } }
Main.java:12: error: cannot find symbol System.out.println(ix); ^ symbol: variable ix location: class Main 1 error
s972330798
p04029
C++
#include <iostream> #include <vector> #include <unordered_set> #include <string> #include <algorithm> using namespace std; int main() { int n; cin >> n; cout << (n + (n + 1)) / 2 << end; }
a.cc: In function 'int main()': a.cc:13:35: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>') 13 | cout << (n + (n + 1)) / 2 << end; | ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~ In file included from /usr/include/c++/14/iostream:41...
s250534465
p04029
C
#include<stdio.h> #include<string.h> int main(void){ int A,B,C,D,E,N,M,x,y,cou=0,cou2,v[1000000],w[1000000],min_i,en=0; char S[20],W[100],s[10],X,Y; scanf("%d",&A); for(int i=1;i<=A;i++){ cou+=i; } printf("%d",i); return 0; }
main.c: In function 'main': main.c:10:16: error: 'i' undeclared (first use in this function) 10 | printf("%d",i); | ^ main.c:10:16: note: each undeclared identifier is reported only once for each function it appears in
s544771354
p04029
C++
#include <vector> #include <list> #include <map> #include <set> #include <queue> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #include <cstdio> #include <cmath> #include <cst...
a.cc: In function 'int main()': a.cc:47:41: error: 'num' was not declared in this scope; did you mean 'sum'? 47 | sum += (ar[i] - num)*(ar[i] - num); | ^~~ | sum
s642316690
p04029
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N; cin >> N; cout << ((N + 1) * N) / 2 << endl; } }
a.cc:9:1: error: expected declaration before '}' token 9 | } | ^
s207113100
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:6:29: 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/iostream:41, from...
s880759544
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:7: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 5 | std:cin >> n; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< L...
s512672222
p04029
C++
#include <bits/stdc++.h> using namespace std; long n,k; long a[100000001]; int main() { cin>>n; cout<<(n+1)*n/2;5 }
a.cc: In function 'int main()': a.cc:8:20: error: expected ';' before '}' token 8 | cout<<(n+1)*n/2;5 | ^ | ; ...... 11 | } | ~
s930162239
p04029
C++
#include <bits/c++.h> using namespace std; int main(){ int n; cin>>n; cout<<(n*(n+1)/2); }
a.cc:1:10: fatal error: bits/c++.h: No such file or directory 1 | #include <bits/c++.h> | ^~~~~~~~~~~~ compilation terminated.
s946616591
p04029
C++
#include <bits/stdc++.h> using namespace std; int main() { int n; cin>>n; cout<<n(n+1)/2; }
a.cc: In function 'int main()': a.cc:7:10: error: 'n' cannot be used as a function 7 | cout<<n(n+1)/2; | ~^~~~~
s309071342
p04029
C++
N = int(input()) from operator import add from functools import reduce ans = reduce(add, range(N)) + N print(ans) print()
a.cc:2:1: error: 'N' does not name a type 2 | N = int(input()) | ^
s481081663
p04029
C++
#include<bits.stdc++.h> using namespace std; int main(){int n;cin>>n;cout<<n*(n+1)/2;}
a.cc:1:9: fatal error: bits.stdc++.h: No such file or directory 1 | #include<bits.stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s604481126
p04029
C++
#include<iostream> using namespace std; int main(void) { int n = 0,ans = 0; cin << n; for(int i = 1;i <= n;i++) { ans += i; } cout >> ans; return 0; }
a.cc: In function 'int main()': a.cc:7:7: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 7 | cin << n; | ~~~ ^~ ~ | | | | | int | std::istream {aka std::basic_istream<char>} a.cc:7:7: note: candidate: 'operat...
s006118267
p04029
C++
#include <iostream> #include <algorithm> #include <math.h> #include <string> using namespace std; int main(){ double A,B, C, D,E,F; long long int Aa[10000000] = {}; string S,Sa,Sb,Sc; cin >> A; if(A % 2 == 0)cout << (A + 1) * (A / 2) << endl; else cout << A * (A / 2 + 1) ...
a.cc: In function 'int main()': a.cc:11:14: error: invalid operands of types 'double' and 'int' to binary 'operator%' 11 | if(A % 2 == 0)cout << (A + 1) * (A / 2) << endl; | ~ ^ ~ | | | | | int | double
s586524515
p04029
C++
#include <iostream> using namespace std; using uint = unsigned int; using ll = long long; using ull = unsigned long long; #include <string> #include <cstdio> #include <algorithm> #include <vector> #include <cmath> #include <climits> #include <bitset> #include <array> #include <deque> #include <queue> #include <map> #d...
a.cc: In function 'int main()': a.cc:31:12: error: 'N' was not declared in this scope 31 | cin >> N; | ^
s526531058
p04029
C++
#include <iostrem> #include <algorithm> using namespace std; int main(){ int n; cin>>n; cout<<n*(n+1)/2<<endl; return 0; }
a.cc:1:10: fatal error: iostrem: No such file or directory 1 | #include <iostrem> | ^~~~~~~~~ compilation terminated.
s288542600
p04029
C++
N=input() S=N(N+1)//2 print(S)
a.cc:1:1: error: 'N' does not name a type 1 | N=input() | ^
s553537699
p04029
C++
#include<iostream> using namespace std; int main(){ int n; cin>>n; y=n(n+1)/2; cout<<y<<endl; return 0; }
a.cc: In function 'int main()': a.cc:7:3: error: 'y' was not declared in this scope 7 | y=n(n+1)/2; | ^ a.cc:7:6: error: 'n' cannot be used as a function 7 | y=n(n+1)/2; | ~^~~~~
s345791348
p04029
C++
#include <bits/stdc++.h> #define repd(i,a,b) for (int i=(a);i<(b);i++) #define rep(i,n) repd(i,0,n) typedef long long ll; using namespace std; const int MOD = 1000000007; const int INF = 1010000000; const double EPS = 1e-10; int h,w,x; char s[1000][1000]; bool visited [1000][1000]; pair<int,int> start,goal; queue<pair...
a.cc: In function 'int main()': a.cc:25:14: error: 'n' was not declared in this scope 25 | cout << (1+n)*n/2; | ^
s766355730
p04029
C++
#include <bits/stdc++.h> using namespace std; int main() { int H; cin >> H; int Q=H for (int i=0;i<H;i++){ Q += Q--;} cout << Q << endl; }
a.cc: In function 'int main()': a.cc:8:3: error: expected ',' or ';' before 'for' 8 | for (int i=0;i<H;i++){ | ^~~ a.cc:8:16: error: 'i' was not declared in this scope 8 | for (int i=0;i<H;i++){ | ^
s796004795
p04029
C++
#include<iostream> #include<algorithm> #include<math.h> #include<queue> #include<string> #include<vector> #include<tuple> #include<stack> #include<iomanip> #include<map> using namespace std; int main() { string s; int i,n; cin >> s; n=strlen (s); i = 0; while (s[i] == 'B') { s[i] ='2'; i++; } int j; for (...
a.cc: In function 'int main()': a.cc:17:11: error: 'strlen' was not declared in this scope 17 | n=strlen (s); | ^~~~~~ a.cc:11:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 10 | #include<map> +++ |+#include <cstring> 11 | u...
s686480559
p04029
C++
#include<iostream> using namespace std; int main(void) { int n; cin >> n; int a=0; for(int i = 1; i <= n i++) a += i; cout << a << endl; }
a.cc: In function 'int main()': a.cc:10:24: error: expected ';' before 'i' 10 | for(int i = 1; i <= n i++) a += i; | ^~ | ;
s074672516
p04029
C++
#pragma comment(linker, "/stack:20000000") #pragma GCC optimize("Ofast") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx") #include<bits/stdc++.h> /*#include<ext/pb_ds/assoc_container.hpp> #include<ext/pb_ds/tree_policy.hpp> #include<ext/pb_ds/detail/standard_policies.hpp>*/ #define sz(s) (int)(s.size()) ...
a.cc: In function 'int32_t main()': a.cc:40:24: error: no match for 'operator>>' (operand types are 'std::basic_ostream<char>' and 'int') 40 | cout << n*(n+1)>>1; | ~~~~~~~~~~~~~~~^~~ | | | | | int | std::basic_ostream...
s226080163
p04029
C
#include <stdio.h> int main() { int n; scanf("%d",&n); printf("%d",((n*(n+1))/2); return 0; }
main.c: In function 'main': main.c:6:34: error: expected ')' before ';' token 6 | printf("%d",((n*(n+1))/2); | ~ ^ | ) main.c:7:18: error: expected ';' before '}' token 7 | return 0; | ^ | ...
s062780193
p04029
C
#include <stdio.h> int main() { int n; scanf("%d",&n); printf("%d",((n*(n+1))/2); return 0; }
main.c: In function 'main': main.c:5:23: error: expected ';' before '\U0000ff1b' 5 | scanf("%d",&n); | ^~ | ; main.c:8:1: error: expected declaration or statement at end of input 8 | } | ^
s353218269
p04029
C
#include <stdio.h> int main() { int n; scanf("%d"); printf("%d",((n*(n+1))/2); return 0; }
main.c: In function 'main': main.c:5:20: error: expected ';' before '\U0000ff1b' 5 | scanf("%d"); | ^~ | ; main.c:8:1: error: expected declaration or statement at end of input 8 | } | ^
s630274499
p04029
C++
#include <bits/stdc++.h> using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(0); int a; cout << n*(1+n)/2 << endl; return 0; }
a.cc: In function 'int main()': a.cc:9:13: error: 'n' was not declared in this scope 9 | cout << n*(1+n)/2 << endl; | ^
s841709278
p04029
C
#include<cstdio> int main () { int n=0,sum=0; scanf("%d",&n); while(1<=n<=100) n=n+1; sum=(n+1)*n/2; printf("%d\n",sum); }
main.c:1:9: fatal error: cstdio: No such file or directory 1 | #include<cstdio> | ^~~~~~~~ compilation terminated.
s959818540
p04029
C
#include<stdio.h> int main() { int x=0,sum=0,a=0,b=0; scanf("%d,%d,%d",&a,&x,&b); while (x<a) x=x+1; b=x; 1<=b<=100 sum=(b+1)*b/2; printf("%d\n",sum); }
main.c: In function 'main': main.c:9:23: error: expected ';' before 'sum' 9 | 1<=b<=100 | ^ | ; 10 | sum=(b+1)*b/2; | ~~~
s044250718
p04029
C
#include<stdio.h> int main() { int x=0,sum=0,a=0,b=0; scanf("%d,%d,%d",&a,&x,&b); while (x<a) x=x+1; b=x; 1<=b<=100 sum=(b+1)*b/2; printf("sum=%d\n",sum); }
main.c: In function 'main': main.c:9:24: error: expected ';' before 'sum' 9 | 1<=b<=100 | ^ | ; 10 | sum=(b+1)*b/2; | ~~~