submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s376193051 | p04029 | C++ | #include<iostream>
using namespace std;
int main()
{
int a,j,sm=0;cin>>a;for(j=0;j<=aa;j++)sm+=j;cout<<sm;
}
| a.cc: In function 'int main()':
a.cc:5:32: error: 'aa' was not declared in this scope; did you mean 'a'?
5 | int a,j,sm=0;cin>>a;for(j=0;j<=aa;j++)sm+=j;cout<<sm;
| ^~
| a
|
s216249279 | p04029 | C++ | #include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
using namespace std;
#define int long long
//typedef long long ll;
typede... | a.cc: In function 'int main()':
a.cc:26:8: error: 'n' was not declared in this scope; did you mean 'yn'?
26 | cin >> n;
| ^
| yn
|
s070100660 | p04029 | C++ | include<bits/stdc++.h>
using namespace std;
int main(){
int N;
cin>>N;
int res=0;
for(int i=1;i<=N;i++){
res+=i;
}
cout<<res<<endl;
return 0;
}
| a.cc:1:1: error: 'include' does not name a type
1 | include<bits/stdc++.h>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope
7 | cin>>N;
| ^~~
a.cc:12:9: error: 'cout' was not declared in this scope
12 | cout<<res<<endl;
... |
s870548817 | p04029 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int main{
int n;
cin>>n;
cout<<(n*n+n)/2<<endl;
}
| a.cc:5:5: error: cannot declare '::main' to be a global variable
5 | int main{
| ^~~~
a.cc:6:2: error: expected primary-expression before 'int'
6 | int n;
| ^~~
a.cc:6:2: error: expected '}' before 'int'
a.cc:5:9: note: to match this '{'
5 | int main{
| ^
a.cc:7:2: error: 'ci... |
s537127035 | p04029 | C++ | #include<iostream>
using namespace std;
int main()
{
cin>>n;
cout<<(n+1)*n/2<<endl;
} | a.cc: In function 'int main()':
a.cc:5:6: error: 'n' was not declared in this scope
5 | cin>>n;
| ^
|
s188730408 | p04029 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
cin>>n;
cout<<(n+1)*n/2<<endl;
} | a.cc: In function 'int main()':
a.cc:5:6: error: 'n' was not declared in this scope; did you mean 'yn'?
5 | cin>>n;
| ^
| yn
|
s771167657 | p04029 | C++ | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <string>
#include <utility>
using namespace std;
int main() {
int a;
cin >> a;
cout << 1 / 2 * (a + 1) * a << endl;
return 0;
}
| a.cc:17:1: error: extended character is not valid in an identifier
17 |
| ^
a.cc:17:1: error: '\U00003000' does not name a type
17 |
| ^~
|
s989734406 | p04029 | C | from collections import defaultdict
def main():
print(sum([i for i in range(1, int(input()) + 1)]))
if __name__ == '__main__':
main()
| main.c:1:1: error: unknown type name 'from'
1 | from collections import defaultdict
| ^~~~
main.c:1:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'import'
1 | from collections import defaultdict
| ^~~~~~
main.c:1:18: error: unknown type name 'import'
main.c:8:16... |
s144778477 | p04029 | C++ | int main() {
int N;
cin >> N;
int S = 0;
for (int i = 1; i <= N; i++) {
S += i;
}
cout << S << endl;
} | a.cc: In function 'int main()':
a.cc:3:9: error: 'cin' was not declared in this scope
3 | cin >> N;
| ^~~
a.cc:8:9: error: 'cout' was not declared in this scope
8 | cout << S << endl;
| ^~~~
a.cc:8:22: error: 'endl' was not declared in this scope
8 | cout ... |
s553896157 | p04029 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
cout << n * (n + 1) >> 1;
return 0;
} | a.cc: In function 'int main()':
a.cc:9:30: error: no match for 'operator>>' (operand types are 'std::basic_ostream<char>' and 'int')
9 | cout << n * (n + 1) >> 1;
| ~~~~~~~~~~~~~~~~~~~~ ^~ ~
| | |
| | int
| ... |
s601683775 | p04029 | C++ | package main
import (
"fmt"
)
func main(){
var i int
fmt.Scan(&i)
fmt.Println(int((1 + i) * i /2 ))
} | a.cc:1:1: error: 'package' does not name a type
1 | package main
| ^~~~~~~
|
s491983678 | p04029 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(void){
int n;
cin>>n;
cout<<n(1+n)/2<<endl;
} | a.cc: In function 'int main()':
a.cc:6:12: error: 'n' cannot be used as a function
6 | cout<<n(1+n)/2<<endl;
| ~^~~~~
|
s040331921 | p04029 | C++ |
#include <stdio.h>
void main(void){
int in = 0;
scanf("%d",&in);
int i = 0, count=0;
for(i=0; i<in; i++){
count += i+1;
}
printf("%d\n",count);
return;
} | a.cc:4:1: error: '::main' must return 'int'
4 | void main(void){
| ^~~~
a.cc: In function 'int main()':
a.cc:18:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
18 | return;
| ^~~~~~
|
s300015593 | p04029 | C |
#include <stdio.h>
int main(void){
int in;
scanf("%d", &in);
int i, count;
for(i=0; i<in; i<10){
count += i
}
printf("%d\n",count);
return 1;
} | main.c: In function 'main':
main.c:12:27: error: expected ';' before '}' token
12 | count += i
| ^
| ;
13 | }
| ~
|
s881618527 | p04029 | C++ | #include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <queue>
#include <list>
#include <set>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define all(x) (x).begin(), (x).end()
#define INF 1010101010
#define MOD 1000000... | a.cc:23:37: error: stray '`' in program
23 | cout << (n + 1) * n / 2 << endl;`
| ^
|
s170822341 | p04029 | C++ | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
String s=sc.next();
String m="";
String taihi="";
for(int i=0;i<s.length();i++){
if(s.charAt(i)=='B'){
for(int j=0;j<m.length()-1;j++){
taih... | a.cc:1:3: error: 'import' does not name a type
1 | import java.util.*;
| ^~~~~~
a.cc:1:3: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:3: error: expected unqualified-id before 'public'
2 | public class Main {
| ^~~~~~
|
s560410045 | p04029 | Java | import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n,sum =0;
Scanner sc = new Scanner(System.in);
n = sc.nextInt();
for(int i = 1; i <= n; i++){
sum += i;
}
System.out.println(sum);
}
} | Main.java:6: error: variable sc is already defined in method main(String[])
Scanner sc = new Scanner(System.in);
^
1 error
|
s993906444 | p04029 | Java | import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n,sum =0;
Scanner sc = new Scanner(System.in);
n = sc.nextInt();
for(int i = 1; i <= n; i++){
sum += i;
}
System.out.println(sum); | Main.java:11: error: reached end of file while parsing
System.out.println(sum);
^
1 error
|
s929978458 | p04029 | Java | import java.util.Scanner;
public class main {
private static Scanner sc;
public static void main(String[] args) {
// TODO Auto-generated method stub
sc = new Scanner(System.in);
int N =sc.nextInt();
int z=0;
for(int i =0;i<=N;i++){
z=z+i;
}
System.out.println(z);
}
}
| Main.java:3: error: class main is public, should be declared in a file named main.java
public class main {
^
1 error
|
s666496502 | p04029 | Java | package rimo;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Atcoder {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int N = Integer.parseInt(br.readLine());
int s... | Main.java:7: error: class Atcoder is public, should be declared in a file named Atcoder.java
public class Atcoder {
^
1 error
|
s052543409 | p04029 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(i=0; i<n; i++)
int main(){
int N,cand;
cin>>N;
rep(i,N){
cand*=cand-1;
}
cout<<cand;
} | a.cc: In function 'int main()':
a.cc:8:7: error: 'i' was not declared in this scope
8 | rep(i,N){
| ^
a.cc:3:22: note: in definition of macro 'rep'
3 | #define rep(i,n) for(i=0; i<n; i++)
| ^
|
s202210683 | p04029 | C++ | using System;
public class Test
{
public static void Main()
{
int a = int.Parse(Console.ReadLine());
Console.WriteLine((a * (a+1))/2);
}
} | a.cc:1:7: error: expected nested-name-specifier before 'System'
1 | using System;
| ^~~~~~
a.cc:3:1: error: expected unqualified-id before 'public'
3 | public class Test
| ^~~~~~
|
s903091284 | p04029 | C++ | import java.util.Scanner;
class Hello{
public static void main(String args[]){
// print();
int x ;
Scanner scan = new Scanner(System.in);
x = scan.nextInt();
if(x>100){
return;
}
int sum = 0;
for(int n=1;1 <= n &&n <= x;n++){
sum = sum + n;
}
System.out.println(sum);
}
static void ... | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.Scanner;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:11: error: expected ':' before 'static'
5 | public static void main(String args[]){
| ^~~~~~~
| :
a.cc:5:29: er... |
s297828574 | p04029 | C++ | #include <iostream>
using namespace std;
int main()
{
cin >> n;
cout << n * (n + 1) / 2;
}
| a.cc: In function 'int main()':
a.cc:7:12: error: 'n' was not declared in this scope
7 | cin >> n;
| ^
|
s390257417 | p04029 | C++ | def main():
n = int(input())
print(sum(i for i in range(1, n + 1)))
if __name__ == '__main__':
main()
| a.cc:6:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
6 | if __name__ == '__main__':
| ^~~~~~~~~~
a.cc:1:1: error: 'def' does not name a type
1 | def main():
| ^~~
|
s485987195 | p04029 | C++ | N= int(input())
a=0
for i in range(1,N+1):
a=a+i
print(a)
| a.cc:1:1: error: 'N' does not name a type
1 | N= int(input())
| ^
|
s536769779 | p04029 | C++ |
int array_sum(int* array, const int size) {
int result = 0;
for (int i = 0; i < size; i++) {
result += *(array + i);
}
return result;
}
int main() {
int N = 0;
scanf("%d", &N);
int a[N];
double b_dbl = 0.0;
int b = 0;
int ... | a.cc: In function 'int main()':
a.cc:12:9: error: 'scanf' was not declared in this scope
12 | scanf("%d", &N);
| ^~~~~
a.cc:25:9: error: 'printf' was not declared in this scope
25 | printf("%d\n", result);
| ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>... |
s868866152 | p04029 | C++ | #include<iostream>
using namespace std;
int main()
{
int a;
cin>>a;
cout<<a*(a+1)/2<<endl;
return 0;
} | a.cc:5:1: error: extended character is not valid in an identifier
5 | int a;
| ^
a.cc:5:1: error: extended character is not valid in an identifier
a.cc:6:1: error: extended character is not valid in an identifier
6 | cin>>a;
| ^
a.cc:6:1: error: extended character is not valid in an iden... |
s790614103 | p04029 | C++ | import java.io.*;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws java.io.IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String l = in.readLine();
int N = Integer.parseInt(l);//5
int candy = 0;
... | a.cc:1:1: error: 'import' does not name a type
1 | import java.io.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import java.util.Scanner;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc... |
s063230337 | p04029 | C | N = int(input())
i = 1
answer = 0
while i <= N:
answer += i
i += 1
print(answer) | main.c:1:1: warning: data definition has no type or storage class
1 | N = int(input())
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 'N' [-Wimplicit-int]
main.c:1:5: error: expected expression before 'int'
1 | N = int(input())
| ^~~
|
s476106412 | p04029 | C++ | a2(1<i | a.cc:1:3: error: expected constructor, destructor, or type conversion before '(' token
1 | a2(1<i
| ^
|
s853741682 | p04029 | C++ | s | a.cc:1:1: error: 's' does not name a type
1 | s
| ^
|
s803925374 | p04029 | C++ | a | a.cc:1:1: error: 'a' does not name a type
1 | a
| ^
|
s023973879 | p04029 | C++ | #include <stdio.h>
#include <iostream>
#include <algorithm>
#include <string>
#include <map>
#include <vector>
const long long INF = LLONG_MAX / 2;
#define FOR(i, r, n) for(int i=(r); i<(n); i++)
#define REP(i, n) FOR(i, (0), n)
#define ll long long int
template<typename T>
void remove(std::vector<T>& vector, unsigned... | a.cc:7:23: error: 'LLONG_MAX' was not declared in this scope
7 | const long long INF = LLONG_MAX / 2;
| ^~~~~~~~~
a.cc:7:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
6 | #include <vector>
+++ |+#include <climits>
... |
s330699642 | p04029 | C | #include<stdio.h>
int main(void){
int num;
scanf("%d"&num);
printf("%d",num*(num+1)%2);
return 0;
} | main.c: In function 'main':
main.c:4:13: error: invalid operands to binary & (have 'char *' and 'int')
4 | scanf("%d"&num);
| ~~~~^
| |
| char *
|
s332871026 | p04029 | C | #include<stdio.h>
int main(void){
int num;
scanf("%d"&num);
printf("%d",num*(num+1)%2);
return 0;
} | main.c: In function 'main':
main.c:4:13: error: invalid operands to binary & (have 'char *' and 'int')
4 | scanf("%d"&num);
| ~~~~^
| |
| char *
|
s714845549 | p04029 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string s;
cin >> s;
vector<char> ans;
for(int unsigned i=0;i<s.size();i++){
if(s[i] == 'B'){
ans.size() && ans.pop_back();
continue;
}
ans.emplace_back(s[i]);
}
for(int unsigned i=0;i<ans.size();i++){
cout << ans[i];
}
cout << endl;
re... | a.cc: In function 'int main()':
a.cc:11:51: error: could not convert 'ans.std::vector<char>::pop_back()' from 'void' to 'bool'
11 | ans.size() && ans.pop_back();
| ~~~~~~~~~~~~^~
|
s775495327 | p04029 | C++ | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
solve(s);
s.close();
}
public static void solve(Scanner s) {
int n = s.nextInt();
long ans = 0;
for (int i = 0; i < n; i++) {
ans += i + 1;
}
System.out.println(ans);
}
... | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.Scanner;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
3 | public class Main {
| ^~~~~~
|
s777793692 | p04029 | C++ | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
solve(s);
s.close();
}
public static void solve(Scanner s) {
int n = s.nextInt();
long ans = 0;
for(int i=0; i<n; i++){
ans += i;
}
System.out.println(ans);
}
}
| a.cc:1:1: error: 'import' does not name a type
1 | import java.util.Scanner;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
3 | public class Main {
| ^~~~~~
|
s404973604 | p04029 | C++ | #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
cout << n*(n+1)/2 <<
} | a.cc: In function 'int main()':
a.cc:7:1: error: expected primary-expression before '}' token
7 | }
| ^
|
s289539255 | p04029 | C++ | #include <iostream>
int main() {
int n;
cin >> n;
cout << n(n-1)/2 << endl;
} | a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
5 | 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... |
s415778336 | p04029 | C++ | #include <iostream>
using namespace std;
typedef long long ll;
int main(){
ll a
cin>>a;
if(a%2==0)cout<<(a/2)*(a+1)<<endl;
else cout<<a*(a+1)/2<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:8:3: error: expected initializer before 'cin'
8 | cin>>a;
| ^~~
a.cc:9:6: error: 'a' was not declared in this scope
9 | if(a%2==0)cout<<(a/2)*(a+1)<<endl;
| ^
|
s080937603 | p04029 | C++ | import strutils
let N = stdin.readline.parseInt
echo(N * (N+1) div 2)
| a.cc:1:1: error: 'import' does not name a type
1 | import strutils
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
|
s080111646 | p04029 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(int argc, char const *argv[])
{
int N;
cin >> N;
int res = (N*(N+1))/2
cout << res << endl;
} | a.cc: In function 'int main(int, const char**)':
a.cc:13:9: error: expected ',' or ';' before 'cout'
13 | cout << res << endl;
| ^~~~
|
s460113742 | p04029 | C | #include<stdio.h>
int main(void)
{
int N,i,sum=0;
scanf("%d",&N);
for(i=1;i<=N;i++)
{
sum=sum+i;
}
printf("%d",sum);
rewind(stdin)
getchar();
return 0;
} | main.c: In function 'main':
main.c:12:21: error: expected ';' before 'getchar'
12 | rewind(stdin)
| ^
| ;
13 | getchar();
| ~~~~~~~
|
s654837773 | p04029 | C | #include<stdio.h>
int main(void)
{
int N,i,sum=0;
scanf("%d",&N);
for(i=1;i<=N;i++)
{
sum=sum+i;
}
printf("%d",sum);
rewind(stdin)
getchar ();
return0;
} | main.c: In function 'main':
main.c:12:17: error: expected ';' before 'getchar'
12 | rewind(stdin)
| ^
| ;
13 | getchar ();
| ~~~~~~~
main.c:14:4: error: 'return0' undeclared (first use in this function)
14 | return0;
| ^~~~~~~
main.c... |
s004933427 | p04029 | C++ | #include <iostream>
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:7:20: error: 'n' was not declared in this scope
7 | cout << N*(n+1)/2 << endl;
| ^
|
s950428389 | p04029 | C++ | #include<iostream>
using namespace std;
int main(){
| a.cc: In function 'int main()':
a.cc:4:12: error: expected '}' at end of input
4 | int main(){
| ~^
|
s303529343 | p04029 | Java | import java.util.*;
public class A043{
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:2: error: class A043 is public, should be declared in a file named A043.java
public class A043{
^
1 error
|
s808694303 | p04029 | C | int a,s;
a=10;
for 1:1:10
s=s+1;
end
| main.c:2:1: warning: data definition has no type or storage class
2 | a=10;
| ^
main.c:2:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
main.c:3:1: error: expected identifier or '(' before 'for'
3 | for 1:1:10
| ^~~
main.c:5:1: error: expected '=', ',', ';', 'asm' or '__attr... |
s894971403 | p04029 | Java | package coder;
import java.util.Scanner;
public class Coder {
public static void main(String[] args) {
// TODO code application logic here
int result = 0;
Scanner scanner = new Scanner(System.in);
int input = scanner.nextInt();
for(int i = 1 ; i <= input ; i ++){
... | Main.java:3: error: class Coder is public, should be declared in a file named Coder.java
public class Coder {
^
1 error
|
s068656546 | p04029 | Java | class Coder {
public static void main(String[] args) {
int result = 0;
Scanner scanner = new Scanner(System.in);
int input = scanner.nextInt();
for(int i = 1 ; i <= input ; i ++){
result += i;
}
System.out.print(result);
}
} | Main.java:6: error: cannot find symbol
Scanner scanner = new Scanner(System.in);
^
symbol: class Scanner
location: class Coder
Main.java:6: error: cannot find symbol
Scanner scanner = new Scanner(System.in);
^
symbol: class Scanner
location: class Coder
... |
s482985578 | p04029 | Java | int result = 0;
Scanner scanner = new Scanner(System.in);
int input = scanner.nextInt();
for(int i = 1 ; i <= input ; i ++){
result += i;
}
System.out.print(result); | Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
int result = 0;
^
(use --enable-preview to enable unnamed classes)
Main.java:4: error: class, interface, enum, or record expected
for(int i = 1 ; i <= input ; i ++){
^
Main.java:4: error: class, interface, enum, or ... |
s195834773 | p04029 | Java |
package coder;
import java.util.Scanner;
public static void main(String[] args) {
// TODO code application logic here
int result = 0;
Scanner scanner = new Scanner(System.in);
int input = scanner.nextInt();
for(int i = 1 ; i <= input ; i ++){
result += i;
... | Main.java:6: 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:14: error: reached end of file while parsing
System.out.print(result);
... |
s375033315 | p04029 | Java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package coder;
import java.util.Scanner;
/**
*
* @author thanhtuan
*/
public class Coder {
public static void main(String[] a... | Main.java:14: error: class Coder is public, should be declared in a file named Coder.java
public class Coder {
^
1 error
|
s324611206 | p04029 | Java | import java.util.Scanner;
public class Coder {
public static void main(String[] args) {
int result = 0;
Scanner scanner = new Scanner(System.in);
int input = scanner.nextInt();
for(int i = 1 ; i <= input ; i ++){
result += i;
}
System.out.print(result);
... | Main.java:2: error: class Coder is public, should be declared in a file named Coder.java
public class Coder {
^
1 error
|
s314422059 | p04029 | C++ | #include <iostream>
int main() {
| a.cc: In function 'int main()':
a.cc:3:13: error: expected '}' at end of input
3 | int main() {
| ~^
|
s745722140 | p04029 | Java | class candySum{
public static void main(String args[])
int student_num = 0;
int candy_sun = 0;
for(student_num=0;student_num<N; student_num++){
candySum = candySum + 1;
}
System.out.println(candySum);
} | Main.java:1: error: illegal character: '\uff5b'
class candySum?
^
Main.java:2: error: illegal character: '\uff3b'
public static void main(String args??)
^
Main.java:2: error: illegal character: '\uff3d'
public static void main(String args??)
... |
s690286660 | p04029 | Java | class candySum{
public static void main(String args[])
int student_num = 0;
int candy_sun = 0;
for(student_num=0 ,student_num<N, student_num++){
candySum = candySum + 1;
}
System.out.println(candySum);
} | Main.java:1: error: illegal character: '\uff5b'
class candySum?
^
Main.java:2: error: illegal character: '\uff3b'
public static void main(String args??)
^
Main.java:2: error: illegal character: '\uff3d'
public static void main(String args??)
... |
s425871376 | p04029 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.io.*;
public class ChildrenCandies{
public static void main(String args[]){
try{
BufferedReader br = new BuffredReader(new InputStreamReader(System.in));
String str = br.r... | Main.java:7: error: class ChildrenCandies is public, should be declared in a file named ChildrenCandies.java
public class ChildrenCandies{
^
Main.java:10: error: cannot find symbol
BufferedReader br = new BuffredReader(new InputStreamReader(System.in));
^
symbol: class Buf... |
s757139221 | p04029 | Java | import java.io.*;
public class ChildrenCandies{
public static void main(String args[]){
try{
BufferedReader br = new BuffredReader(new InputStreamReader(System.in));
String str = br.readLine();
int N = Integer.parseInt(str);
int h = 0;
while(N > 0){
h = h + N;
N--;
... | Main.java:3: error: class ChildrenCandies is public, should be declared in a file named ChildrenCandies.java
public class ChildrenCandies{
^
Main.java:6: error: cannot find symbol
BufferedReader br = new BuffredReader(new InputStreamReader(System.in));
^
symbol: class Buff... |
s390443954 | p04029 | C++ | n = int(input())
print( n*(n+1)//2 )
| a.cc:1:1: error: 'n' does not name a type
1 | n = int(input())
| ^
|
s498672122 | p04029 | Java | import java.util.Scanner;
public class test1 {
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
int n = Integer.parseInt(sc.next());
System.out.println((1 + n) * n / 2);
}
} | Main.java:3: error: class test1 is public, should be declared in a file named test1.java
public class test1 {
^
1 error
|
s848436450 | p04029 | C++ | #include<iostream>
#include<string>
using namespace std;
int main()
{
string s,result;
cin >> s;
for(int i = 0;i < strlen(s.c_str()); i++)
{
if(s[i] != 'B')
{
result += s[i];
}
else
{
result.pop_back();
}
}
cout << result << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:21: error: 'strlen' was not declared in this scope
8 | for(int i = 0;i < strlen(s.c_str()); i++)
| ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include<iostream>
... |
s536046341 | p04029 | C++ | #include<iostream>
#include<string>
using namespace std;
int main()
{
string s,result;
cin >> s;
for(int i = 0;i < strln(s.c_str()); i++)
{
if(s[i] != 'B')
{
result += s[i];
}
else
{
result.pop_back();
}
}
cout << result << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:21: error: 'strln' was not declared in this scope
8 | for(int i = 0;i < strln(s.c_str()); i++)
| ^~~~~
|
s213392325 | p04029 | C++ | #include<iostream>
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:7:12: error: 'n' cannot be used as a function
7 | cout << n(n + 1)/2 << endl;
| ~^~~~~~~
|
s639277681 | p04029 | C++ | #include<iostream>
using namespace std;
int mian()
{
int n;
cin >> n;
cout << n(n + 1)/2 << endl;
return 0;
} | a.cc: In function 'int mian()':
a.cc:7:12: error: 'n' cannot be used as a function
7 | cout << n(n + 1)/2 << endl;
| ~^~~~~~~
|
s788369315 | p04029 | C++ | #include<iostream>
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:13: error: expected ';' before '}' token
8 | return 0
| ^
| ;
9 | }
| ~
|
s125954751 | p04029 | C++ | puts (a = $stdin.gets.chomp.to_i)*(a + 1) / 2 | a.cc:1:6: error: expected constructor, destructor, or type conversion before '(' token
1 | puts (a = $stdin.gets.chomp.to_i)*(a + 1) / 2
| ^
|
s864485368 | p04029 | C++ | #include<iostream>
using namespace std;
int main(int argc, char const *argv[]) {
int n,sum;
sum=0;
cin>>n;
for(i=1;i<n+1;i++){
sum+=i;
}
cout<<sum;
return 0;
}
| a.cc: In function 'int main(int, const char**)':
a.cc:10:7: error: 'i' was not declared in this scope
10 | for(i=1;i<n+1;i++){
| ^
|
s155260971 | p04029 | C++ | #include<iostream>
using namespace std;
int int main(int argc, char const *argv[]) {
int n,sum;
sum=0;
cin>>n;
for(i=1;i<n+1;i++){
sum+=i;
}
cout<<sum;
return 0;
}
| a.cc:4:1: error: two or more data types in declaration of 'main'
4 | int int main(int argc, char const *argv[]) {
| ^~~
|
s540676551 | p04029 | C | #include <iostream>
#define sqr(n) (n)*(n)
#define min(a,b) a<b?a:b
using namespace std;
int main(void){
int n,a[100],w;
long long s,ans=10000000000;
cin>>n;
for(int i=0;i<n;i++)
cin>>a[i];
for(w=-100;w<=100;w++){
s=0;
for(int j=0;j<n;j++)
s+=sqr(a[j]-w);
ans=min(ans,s);
}
cout<<ans<... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s182740403 | p04029 | Java | import java.util.*;
public class Main {
public static void main(String[] args){
Scanner s = new Scanner(System.in);
int x = s.nextInt();
System.out.println(n*(n+1)/2);
}
} | Main.java:9: error: cannot find symbol
System.out.println(n*(n+1)/2);
^
symbol: variable n
location: class Main
Main.java:9: error: cannot find symbol
System.out.println(n*(n+1)/2);
^
symbol: variable n
location: class Main
2 errors
|
s711591591 | p04029 | Java | import java.util.*;
public class Main {
public static void main(String[] args){
Scanner s = new Scanner(System.in);
int x = s.nextInt();
return n*(n+1)/2;
}
} | Main.java:9: error: incompatible types: unexpected return value
return n*(n+1)/2;
^
Main.java:9: error: cannot find symbol
return n*(n+1)/2;
^
symbol: variable n
location: class Main
Main.java:9: error: cannot find symbol
return n*(n+1)/2;
^
symbol: varia... |
s324140808 | p04029 | Java | import java.util.*
public class Main {
public static void main(String[] args){
Scanner s = new Scanner(System.in);
int x = s.nextInt();
return n*(n+1)/2;
}
} | Main.java:1: error: ';' expected
import java.util.*
^
1 error
|
s797000773 | p04029 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Candy {
public static void main(String[] args)throws IOException{
// TODO 自動生成されたメソッド・スタブ
int sum=0;
InputStreamReader is = new InputStreamReader(System.in);
BufferedReader reader = new BufferedReader(i... | Main.java:5: error: class Candy is public, should be declared in a file named Candy.java
public class Candy {
^
1 error
|
s568314821 | p04029 | C | #include <stdio.h>
int main (void)
{
int N;
scanf("%d",N);
pirntf("%d",N*(N+1)*(1/2));
return 0;
}
| main.c: In function 'main':
main.c:7:9: error: implicit declaration of function 'pirntf'; did you mean 'printf'? [-Wimplicit-function-declaration]
7 | pirntf("%d",N*(N+1)*(1/2));
| ^~~~~~
| printf
|
s287650753 | p04029 | C++ | #include <bits/stdc++.h>
#define EPS 1e-9
#define INF 1070000000LL
#define MOD 1000000007LL
#define fir first
#define foreach(it,X) for(auto it=(X).begin();it!=(X).end();it++)
#define numa(x,a) for(auto x: a)
#define ite iterator
#define mp make_pair
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<(n);i+... | a.cc: In function 'int main()':
a.cc:38:11: error: 'N' was not declared in this scope
38 | cout << N * (N+1) / 2 << endl;
| ^
|
s384782167 | 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:27: 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:... |
s159736700 | p04029 | C++ | #include <iostream>
int main() {
int n;
cin>>n;
cout<<n * (n+1) /2 <<endl;
} | a.cc: In function 'int main()':
a.cc:4:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
4 | cin>>n;
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard in... |
s035128562 | p04029 | Java | import java.util.Scanner;
public class ABC43_A{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
System.out.println(n*(n+1)/2);
}
} | Main.java:3: error: class ABC43_A is public, should be declared in a file named ABC43_A.java
public class ABC43_A{
^
1 error
|
s450751929 | p04029 | C | #include <stdio.h>
int main(){
int num_children
scanf("%d", &num_children);
int count = num_children;
int sum = 0;
while(count > 0){
sum += count--;
}
printf("%d",sum);
return 0;
} | main.c: In function 'main':
main.c:5:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanf'
5 | scanf("%d", &num_children);
| ^~~~~
main.c:5:22: error: 'num_children' undeclared (first use in this function)
5 | scanf("%d", &num_children);
| ... |
s941746568 | p04029 | C++ | int main()
{
cin >> N;
cout << N * (N+1) / 2 << endl;
} | a.cc: In function 'int main()':
a.cc:4:9: error: 'cin' was not declared in this scope
4 | cin >> N;
| ^~~
a.cc:4:16: error: 'N' was not declared in this scope
4 | cin >> N;
| ^
a.cc:6:9: error: 'cout' was not declared in this scope
6 | cout << N * (... |
s079733840 | p04029 | Java | package abc_043;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main4 {
// 連続した部分文字列がkの長さをもつとすると
// aa
// a*a
// のどちらかしか存在しない。このパターンを使わないということはa**a**q...と繰り返すことになるがこの方法では条件をみたすことはないからである
// テスト
// asdfghjklaa : 最後だけ
// faewasdfala
// qwertyuioaa
// a... | Main.java:7: error: class Main4 is public, should be declared in a file named Main4.java
public class Main4 {
^
1 error
|
s632773151 | p04029 | C++ | #include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include ... | a.cc: In function 'int main()':
a.cc:42:24: error: 'endk' was not declared in this scope
42 | cout << n*(n+1)/2 << endk;
| ^~~~
|
s267711456 | p04029 | C++ | #include <iostream>
int main() {
int a;
cin >> a;
cout << a * (a -1 ) /2;
} | a.cc: In function 'int main()':
a.cc:5:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
5 | cin >> a;
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard ... |
s702191122 | p04029 | C | #include<stdio.h>
#include <stdlib.h>
int main() {
char s[11];
char r[11];
//char buf[64];
int i,j,k;
scanf_s("%s", s, 11);
for (i = 0, j=0; s[i] != '\0'; i++) {
//fgets(buf, 64, stdin);
if (s[i] == 'B') {
j--;
if (j < 0) j = 0;
}
else {
r[j] = s[i];
j++;
}
}
for (k = 0, r[j] = '\0'; k <... | main.c: In function 'main':
main.c:9:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
9 | scanf_s("%s", s, 11);
| ^~~~~~~
| scanf
|
s345800713 | p04029 | C++ | #include<stdio.h>
#include <stdlib.h>
int main() {
char s[11];
char r[11];
char buf[64];
int i,n,j,dummy,k;
scanf_s("%s", s, 11);
for (n = 0; s[n] != '\0'; n++);
for (i = 0, j=0; s[i] != '\0'; i++) {
fgets(buf, 64, stdin);
if (s[i] == 'B') {
j--;
}
else {
r[j] = s[i];
j++;
}
for (k = 0,... | a.cc: In function 'int main()':
a.cc:12:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
12 | scanf_s("%s", s, 11);
| ^~~~~~~
| scanf
|
s255875871 | p04029 | C | #include <stdio.h>
int main{
int N;
printf("子供の人数=");
scanf("%d",&N);
printf("必要なキャンディの個数は%d個です",(N+1)*N/2);
return 0;
} | main.c:3:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
3 | int main{
| ^
|
s534771384 | p04029 | C | #include stdio.h
int main{
int N;
printf("子供の人数=");
scanf("%d",&N);
printf("必要なキャンディの個数は%d個です",(N+1)*N/2);
return 0;
} | main.c:1:10: error: #include expects "FILENAME" or <FILENAME>
1 | #include stdio.h
| ^~~~~
main.c:3:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
3 | int main{
| ^
|
s761978949 | p04029 | C | #include<stdio.h>
#include <string.h>
#include <stdlib.h>
int main()
{
char S[11];
char S2[11];
int i;
int j;
int len;
scanf("%s",S);
len = strlen( s );
j = 0;
for (i=0; i < len; i++) {
if (S[i] == 0) {
j = j + 1;
... | main.c: In function 'main':
main.c:15:23: error: 's' undeclared (first use in this function)
15 | len = strlen( s );
| ^
main.c:15:23: note: each undeclared identifier is reported only once for each function it appears in
main.c:34:1: error: expected declaration or statement at en... |
s807008823 | p04029 | C | #include<stdio.h>
#include <string.h>
#include <stdlib.h>
int main()
{
int n;
int i;
int sum;
scanf("%d",&n);
for (i=0; i < n; i++) {
j = i + 1;
sum = sum + 1;
}
printf("%d\n",sum);
return 0;
} | main.c: In function 'main':
main.c:14:12: error: 'j' undeclared (first use in this function)
14 | j = i + 1;
| ^
main.c:14:12: note: each undeclared identifier is reported only once for each function it appears in
|
s427067577 | p04029 | C++ | N = int(raw_input())
print N * ( N + 1 ) / 2 | a.cc:1:1: error: 'N' does not name a type
1 | N = int(raw_input())
| ^
|
s589591280 | p04029 | Java | import java.util.Scanner;
/**
* Created by wild on 16/08/13.
*/
public class one {
public static void main (String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int result = 0;
for (int i = 0; i < n; i++){
result += 1 + i;
}
System... | Main.java:6: error: class one is public, should be declared in a file named one.java
public class one {
^
1 error
|
s022881437 | p04029 | C++ | using System;
class A {
static void Main() {
var n = int.Parse(Console.ReadLine());
var a = 0;
for(int i = 1;i <= n;i++) {
a += i;
}
Console.WriteLine(a);
}
}
| a.cc:1:7: error: expected nested-name-specifier before 'System'
1 | using System;
| ^~~~~~
a.cc:12:2: error: expected ';' after class definition
12 | }
| ^
| ;
a.cc: In static member function 'static void A::Main()':
a.cc:5:17: error: 'var' was not declared in this scope
5 | ... |
s630645131 | p04029 | Java | package vtor;
import java.util.*;
public class First {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
sc.close();
long value = (N * N + N)/2;
System.out.println(value);
}
}
| Main.java:5: error: class First is public, should be declared in a file named First.java
public class First {
^
1 error
|
s946110862 | p04029 | Java | import java.util.*;
import java.io.*;
public class Main {
int[] a;
void solve() {
int N = sc.nextInt();
int ans;
for (int i = 1; i < N+1; i++) {
ans += i;
}
System.out.println(ans);
}
void print(int[] a) {
out.print(a[0]);
for (int i = 1; i < a.length; i++) out.print(" " + a[i]);
out.... | Main.java:12: error: variable ans might not have been initialized
ans += i;
^
Main.java:15: error: variable ans might not have been initialized
System.out.println(ans);
^
2 errors
|
s706700454 | p04029 | C++ | #include<stdio.h>
int main() {
int n,i,sum=0;
scanf_s("%d",&n);
for (i = 1; i <= n; i++) sum += i;
printf("%d\n",sum);
return 0;
} | a.cc: In function 'int main()':
a.cc:5:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
5 | scanf_s("%d",&n);
| ^~~~~~~
| scanf
|
s987618633 | p04029 | Java | /**
* Created by abhishek on 8/4/2016.
*/
import java.util.*;
import java.io.*;
public class C {
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(br.readLine());
System.out.println(n... | Main.java:6: error: class C is public, should be declared in a file named C.java
public class C {
^
1 error
|
s481106262 | p04029 | C++ | a =map(int,input())
s=0
for i in range(a+1):
s+=i
print(s) | a.cc:1:1: error: 'a' does not name a type
1 | a =map(int,input())
| ^
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.