submission_id
stringlengths 10
10
| problem_id
stringlengths 6
6
| language
stringclasses 3
values | code
stringlengths 1
522k
| compiler_output
stringlengths 43
10.2k
|
|---|---|---|---|---|
s166802661
|
p04029
|
C++
|
#include<stdio.h>
int main(){
int i,p,n,sum=0;
scanf("%d",n)
for(i=1;i<=n;i++)
{
p=i+1;
sum=sum+p;
}
printf("%d\n",sum);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:4:22: error: expected ';' before 'for'
4 | scanf("%d",n)
| ^
| ;
5 | for(i=1;i<=n;i++)
| ~~~
a.cc:5:21: error: expected ';' before ')' token
5 | for(i=1;i<=n;i++)
| ^
| ;
|
s972154550
|
p04029
|
C++
|
#include<stdoio.h>
int main(){
int i,p,n,sum=0;
scanf("%d",n)
for(i=1;i<=n;i++)
{
p=i+1;
sum=sum+p;
}
printf("%d\n",sum);
return 0;
}
|
a.cc:1:9: fatal error: stdoio.h: No such file or directory
1 | #include<stdoio.h>
| ^~~~~~~~~~
compilation terminated.
|
s611466104
|
p04029
|
C++
|
#include<stdoio.h>
int main(){
int i,p,n,sum;
scanf("%d",n)
for(i=1;i<=n;i++)
{
p=i+1;
sum=sum+p;
}
printf("%d\n",sum);
return 0;
}
|
a.cc:1:9: fatal error: stdoio.h: No such file or directory
1 | #include<stdoio.h>
| ^~~~~~~~~~
compilation terminated.
|
s431994861
|
p04029
|
C++
|
#include <stdio.h>
int main()
{
int i=0,n=0;
scanf ("%d",&n);
for (i=1;i <= n;i++)
{int sum=0;
sum=sum+i;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:6:14: error: expected ';' before '\U0000ff08'
6 | scanf ("%d",&n);
| ^~~
| ;
a.cc:7:13: error: expected '(' before '\U0000ff08i'
7 | for (i=1;i <= n;i++)
| ^~~
| (
a.cc:7:13: error: '\U0000ff08i' was not declared in this scope
7 | for (i=1;i <= n;i++)
| ^~~
a.cc:7:29: error: expected ')' before '\U0000ff09'
7 | for (i=1;i <= n;i++)
| ~~~ ^~
| )
a.cc:7:29: error: '\U0000ff09' was not declared in this scope
7 | for (i=1;i <= n;i++)
| ^~
|
s827298375
|
p04029
|
C
|
#include <stdio.h>
int main(){
int i, N;
int sum=0;
scanf("%d", &N);
if(N>=1&&N<=100)
{
for(i=;i<=N;i++)
sum+=i;
}
printf("%d\n",sum);
return 0;
}
|
main.c: In function 'main':
main.c:10:15: error: expected expression before ';' token
10 | for(i=;i<=N;i++)
| ^
|
s637847091
|
p04029
|
Java
|
import java.util.*;
class Main{
public static void main(string[] args){
Scanner sc=new Scanner(System.in);
int unko=sc.nextInt();
System.out.println(unko*(unko+1)/2);
}
}
|
Main.java:4: error: cannot find symbol
public static void main(string[] args){
^
symbol: class string
location: class Main
1 error
|
s607415478
|
p04029
|
Java
|
import java.util.*;
class Main(){
public static void main(string[] args){
Scanner sc=new Scanner(System.in);
int unko=sc.nextInt();
System.out.println(unko*(unko+1)/2);
}
}
|
Main.java:3: error: '{' expected
class Main(){
^
1 error
|
s406973122
|
p04029
|
C
|
#include<stdio.h>
void main()
{
int n,sum,i;
int i=1;
int sum=0;
printf("please put n:");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
sum=sum+i;
}
printf("%d\n",sum);
}
|
main.c: In function 'main':
main.c:5:6: error: redeclaration of 'i' with no linkage
5 | int i=1;
| ^
main.c:4:12: note: previous declaration of 'i' with type 'int'
4 | int n,sum,i;
| ^
main.c:6:6: error: redeclaration of 'sum' with no linkage
6 | int sum=0;
| ^~~
main.c:4:8: note: previous declaration of 'sum' with type 'int'
4 | int n,sum,i;
| ^~~
|
s139398303
|
p04029
|
C++
|
#include<stdio.h>
#include<stdlib.h>
int main(){
int N,n,sum;
scanf("%d",&N);
sum=0;
for(n=1;n<=N;n=n+1)
{sum=sum+n;
}
printf("Sum is %d.\n",sum)
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:35: error: expected ';' before 'return'
10 | printf("Sum is %d.\n",sum)
| ^
| ;
11 | return 0;
| ~~~~~~
|
s827105209
|
p04029
|
C++
|
#include<stdio.h>
#include<stdlib.h>
int main(void){
int N,n,sum;
scanf("%d",&N);
sum=0;
for(n=1;n<=N;n=n+1)
{sum=sum+n;
}
printf("Sum is %d.\n",sum);
return 0;
|
a.cc: In function 'int main()':
a.cc:11:14: error: expected '}' at end of input
11 | return 0;
| ^
a.cc:3:15: note: to match this '{'
3 | int main(void){
| ^
|
s528182220
|
p04029
|
C++
|
#include<stdio.h>
#include<stdlib.h>
int main() {
int N, n, sum;
printf("请输入孩子数量N\n");
scanf_s("%d",&N);
sum = 0;
for (n = 1; n <= N; n = n + 1) {
sum = sum + n;
}
printf("Sum is %d.\n", sum);
system("pause");
return 0;
}
|
a.cc: In function 'int main()':
a.cc:6:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
6 | scanf_s("%d",&N);
| ^~~~~~~
| scanf
|
s619528479
|
p04029
|
C++
|
#include<stdio.h>
#include<stdlib.h>
int main(void){
int N,n,sum;
scanf("%d",&N);
{sum=0;
for(n=1;n<=N;n=n+1)
{sum=sum+n;
}
printf(" %d.\n",sum);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:13:10: error: expected '}' at end of input
13 | }
| ^
a.cc:3:15: note: to match this '{'
3 | int main(void){
| ^
|
s566049658
|
p04029
|
C++
|
#! /usr/bin/python3
# A - キャンディーとN人の子供イージー / Children and Candies (ABC Edit)
"""
問題文
競プロ幼稚園にはN人の子供がいます。
えび先生は、子供たちを一列に並べ、
一人目にはキャンディーを1個,二人目には2個,...,
N人目にはN個あげることにしました。
必要なキャンディーの個数の合計は何個でしょう?
制約
1 ≦ N ≦ 100
入力
入力は以下の形式で標準入力から与えられる。
N
出力
必要なキャンディーの個数の合計を出力せよ。
"""
test_mode = True
N = int(input()) # 人数
candy = 0 # キャンディーの個数
for i in range(N): # 一人ずつキャンディーの個数を加える
candy += i+1
print(candy)
|
a.cc:1:2: error: invalid preprocessing directive #!
1 | #! /usr/bin/python3
| ^
a.cc:2:3: error: invalid preprocessing directive #A
2 | # A - キャンディーとN人の子供イージー / Children and Candies (ABC Edit)
| ^
a.cc:4:3: warning: missing terminating " character
4 | """
| ^
a.cc:4:3: error: missing terminating " character
a.cc:6:5: error: extended character 。 is not valid in an identifier
6 | 競プロ幼稚園にはN人の子供がいます。
| ^
a.cc:7:5: error: extended character 、 is not valid in an identifier
7 | えび先生は、子供たちを一列に並べ、
| ^
a.cc:7:5: error: extended character 、 is not valid in an identifier
a.cc:9:5: error: extended character 。 is not valid in an identifier
9 | N人目にはN個あげることにしました。
| ^
a.cc:12:7: error: extended character ≦ is not valid in an identifier
12 | 1 ≦ N ≦ 100
| ^
a.cc:12:11: error: extended character ≦ is not valid in an identifier
12 | 1 ≦ N ≦ 100
| ^
a.cc:14:5: error: extended character 。 is not valid in an identifier
14 | 入力は以下の形式で標準入力から与えられる。
| ^
a.cc:17:5: error: extended character 。 is not valid in an identifier
17 | 必要なキャンディーの個数の合計を出力せよ。
| ^
a.cc:18:3: warning: missing terminating " character
18 | """
| ^
a.cc:18:3: error: missing terminating " character
a.cc:22:21: error: stray '#' in program
22 | N = int(input()) # 人数
| ^
a.cc:23:21: error: stray '#' in program
23 | candy = 0 # キャンディーの個数
| ^
a.cc:25:21: error: stray '#' in program
25 | for i in range(N): # 一人ずつキャンディーの個数を加える
| ^
a.cc:4:1: error: expected unqualified-id before string constant
4 | """
| ^~
|
s019436345
|
p04029
|
C++
|
#include <stdio.h>
#include <stdlib.h>
int main()
{
printf("请输入一个数:");
int n;
scanf_s("%d",& n);
int i, N = 0;
i = 1;
while (i <= n)
{
N = N + i;
i = i + 1;
}
printf("%d\n", N);
system("pause");
}
|
a.cc: In function 'int main()':
a.cc:7:4: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
7 | scanf_s("%d",& n);
| ^~~~~~~
| scanf
|
s049871811
|
p04029
|
C++
|
#include <stdio.h>
#include <stdlib.h>
int main()
{
printf("请输入一个数:");
int n;
scanf_s("%d",& n);
int i, N = 0;
i = 1;
while (i <= n)
{
N = N + i;
i = i + 1;
}
printf("the answer is:%d\n", N);
system("pause");
}
|
a.cc: In function 'int main()':
a.cc:7:4: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
7 | scanf_s("%d",& n);
| ^~~~~~~
| scanf
|
s677805454
|
p04029
|
C++
|
#include <stdio.h>
#include <stdlib.h>
int main()
{
printf("请输入一个数:");
int n;
scanf_s("%d",& n);
if (n <= 100)
{
int i, N = 0;
i = 1;
while (i <= n)
{
N = N + i;
i = i + 1;
}
printf("the answer is:%d\n", N);
system("pause");
}
}
|
a.cc: In function 'int main()':
a.cc:7:4: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
7 | scanf_s("%d",& n);
| ^~~~~~~
| scanf
|
s448638595
|
p04029
|
C++
|
#include <stdio.h>
int main()
{
printf(" input:");
int n;
scanf_s("%d",& n);
if (n <= 100)
{
int i, N = 0;
i = 1;
while (i <= n)
{
N = N + i;
i = i + 1;
}
printf("%d\n", N);
getchar();
}
else printf("error\n");
getchar();
}
|
a.cc: In function 'int main()':
a.cc:6:4: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
6 | scanf_s("%d",& n);
| ^~~~~~~
| scanf
|
s507812006
|
p04029
|
C++
|
#include <stdio.h>
#include <stdlib.h>
int main()
{
printf("请输入一个数:");
int n;
scanf_s("%d",& n);
if (n <= 100)
{
int i, N = 0;
i = 1;
while (i <= n)
{
N = N + i;
i = i + 1;
}
printf("the answer is:%d\n", N);
system("pause");
}
else printf("输入错误\n");
system("pause");
}
|
a.cc: In function 'int main()':
a.cc:7:4: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
7 | scanf_s("%d",& n);
| ^~~~~~~
| scanf
|
s410854784
|
p04029
|
C++
|
#include <iostream>
#include <vector>
#include <cstdio>
#include <cmath>
#define ll long long;
using namespace std;
#define fo(i,n) for(int i=0;i<(n);i++)
int main(){
int n; cin >> n;
vector<int> v(n);
rep(i, n) cin >> v[i];
ll sum = 1e9;
for (int i = -100; i <= 100 ; ++i){
ll tmp = 0;
rep(j, n){
tmp += pow((i - v[j]), 2);
}
sum = min(tmp, sum);
}
cout << sum << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:11:9: error: 'i' was not declared in this scope
11 | rep(i, n) cin >> v[i];
| ^
a.cc:11:5: error: 'rep' was not declared in this scope; did you mean 'frexp'?
11 | rep(i, n) cin >> v[i];
| ^~~
| frexp
a.cc:5:17: error: declaration does not declare anything [-fpermissive]
5 | #define ll long long;
| ^~~~
a.cc:12:5: note: in expansion of macro 'll'
12 | ll sum = 1e9;
| ^~
a.cc:12:8: error: 'sum' was not declared in this scope
12 | ll sum = 1e9;
| ^~~
a.cc:5:17: error: declaration does not declare anything [-fpermissive]
5 | #define ll long long;
| ^~~~
a.cc:14:9: note: in expansion of macro 'll'
14 | ll tmp = 0;
| ^~
a.cc:14:12: error: 'tmp' was not declared in this scope; did you mean 'tm'?
14 | ll tmp = 0;
| ^~~
| tm
a.cc:15:13: error: 'j' was not declared in this scope
15 | rep(j, n){
| ^
|
s068738752
|
p04029
|
C
|
#include<iostream>
using namespace std;
int add(int n);
int main(){
int n,ans;
cin >> n;
ans = add(n);
cout << ans << '\n';
}
int add(int n){
if(n == 1)
return n;
return n + add(n-1);
}
|
main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s356164739
|
p04029
|
C++
|
#include<bits/stdc++.h>
using namespace std;
int main(){
int ans=0;
cin>>n;
for(int i=1;i<=n;i++)ans+=i;
cout<<ans<<endl;
return(0);
}
|
a.cc: In function 'int main()':
a.cc:5:8: error: 'n' was not declared in this scope; did you mean 'yn'?
5 | cin>>n;
| ^
| yn
|
s990940028
|
p04029
|
C
|
#include <stdio.h>
int main()
{
int n;
scanf("%d",&n)
printf("%d",(1+n)*n/2)
}
|
main.c: In function 'main':
main.c:6:15: error: expected ';' before 'printf'
6 | scanf("%d",&n)
| ^
| ;
7 | printf("%d",(1+n)*n/2)
| ~~~~~~
|
s815378492
|
p04029
|
C++
|
s[];char*p=s+3,*q=s+3;c;main(){for(gets(s);p-->s;)*p-66?!c?*--q=*p:c--:c++;puts(q);}
|
a.cc:1:1: error: 's' does not name a type
1 | s[];char*p=s+3,*q=s+3;c;main(){for(gets(s);p-->s;)*p-66?!c?*--q=*p:c--:c++;puts(q);}
| ^
a.cc:1:12: error: 's' was not declared in this scope
1 | s[];char*p=s+3,*q=s+3;c;main(){for(gets(s);p-->s;)*p-66?!c?*--q=*p:c--:c++;puts(q);}
| ^
a.cc:1:23: error: 'c' does not name a type
1 | s[];char*p=s+3,*q=s+3;c;main(){for(gets(s);p-->s;)*p-66?!c?*--q=*p:c--:c++;puts(q);}
| ^
a.cc:1:25: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
1 | s[];char*p=s+3,*q=s+3;c;main(){for(gets(s);p-->s;)*p-66?!c?*--q=*p:c--:c++;puts(q);}
| ^~~~
a.cc: In function 'int main()':
a.cc:1:41: error: 's' was not declared in this scope
1 | s[];char*p=s+3,*q=s+3;c;main(){for(gets(s);p-->s;)*p-66?!c?*--q=*p:c--:c++;puts(q);}
| ^
a.cc:1:36: error: 'gets' was not declared in this scope
1 | s[];char*p=s+3,*q=s+3;c;main(){for(gets(s);p-->s;)*p-66?!c?*--q=*p:c--:c++;puts(q);}
| ^~~~
a.cc:1:58: error: 'c' was not declared in this scope
1 | s[];char*p=s+3,*q=s+3;c;main(){for(gets(s);p-->s;)*p-66?!c?*--q=*p:c--:c++;puts(q);}
| ^
a.cc:1:63: error: 'q' was not declared in this scope
1 | s[];char*p=s+3,*q=s+3;c;main(){for(gets(s);p-->s;)*p-66?!c?*--q=*p:c--:c++;puts(q);}
| ^
a.cc:1:81: error: 'q' was not declared in this scope
1 | s[];char*p=s+3,*q=s+3;c;main(){for(gets(s);p-->s;)*p-66?!c?*--q=*p:c--:c++;puts(q);}
| ^
a.cc:1:76: error: 'puts' was not declared in this scope
1 | s[];char*p=s+3,*q=s+3;c;main(){for(gets(s);p-->s;)*p-66?!c?*--q=*p:c--:c++;puts(q);}
| ^~~~
|
s651605088
|
p04029
|
C++
|
#include<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: In function 'int main()':
a.cc:6:15: error: 'i' was not declared in this scope
6 | for(int I=1;i<=n;i++) sum+=i;
| ^
|
s948168506
|
p04029
|
C
|
#include <stdio.h>
int main(){
int n;
scan("%d",&n);
printf("%d",n*(n+1)/2);
}
|
main.c: In function 'main':
main.c:4:3: error: implicit declaration of function 'scan'; did you mean 'scanf'? [-Wimplicit-function-declaration]
4 | scan("%d",&n);
| ^~~~
| scanf
|
s572534424
|
p04029
|
C++
|
print(sum([i+1 for i in range(int(input()))]))
|
a.cc:1:6: error: expected constructor, destructor, or type conversion before '(' token
1 | print(sum([i+1 for i in range(int(input()))]))
| ^
|
s771423510
|
p04029
|
C++
|
#include <iostream>
using namespace std;
void main(void){
int N;
cin>>N;
cout<<N*(1+N)/2<<endl;
}
|
a.cc:3:1: error: '::main' must return 'int'
3 | void main(void){
| ^~~~
|
s069153417
|
p04029
|
C++
|
import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int ame = 0;
int value = sc.nextInt();
for(int i =1;i <= value; i++) {
ame += i;
}
System.out.println(ame);
}
}
|
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:3:1: error: expected unqualified-id before 'public'
3 | public class Main{
| ^~~~~~
|
s162870977
|
p04029
|
C++
|
import java.util.Scanner;
public class Main{
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(System.in);
int ame = 0;
int value = sc.nextInt();
for(int i =1;i <= value; i++) {
ame += i;
}
System.out.println(ame);
}
}
|
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{
| ^~~~~~
|
s755881074
|
p04029
|
C++
|
#include <iostream>
int main () {
int n;
cin >> n;
cout << n * (n + 1) / 2 << endl;
return 0;
}
|
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 >> 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 input
| ^~~
a.cc:5:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
5 | cout << n * (n + 1) / 2 << endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:5:30: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
5 | cout << n * (n + 1) / 2 << endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s093524836
|
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;
| ~^~~~~~~
|
s698520743
|
p04029
|
C
|
#include<stdio.h>
int main()
{
int n;
scanf("%d",&n);
printf("%d\n",n*(n+1)/2);
}
|
main.c: In function 'main':
main.c:6:19: error: '\U0000ff08n' undeclared (first use in this function)
6 | printf("%d\n",n*(n+1)/2);
| ^~~
main.c:6:19: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:23: error: invalid suffix ")" on integer constant
6 | printf("%d\n",n*(n+1)/2);
| ^~~
|
s295418277
|
p04029
|
C
|
#include<stdio.h>
int main()
{
int n;
scanf("%d",&n);
printf("%d\n",n*(n+1)/2)
}
|
main.c: In function 'main':
main.c:6:19: error: '\U0000ff08n' undeclared (first use in this function)
6 | printf("%d\n",n*(n+1)/2)
| ^~~
main.c:6:19: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:23: error: invalid suffix ")" on integer constant
6 | printf("%d\n",n*(n+1)/2)
| ^~~
main.c:6:29: error: expected ';' before '}' token
6 | printf("%d\n",n*(n+1)/2)
| ^
| ;
7 | }
| ~
|
s062015173
|
p04029
|
C++
|
#include <iostream>
using namespace std;
int main(){
cin>>n;cout<<n*(n-1)/2<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:4:10: error: 'n' was not declared in this scope
4 | cin>>n;cout<<n*(n-1)/2<<endl;
| ^
|
s676419735
|
p04029
|
C++
|
#include <cstdio>
int main(){
cin>>n;cout<<n*(n-1)/2<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
3 | cin>>n;cout<<n*(n-1)/2<<endl;
| ^~~
a.cc:3:10: error: 'n' was not declared in this scope
3 | cin>>n;cout<<n*(n-1)/2<<endl;
| ^
a.cc:3:12: error: 'cout' was not declared in this scope
3 | cin>>n;cout<<n*(n-1)/2<<endl;
| ^~~~
a.cc:3:29: error: 'endl' was not declared in this scope
3 | cin>>n;cout<<n*(n-1)/2<<endl;
| ^~~~
|
s235240434
|
p04029
|
C++
|
#include<bits/stdc++.h>
using namespace std;
int main(){
cin >> n;
int ans = 0;
for(int i = 1 ; i <= n ; i++){
ans += i;
}
cout << ans;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:4:12: error: 'n' was not declared in this scope; did you mean 'yn'?
4 | cin >> n;
| ^
| yn
|
s909655627
|
p04029
|
C++
|
#include<iostream>
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;
| ^
|
s993800824
|
p04029
|
C++
|
include <iostream>
using namespace std;
int n;
int main()
{
cin>>n;
cout<<n*(n+1)/2<<endl;
return 0;
}
|
a.cc:1:1: error: 'include' does not name a type
1 | include <iostream>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope
6 | cin>>n;
| ^~~
a.cc:7:5: error: 'cout' was not declared in this scope
7 | cout<<n*(n+1)/2<<endl;
| ^~~~
a.cc:7:22: error: 'endl' was not declared in this scope
7 | cout<<n*(n+1)/2<<endl;
| ^~~~
|
s859252821
|
p04029
|
C++
|
#include <bits/stdc++.h>
#define ll long long
#define _for(a,b,i) for(int i=a;i<=b;i++)
#define for1(a,b,i) for(int i=a;i<b;i++)
using namespace std;
ll ma=0x80000000;
ll mi=0x7fffffff;
const ll zfc=0xffffffff;
const ll mod=1e9+7;
inline void input(ll &x)
{
x=0;
int f=1;
char ch=getchar();
while(!isdigit(ch))
{
if(ch=='-')f=-f;
ch=getchar();
}
while(isdigit(ch))
{
x=x*10+(ch-'0');
ch=getchar();
}
x*=f;
}
inline void output(ll x)
{
if(x<0)
{
x=-x;
putchar('-');
}
if(x/10>0)output(x/10);
putchar(x%10+'0');
}
ll a
int main()
{
ios::sync_with_stdio(false);
input(a);
output(a*(a+1)/2);
cout<<endl;
return 0;
}
|
a.cc:38:1: error: expected initializer before 'int'
38 | int main()
| ^~~
|
s365016362
|
p04029
|
Java
|
import java.util.Scanner;
import java.util.Arrays;
import java.util.ArrayDeque;
import java.util.Deque;
import java.util.Collection;
import java.util.LinkedList;
import java.util.Queue;
class Main{
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int N = scan.nextInt();
for (i = 1; i <= N; i++) {
i += i;
}
System.out.println(i);
}
}
|
Main.java:13: error: cannot find symbol
for (i = 1; i <= N; i++) {
^
symbol: variable i
location: class Main
Main.java:13: error: cannot find symbol
for (i = 1; i <= N; i++) {
^
symbol: variable i
location: class Main
Main.java:13: error: cannot find symbol
for (i = 1; i <= N; i++) {
^
symbol: variable i
location: class Main
Main.java:14: error: cannot find symbol
i += i;
^
symbol: variable i
location: class Main
Main.java:14: error: cannot find symbol
i += i;
^
symbol: variable i
location: class Main
Main.java:16: error: cannot find symbol
System.out.println(i);
^
symbol: variable i
location: class Main
6 errors
|
s862433838
|
p04029
|
C++
|
import java.util.Scanner;
import java.util.Arrays;
import java.util.ArrayDeque;
import java.util.Deque;
import java.util.Collection;
import java.util.LinkedList;
import java.util.Queue;
class Main{
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int N = scan.nextInt();
for (i = 1; i <= N; i++) {
i += i;
}
System.out.println(i);
}
}
|
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:2:1: error: 'import' does not name a type
2 | import java.util.Arrays;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
3 | import java.util.ArrayDeque;
| ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
4 | import java.util.Deque;
| ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: 'import' does not name a type
5 | import java.util.Collection;
| ^~~~~~
a.cc:5:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:1: error: 'import' does not name a type
6 | import java.util.LinkedList;
| ^~~~~~
a.cc:6:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:7:1: error: 'import' does not name a type
7 | import java.util.Queue;
| ^~~~~~
a.cc:7:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:10:17: error: expected ':' before 'static'
10 | public static void main(String[] args) {
| ^~~~~~~
| :
a.cc:10:35: error: 'String' has not been declared
10 | public static void main(String[] args) {
| ^~~~~~
a.cc:10:44: error: expected ',' or '...' before 'args'
10 | public static void main(String[] args) {
| ^~~~
a.cc:18:2: error: expected ';' after class definition
18 | }
| ^
| ;
a.cc: In static member function 'static void Main::main(int*)':
a.cc:11:19: error: 'Scanner' was not declared in this scope
11 | Scanner scan = new Scanner(System.in);
| ^~~~~~~
a.cc:12:27: error: 'scan' was not declared in this scope
12 | int N = scan.nextInt();
| ^~~~
a.cc:13:24: error: 'i' was not declared in this scope
13 | for (i = 1; i <= N; i++) {
| ^
a.cc:16:19: error: 'System' was not declared in this scope
16 | System.out.println(i);
| ^~~~~~
a.cc:16:38: error: 'i' was not declared in this scope
16 | System.out.println(i);
| ^
|
s825460155
|
p04029
|
C++
|
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;
int main()
{
int N;
scanf("%d",&N);
N=(1+N)*N/2;
if(N<=100 && N>=1)
{
printf("%d",N);
}
else
{
pnintf("NO");
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:18:17: error: 'pnintf' was not declared in this scope; did you mean 'printf'?
18 | pnintf("NO");
| ^~~~~~
| printf
|
s200800342
|
p04029
|
C++
|
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;
int main()
{
int N;
scanf("%d",&N);
a=(1+N)*N/2;
if(N<=100 && N>=0)
{
printf("%d",N);
}
else
{
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:11:9: error: 'a' was not declared in this scope
11 | a=(1+N)*N/2;
| ^
|
s453675685
|
p04029
|
C
|
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;
int main()
{
int N;
scanf("%d",&N);
a=(1+N)*N/2;
if(N<=100 && N>=0)
{
printf("%d",N);
}
else
{
}
return 0;
}
|
main.c:1:9: fatal error: cstdio: No such file or directory
1 | #include<cstdio>
| ^~~~~~~~
compilation terminated.
|
s783853901
|
p04029
|
C++
|
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#include <stack>
#include <queue>
using namespace std;
typedef long long ll;
int main() {
int n,count=0,
cin >> n;
for (int i = 1; i <= n; i++)count += i;
cout << count << endl;
getchar();
getchar();
return 0;
}
|
a.cc: In function 'int main()':
a.cc:12:13: error: expected initializer before '>>' token
12 | cin >> n;
| ^~
|
s417220845
|
p04029
|
C++
|
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
using namespace std;
typedef long long lng;
#define UP(i,a,b) for(int i=(a); i<=(b); ++i)
#define DOWN(i,b,a) for(int i=(b); i>=(a); --i)
#define REP(i,n) UP(i,0,n-1)
#define ALL(a) (a).begin(), (a).end()
#define UNIQUE(a) a.erase(unique(ALL(a)), a.end()) //NOTE: <a> must be sorted in advance
lng power(lng b, lng n) {lng sol=1; while(n>0) {if(n&1) {sol=sol*b;} n>>=1; b*= b;} return sol;} //calculate b^n
const int MOD = 1000000007; //10^9+7
/*********** variables ************/
/**********************************/
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int W, H, N;
bool sq[101][101] {{0}};
int N;
cin >> N;
cout << N*(N+1)/2 << endl;
}
|
a.cc: In function 'int main()':
a.cc:27:9: error: redeclaration of 'int N'
27 | int N;
| ^
a.cc:25:15: note: 'int N' previously declared here
25 | int W, H, N;
| ^
|
s915487432
|
p04029
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main(void){
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:13:11: error: 'i' was not declared in this scope
13 | cout << i << endl;
| ^
|
s852095225
|
p04029
|
C++
|
#include <iostream>
using namespace std;
int main(){
int N,S;
S=0;
cin >> N;
if(int i=0;i<=N;i++){
S+=i;}
cout << S << endl;
}
|
a.cc: In function 'int main()':
a.cc:8:18: error: expected ')' before ';' token
8 | if(int i=0;i<=N;i++){
| ~ ^
| )
a.cc:8:19: error: 'i' was not declared in this scope
8 | if(int i=0;i<=N;i++){
| ^
|
s811196665
|
p04029
|
C++
|
#include <iostream>
using namespace std;
int main(){
int N,S;
S=0;
cin >> N;
if(int i=0;i<=N;i++;){
S+=i;}
cout << S << endl;
}
|
a.cc: In function 'int main()':
a.cc:8:18: error: expected ')' before ';' token
8 | if(int i=0;i<=N;i++;){
| ~ ^
| )
a.cc:8:19: error: 'i' was not declared in this scope
8 | if(int i=0;i<=N;i++;){
| ^
a.cc:8:23: error: expected primary-expression before ')' token
8 | if(int i=0;i<=N;i++;){
| ^
|
s266393195
|
p04029
|
C++
|
n=int(input())
a=0
for i in range(n+1):
a=a+i
print(a)
|
a.cc:1:1: error: 'n' does not name a type
1 | n=int(input())
| ^
|
s538344398
|
p04029
|
C++
|
#include<iostream>
using namespace std;
int main(){
int N;
cin >> N;
cout << N(N+1)/2 << endl;
}
|
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;
| ~^~~~~
|
s321723910
|
p04029
|
C
|
#include "stdafx.h"
int func(int a) {
if (a == 1) {
return 1;
}else {
return func(a - 1)+a;
}
}
int main()
{
int num, ans;
//階乗をもとめる
printf("自然数だけだよ♡:");
scanf("%d", &num);
ans = func(num);
printf("あ~、答えの音~:%d\n", ans);
return 0;
}
|
main.c:1:10: fatal error: stdafx.h: No such file or directory
1 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s914872882
|
p04029
|
C
|
#include <stdio.h>
int func(int a){
if (a == 1) {
return 1;
}
else {
return func(a - 1)+a;
}
}
int main(void) {
int num, ans;
printf("自然数だけだよ♡:");
scanf_s("%d", &num);
ans = func(num);
printf("あ~、答えの音~:%d\n", ans);
return 0;
}
|
main.c: In function 'main':
main.c:14:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
14 | scanf_s("%d", &num);
| ^~~~~~~
| scanf
|
s226429955
|
p04029
|
C
|
#include <stdio.h>
int func(int a)
{
if (a == 1)
{
return 1;
}
else {
return func(a - 1)+a;
}
}
int main()
{
int num, ans;
//階乗を求める
scanf_s("%d", &num);
ans = func(num);
printf("%d,ans);
return 0;
}
|
main.c: In function 'main':
main.c:19:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
19 | scanf_s("%d", &num);
| ^~~~~~~
| scanf
main.c:21:16: warning: missing terminating " character
21 | printf("%d,ans);
| ^
main.c:21:16: error: missing terminating " character
21 | printf("%d,ans);
| ^~~~~~~~~
main.c:22:9: error: expected expression before 'return'
22 | return 0;
| ^~~~~~
main.c:22:18: error: expected ';' before '}' token
22 | return 0;
| ^
| ;
23 | }
| ~
|
s399342927
|
p04029
|
C
|
int main()
{
int N,b;
scanf_s("%d", &N);
b = 0.5 *N*( N + 1 );
printf("%d\n", b);
return 0;
}
|
main.c: In function 'main':
main.c:4:9: error: implicit declaration of function 'scanf_s' [-Wimplicit-function-declaration]
4 | scanf_s("%d", &N);
| ^~~~~~~
main.c:7:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
7 | printf("%d\n", b);
| ^~~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf'
+++ |+#include <stdio.h>
1 | int main()
main.c:7:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
7 | printf("%d\n", b);
| ^~~~~~
main.c:7:9: note: include '<stdio.h>' or provide a declaration of 'printf'
|
s277518526
|
p04029
|
C++
|
// Children and Candies (ABC Edit).cpp : アプリケーションのエントリ ポイントを定義します。
//
#define _CRT_SECURE_NO_WARNINGS
#include "stdafx.h"
int main()
{
int a,b;
scanf_s("%d", &a);
b = 0.5 *a*( a + 1 );
printf("%d\n", b);
return 0;
}
|
a.cc:5:10: fatal error: stdafx.h: No such file or directory
5 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s444458555
|
p04029
|
C++
|
{
int a,b;
scanf_s("%d", &a);
b = 0.5 *a*( a + 1 );
printf("%d\n", b);
return 0;
}
|
a.cc:1:1: error: expected unqualified-id before '{' token
1 | {
| ^
|
s780022548
|
p04029
|
C++
|
{
int a,b;
scanf_s("%d", &a);
b = 0.5 *a*( a + 1 );
printf("%d\n", b);
return 0;
}
|
a.cc:1:1: error: expected unqualified-id before '{' token
1 | {
| ^
|
s540956178
|
p04029
|
C
|
#include <stdio.h>
int main()
{
int n;
scanf_s("%d", &n);
n = n * (n + 1) / 2;
printf("%d\n", n);
return 0;
}
|
main.c: In function 'main':
main.c:6:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
6 | scanf_s("%d", &n);
| ^~~~~~~
| scanf
|
s104413725
|
p04029
|
C
|
int main()
{
int a, b;
scanf_s("%d",& a);
b = 0.5 * a*(a + 1);
printf("%d", b);
return 0;
}
|
main.c: In function 'main':
main.c:4:9: error: implicit declaration of function 'scanf_s' [-Wimplicit-function-declaration]
4 | scanf_s("%d",& a);
| ^~~~~~~
main.c:6:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
6 | printf("%d", b);
| ^~~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf'
+++ |+#include <stdio.h>
1 | int main()
main.c:6:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
6 | printf("%d", b);
| ^~~~~~
main.c:6:9: note: include '<stdio.h>' or provide a declaration of 'printf'
|
s802289380
|
p04029
|
C
|
#include <stdio.h>
int main()
{
int n;
printf("人数入力:");
scanf_s("%d", &n);
n = n * (n + 1) / 2;
printf("必要な飴の個数は%d個\n", n);
return 0;
}
|
main.c: In function 'main':
main.c:7:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
7 | scanf_s("%d", &n);
| ^~~~~~~
| scanf
|
s374152351
|
p04029
|
C
|
int main()
{
int a, b,i;
scanf_s("%d",& a);
b = 1 / 2 * a*(a + 1);
printf("%d", b);
return 0;
}
|
main.c: In function 'main':
main.c:4:9: error: implicit declaration of function 'scanf_s' [-Wimplicit-function-declaration]
4 | scanf_s("%d",& a);
| ^~~~~~~
main.c:6:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
6 | printf("%d", b);
| ^~~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf'
+++ |+#include <stdio.h>
1 | int main()
main.c:6:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
6 | printf("%d", b);
| ^~~~~~
main.c:6:9: note: include '<stdio.h>' or provide a declaration of 'printf'
|
s398047724
|
p04029
|
C++
|
#include "bits\stdc++.h"
using namespace std;
int main() {
int N, res = 0;
cin >> N;
for (int i = 1; i <= N; i++) res += i;
cout << res << endl;
return 0;
}
|
a.cc:1:10: fatal error: bits\stdc++.h: No such file or directory
1 | #include "bits\stdc++.h"
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s790458407
|
p04029
|
C++
|
#include<iostream>
using namespace std;
int main(void) {
int n;
cin >> n;
int ans = 0;
for (int i=1; i<n+1; ++i)
ans += i;
}
cout << ans << endl;
}
|
a.cc:12:1: error: 'cout' does not name a type
12 | cout << ans << endl;
| ^~~~
a.cc:13:1: error: expected declaration before '}' token
13 | }
| ^
|
s585408819
|
p04029
|
C++
|
include<algorithm>
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
int main(void){
int i,n,ans=0;
cin>>n;
for(i=1;i<=n;i++) ans+=i;
cout<<ans<<endl;
return 0;
}
|
a.cc:1:1: error: 'include' does not name a type
1 | include<algorithm>
| ^~~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:2:
/usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity
164 | __is_null_pointer(std::nullptr_t)
| ^
/usr/include/c++/14/ext/type_traits.h:159:5: note: previous declaration 'template<class _Type> constexpr bool __gnu_cxx::__is_null_pointer(_Type)'
159 | __is_null_pointer(_Type)
| ^~~~~~~~~~~~~~~~~
/usr/include/c++/14/ext/type_traits.h:164:26: error: 'nullptr_t' is not a member of 'std'; did you mean 'nullptr_t'?
164 | __is_null_pointer(std::nullptr_t)
| ^~~~~~~~~
In file included from /usr/include/c++/14/cstddef:50,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41:
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:443:29: note: 'nullptr_t' declared here
443 | typedef decltype(nullptr) nullptr_t;
| ^~~~~~~~~
In file included from /usr/include/c++/14/bits/stl_pair.h:60,
from /usr/include/c++/14/bits/stl_algobase.h:64:
/usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std'; did you mean 'nullptr_t'?
666 | struct is_null_pointer<std::nullptr_t>
| ^~~~~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:443:29: note: 'nullptr_t' declared here
443 | typedef decltype(nullptr) nullptr_t;
| ^~~~~~~~~
/usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid
666 | struct is_null_pointer<std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid
670 | struct is_null_pointer<const std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid
674 | struct is_null_pointer<volatile std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid
678 | struct is_null_pointer<const volatile std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
1429 | : public integral_constant<std::size_t, alignof(_Tp)>
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid
1429 | : public integral_constant<std::size_t, alignof(_Tp)>
| ^
/usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
1438 | : public integral_constant<std::size_t, 0> { };
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid
1438 | : public integral_constant<std::size_t, 0> { };
| ^
/usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared
1440 | template<typename _Tp, std::size_t _Size>
| ^~~
/usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope
1441 | struct rank<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid
1441 | struct rank<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid
1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^
/usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid
1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^
/usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:2086:26: error: 'std::size_t' has not been declared
2086 | template<typename _Tp, std::size_t _Size>
| ^~~
/usr/include/c++/14/type_traits:2087:30: error: '_Size' was not declared in this scope
2087 | struct remove_extent<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:2087:36: error: template argument 1 is invalid
2087 | struct remove_extent<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:2099:26: error: 'std::size_t' has not been declared
2099 | template<typename _Tp, std::size_t _Size>
| ^~~
/usr/include/c++/14/type_traits:2100:35: error: '_Size' was not declared in this scope
2100 | struct remove_all_extents<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:2100:41: error: template argument 1 is invalid
2100 | struct remove_all_extents<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:2171:12: error: 'std::size_t' has not been declared
2171 | template<std::size_t _Len>
| ^~~
/usr/include/c++/14/type_traits:2176:30: error: '_Len' was not declared in this scope
2176 | unsigned char __data[_Len];
| ^~~~
/usr/include/c++/14/type_traits:2194:12: error: 'std::size_t' has not been declared
2194 | template<std::size_t _Len, std::size_t _Align =
| ^~~
/usr/include/c++/14/type_traits:2194:30: error: 'std::size_t' has not been declared
2194 | template<std::size_t _Len, std::size_t _Align =
| ^~~
/usr/include/c++/14/type_traits:2195:55: error: '_Len' was not declared in this scope
2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)>
| ^~~~
/usr/include/c++/14/type_traits:2195:59: error: template argument 1 is invalid
2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)>
| ^
/usr/include/c++/14/type_traits:2202:30: error: '_Len' was not declared in this scope
2202 | unsigned char __data[_Len];
| ^~~~
/usr/include/c++/14/type_traits:2203:44: error: '_Align' was not declared in this scope
2203 | struct __attribute__((__aligned__((_Align)))) { } __align;
| ^~~~~~
In file included from /usr/include/c++/14/bits/stl_tempbuf.h:59,
from /usr/include/c++/14/bits/stl_algo.h:69,
from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/new:131:26: error: declaration of 'operator new' as non-function
131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~~~
/usr/include/c++/14/new:131:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:132:41: error: attributes after parenthesized initializer ignored [-fpermissive]
132 | __attribute__((__externally_visible__));
| ^
/usr/include/c++/14/new:133:26: error: declaration of 'operator new []' as non-function
133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~~~
/usr/include/c++/14/new:133:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:134:41: error: attributes after parenthesized initializer ignored [-fpermissive]
134 | __attribute__((__externally_visible__));
|
|
s090655267
|
p04029
|
C++
|
inn = int(input())
r = 0
for i in range(1,inn+1):
r += i
print(r)
|
a.cc:1:1: error: 'inn' does not name a type; did you mean 'int'?
1 | inn = int(input())
| ^~~
| int
|
s933480483
|
p04029
|
C++
|
#include <iostream>
int main() {
int N;
int ans = 0;
std::cin >> N;
for (int i = 1; i =< N; i++) {
ans += i;
}
std::cout << ans <<std::endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:6:25: error: expected primary-expression before '<' token
6 | for (int i = 1; i =< N; i++) {
| ^
|
s303286885
|
p04029
|
C++
|
#include <iostream>
int main() {
int N;
int ans = 0;
std::cin >> N;
for (int i = 1 i > N i++) {
ans += i;
}
std::cout << ans <<std::endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:6:20: error: expected ';' before 'i'
6 | for (int i = 1 i > N i++) {
| ^~
| ;
a.cc:6:26: error: expected ';' before 'i'
6 | for (int i = 1 i > N i++) {
| ^~
| ;
|
s056379055
|
p04029
|
C++
|
#include <iostream>
int main() {
int N;
int ans = 0;
std::cin >> N;
for (int i = 1; i > N; i++;) {
ans += i;
}
std::cout << ans <<std::endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:6:32: error: expected ')' before ';' token
6 | for (int i = 1; i > N; i++;) {
| ~ ^
| )
a.cc:6:33: error: expected primary-expression before ')' token
6 | for (int i = 1; i > N; i++;) {
| ^
|
s465185586
|
p04029
|
C++
|
#include <iostream>
int main() {
int N;
int ans = 0;
std::cin >> N;
for (int i = 1; i > N; i++;) {
ans += i;
}
std::cout << ans <<std::endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:6:32: error: expected ')' before ';' token
6 | for (int i = 1; i > N; i++;) {
| ~ ^
| )
a.cc:6:33: error: expected primary-expression before ')' token
6 | for (int i = 1; i > N; i++;) {
| ^
|
s122558627
|
p04029
|
C++
|
#include <iostream>
int main() {
int N;
int ans = 0;
std::cin >> N;
for (int i = 1; i > N; i++;) {
ans += i;
}
std::cout << ans <<std::endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:6:32: error: expected ')' before ';' token
6 | for (int i = 1; i > N; i++;) {
| ~ ^
| )
a.cc:6:33: error: expected primary-expression before ')' token
6 | for (int i = 1; i > N; i++;) {
| ^
|
s953831322
|
p04029
|
C++
|
#include <iostream>
int main() {
int N;
int ans = 0;
int a = 0;
std::cin >> N;
for (int i = 0; i == N; i++;) {
a++;
ans += a;
}
std::cout << ans <<std::endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:7:33: error: expected ')' before ';' token
7 | for (int i = 0; i == N; i++;) {
| ~ ^
| )
a.cc:7:34: error: expected primary-expression before ')' token
7 | for (int i = 0; i == N; i++;) {
| ^
|
s005018499
|
p04029
|
C++
|
#include <iostream>
int main() {
int N;
int ans = 0;
int a = 0;
std::cin >> N;
for (int i = 0; i == N; i++;) {
a++;
std::base ans += a;
N--;
}
std::cout << ans <<std::endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:7:33: error: expected ')' before ';' token
7 | for (int i = 0; i == N; i++;) {
| ~ ^
| )
a.cc:7:34: error: expected primary-expression before ')' token
7 | for (int i = 0; i == N; i++;) {
| ^
|
s780843405
|
p04029
|
C++
|
#include <iostream>
int main() {
int N;
int ans = 0;
int a = 0;
std::cin >> N;
for (int i = 0; i == N; i++;) {
a++;
base ans += a;
N--;
}
std::cout << ans <<std::endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:7:33: error: expected ')' before ';' token
7 | for (int i = 0; i == N; i++;) {
| ~ ^
| )
a.cc:7:34: error: expected primary-expression before ')' token
7 | for (int i = 0; i == N; i++;) {
| ^
|
s023449333
|
p04029
|
C++
|
#include <iostream>
int main() {
int N;
int ans = 0;
std::cin >> N;
for (int i = 0; i == N; i++) {
ans += i;
}
std::cout << ans <<std::endl;
}
return 0;
}
|
a.cc:14:4: error: expected unqualified-id before 'return'
14 | return 0;
| ^~~~~~
a.cc:16:2: error: expected declaration before '}' token
16 | }
| ^
|
s518913849
|
p04029
|
C++
|
#include <iostream>
int main() {
int N;
int ans = 0;
std::cin >> N;
for (int i = 0; i == N; i++) {
ans += i;
}
std::cout << ans <,std::endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:23: error: expected primary-expression before ',' token
9 | std::cout << ans <,std::endl;
| ^
|
s977068434
|
p04029
|
C++
|
#include <iostream>
int main() {
int N, ans;
std::cin >> N;
for (int i = 1; i > N; i++) {
ans += i;
}
std::cout << ans <,std::endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:8:23: error: expected primary-expression before ',' token
8 | std::cout << ans <,std::endl;
| ^
|
s223111643
|
p04029
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
cout << (1 + n) * n / 2 << endl;
}
|
a.cc: In function 'int main()':
a.cc:7:16: error: 'n' was not declared in this scope
7 | cout << (1 + n) * n / 2 << endl;
| ^
|
s513125702
|
p04029
|
C++
|
#include <iostream>
using namespace std;
int main() {
int a, b = 0, i;
for (i == 1;i <= a;i++){
b += i
}
cout << b << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:7:23: error: expected ';' before '}' token
7 | b += i
| ^
| ;
8 | }
| ~
|
s027990937
|
p04029
|
C++
|
#include <iostream>
using namespace std;
int main(){
int a,ans;
ans = 0;
cin << a;
for(int i = 0; i < a;i++){
ans += i+1;
}
cout << ans << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:7:13: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
7 | cin << a;
| ~~~ ^~ ~
| | |
| | int
| std::istream {aka std::basic_istream<char>}
a.cc:7:13: note: candidate: 'operator<<(int, int)' (built-in)
7 | cin << a;
| ~~~~^~~~
a.cc:7:13: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int'
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)'
763 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed:
a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin << a;
| ^
/usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
4077 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed:
a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin << a;
| ^
In file included from /usr/include/c++/14/bits/memory_resource.h:38,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)'
125 | operator<<(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed:
a.cc:7:9: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte'
7 | cin << a;
| ^~~
In file included from /usr/include/c++/14/bits/ios_base.h:46:
/usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)'
339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e)
| ^~~~~~~~
/usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed:
a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin << a;
| ^
/usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)'
563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed:
a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin << a;
| ^
/usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)'
573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed:
a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin << a;
| ^
/usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)'
579 | operator<<(basic_ostream<char, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed:
a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
7 | cin << a;
| ^
/usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)'
590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed:
a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
7 | cin << a;
| ^
/usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)'
595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed:
a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
7 | cin << a;
| ^
/usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)'
654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed:
a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin << a;
| ^
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)'
307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed:
a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin << a;
| ^
/usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)'
671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed:
a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
7 | cin << a;
| ^
/usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)'
684 | operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:684:5: note: template argument deduction/substitution failed:
a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
7 | cin << a;
| ^
/usr/include/c++/14/ostream:689:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const unsigned char*)'
689 | operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:689:5: note: template argument deduction/substitution failed:
a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
7 | cin << a;
| ^
/usr/include/c++/14/ostream:810:5: note: candidate: 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&)'
810 | operator<<(_Ostream&& __os, const _Tp& __x)
| ^~~~~~~~
/usr/include/c++/14/ostream:810:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/ostream: In substitution of 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = std::basic_istream<char>&; _Tp = int]':
a.cc:7:11: required from here
7 | cin << a;
| ^
/usr/include/c++/14/ostream:810:5: error: no type named 'type' in 'struct std::enable_if<false, void>'
810 | operator<<(_Ostream&& __os, const _Tp& __x)
| ^~~~~~~~
|
s277832276
|
p04029
|
C++
|
#include <bits/stdc++.h>
using namespace std;
//#define MD 100010
int main(){
int n;
cin>>n;
long int ans=O;
for(int i=1;i<=n;i++){
ans+=i;
}
cout<<ans<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:18: error: 'O' was not declared in this scope
10 | long int ans=O;
| ^
|
s591965582
|
p04029
|
C
|
#include<stdio.h>
#include<string.h>
int main(void){
int i,p;
char sd[20];
char f[20];
char e[20];
scanf("%s",sd);
p = strlen(sd);
for (i = 0;i < p; i++) {
if (sd[i] == '0') {
strcat(f, "0");
}
if (sd[i] == '1') {
strcat(f, "1");
}
if (sd[i] == 'B' && strlen(f) - 1 >= 0 {
strncpy(e, f, (int)(strlen(f) - 1));
strcpy(f, e);
}
}
printf("%s\n", f);
return 0;
}
|
main.c: In function 'main':
main.c:17:55: error: expected ')' before '{' token
17 | if (sd[i] == 'B' && strlen(f) - 1 >= 0 {
| ~ ^~
| )
main.c:22:9: error: expected expression before '}' token
22 | }
| ^
|
s800023414
|
p04029
|
Java
|
import java.util.Scanner;
public class Main043{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int num = sc.nextInt();
int sum = 0;
for(int i = 1;i <= num;i++){
sum = sum + i;
}
System.out.println(sum);
}
}
|
Main.java:2: error: class Main043 is public, should be declared in a file named Main043.java
public class Main043{
^
1 error
|
s501016464
|
p04029
|
C++
|
#include<iostream>
using namespace std;
int main(){
int n,
cin >> n;
int ans = 0;
for(int i = 1; i <= n; i++){
ans += i;
}
cout << ans << endl;
}
|
a.cc: In function 'int main()':
a.cc:5:7: error: expected initializer before '>>' token
5 | cin >> n;
| ^~
|
s771760135
|
p04029
|
C++
|
#include<iostream>
using namespace std;
int main(){
int N;
cin>>N;
int sum=0;
for(int i=1;i<=K;i++)sum+=i;
cout<<sum<<endl;
}
|
a.cc: In function 'int main()':
a.cc:7:18: error: 'K' was not declared in this scope
7 | for(int i=1;i<=K;i++)sum+=i;
| ^
|
s291010096
|
p04029
|
C++
|
#include<iostream>
using namespace std;
int main(){
int N;
cin<<N;
int sum=0;
for(int i=1;i<=K;i++)sum+=i;
cout<<sum<<endl;
}
|
a.cc: In function 'int main()':
a.cc:5:6: 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:6: note: candidate: 'operator<<(int, int)' (built-in)
5 | cin<<N;
| ~~~^~~
a.cc:5:6: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int'
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)'
763 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed:
a.cc:5:8: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
5 | cin<<N;
| ^
/usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
4077 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed:
a.cc:5:8: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
5 | cin<<N;
| ^
In file included from /usr/include/c++/14/bits/memory_resource.h:38,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)'
125 | operator<<(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed:
a.cc:5:3: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte'
5 | cin<<N;
| ^~~
In file included from /usr/include/c++/14/bits/ios_base.h:46:
/usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)'
339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e)
| ^~~~~~~~
/usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed:
a.cc:5:8: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
5 | cin<<N;
| ^
/usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)'
563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed:
a.cc:5:8: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
5 | cin<<N;
| ^
/usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)'
573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed:
a.cc:5:8: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
5 | cin<<N;
| ^
/usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)'
579 | operator<<(basic_ostream<char, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed:
a.cc:5:8: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
5 | cin<<N;
| ^
/usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)'
590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed:
a.cc:5:8: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
5 | cin<<N;
| ^
/usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)'
595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed:
a.cc:5:8: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
5 | cin<<N;
| ^
/usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)'
654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed:
a.cc:5:8: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
5 | cin<<N;
| ^
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)'
307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed:
a.cc:5:8: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
5 | cin<<N;
| ^
/usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)'
671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed:
a.cc:5:8: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
5 | cin<<N;
| ^
/usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)'
684 | operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:684:5: note: template argument deduction/substitution failed:
a.cc:5:8: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
5 | cin<<N;
| ^
/usr/include/c++/14/ostream:689:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const unsigned char*)'
689 | operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:689:5: note: template argument deduction/substitution failed:
a.cc:5:8: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
5 | cin<<N;
| ^
/usr/include/c++/14/ostream:810:5: note: candidate: 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&)'
810 | operator<<(_Ostream&& __os, const _Tp& __x)
| ^~~~~~~~
/usr/include/c++/14/ostream:810:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/ostream: In substitution of 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = std::basic_istream<char>&; _Tp = int]':
a.cc:5:8: required from here
5 | cin<<N;
| ^
/usr/include/c++/14/ostream:810:5: error: no type named 'type' in 'struct std::enable_if<false, void>'
810 | operator<<(_Ostream&& __os, const _Tp& __x)
| ^~~~~~~~
a.cc:7:18: error: 'K' was not declared in this scope
7 | for(int i=1;i<=K;i++)sum+=i;
| ^
|
s632222102
|
p04029
|
C++
|
int main(){
int n;
std::cin >> n;
std::cout << ((n + 1) * n) / 2 << std::endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:4:10: error: 'cin' is not a member of 'std'
4 | std::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 | int main(){
a.cc:6:10: error: 'cout' is not a member of 'std'
6 | std::cout << ((n + 1) * n) / 2 << std::endl;
| ^~~~
a.cc:6:10: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:6:44: error: 'endl' is not a member of 'std'
6 | std::cout << ((n + 1) * n) / 2 << std::endl;
| ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
+++ |+#include <ostream>
1 | int main(){
|
s496053835
|
p04029
|
C++
|
process.stdin.resume();
process.stdin.setEncoding('ascii');
var input_stdin = "";
var input_stdin_array = "";
var input_currentline = 0;
process.stdin.on('data', function (data) {
input_stdin += data;
});
process.stdin.on('end', function () {
input_stdin_array = input_stdin.split("\n");
main();
});
function readLine() {
return input_stdin_array[input_currentline++];
}
/////////////// ignore above this line ////////////////////
function hacking(s) {
var ret="";
for (var i=0; i < s.length; i++){
if (s[i] == '0'){
ret += '0';
} else if (s[i] == '1'){
ret += '1';
} else if (s[i] == 'B' && ret.length > 0){
ret = ret.substr(0, ret.length-1);
}
}
return ret;
}
function main() {
//var l = parseInt(readLine());
var s = readLine();
var result = hacking(s);
process.stdout.write("" + result + "\n");
}
|
a.cc:2:27: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes
2 | process.stdin.setEncoding('ascii');
| ^~~~~~~
a.cc:8:18: warning: multi-character character constant [-Wmultichar]
8 | process.stdin.on('data', function (data) {
| ^~~~~~
a.cc:12:18: warning: multi-character character constant [-Wmultichar]
12 | process.stdin.on('end', function () {
| ^~~~~
a.cc:1:1: error: 'process' does not name a type
1 | process.stdin.resume();
| ^~~~~~~
a.cc:2:1: error: 'process' does not name a type
2 | process.stdin.setEncoding('ascii');
| ^~~~~~~
a.cc:4:1: error: 'var' does not name a type
4 | var input_stdin = "";
| ^~~
a.cc:5:1: error: 'var' does not name a type
5 | var input_stdin_array = "";
| ^~~
a.cc:6:1: error: 'var' does not name a type
6 | var input_currentline = 0;
| ^~~
a.cc:8:1: error: 'process' does not name a type
8 | process.stdin.on('data', function (data) {
| ^~~~~~~
a.cc:10:2: error: expected unqualified-id before ')' token
10 | });
| ^
a.cc:12:1: error: 'process' does not name a type
12 | process.stdin.on('end', function () {
| ^~~~~~~
a.cc:15:2: error: expected unqualified-id before ')' token
15 | });
| ^
a.cc:17:1: error: 'function' does not name a type; did you mean 'union'?
17 | function readLine() {
| ^~~~~~~~
| union
a.cc:23:1: error: 'function' does not name a type; did you mean 'union'?
23 | function hacking(s) {
| ^~~~~~~~
| union
a.cc:37:1: error: 'function' does not name a type; did you mean 'union'?
37 | function main() {
| ^~~~~~~~
| union
|
s873498999
|
p04029
|
Java
|
import java.util.Scanner;
class Candy {
public static void main(String[] args) {
scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int sum = 0;
for(int i = 0; i < n; i++) {
sum += (i + 1);
}
System.out.println(sum);
}
}
|
Main.java:5: error: cannot find symbol
scanner scan = new Scanner(System.in);
^
symbol: class scanner
location: class Candy
1 error
|
s157884185
|
p04029
|
Java
|
import java.util.Scanner;
class Candy {
}
Copy
import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
System.out.println((n+1) * n/2);
}
}
|
Main.java:12: error: class, interface, enum, or record expected
Copy
^
1 error
|
s505537227
|
p04029
|
Java
|
public static void main(String[] args) {
}
|
Main.java:1: 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)
1 error
|
s647265331
|
p04029
|
C++
|
#include <iostream>
using namespace std;
int main(){
int N,Sum;
cin >> N;
for (int j == 1; j <= N ; j++){
Sum += j;
}
}
|
a.cc: In function 'int main()':
a.cc:7:13: error: expected ';' before '==' token
7 | for (int j == 1; j <= N ; j++){
| ^~~
| ;
a.cc:7:14: error: expected primary-expression before '==' token
7 | for (int j == 1; j <= N ; j++){
| ^~
a.cc:7:26: error: expected ')' before ';' token
7 | for (int j == 1; j <= N ; j++){
| ~ ^~
| )
a.cc:7:29: error: 'j' was not declared in this scope
7 | for (int j == 1; j <= N ; j++){
| ^
|
s135024251
|
p04029
|
C++
|
#include <iostream>
using namespace std;
int main(){
int N,Sum;
cin >> N;
for (int j == 1; j <= N ; j++){
Sum += j
}
}
|
a.cc: In function 'int main()':
a.cc:7:13: error: expected ';' before '==' token
7 | for (int j == 1; j <= N ; j++){
| ^~~
| ;
a.cc:7:14: error: expected primary-expression before '==' token
7 | for (int j == 1; j <= N ; j++){
| ^~
a.cc:7:26: error: expected ')' before ';' token
7 | for (int j == 1; j <= N ; j++){
| ~ ^~
| )
a.cc:7:29: error: 'j' was not declared in this scope
7 | for (int j == 1; j <= N ; j++){
| ^
|
s976011990
|
p04029
|
C++
|
// g++ macro.cpp -std=c++14
#include <bits/stdc++.h> //STL include
typedef long long ll;// long long int
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;
using namespace std;//namespace
#define dump(x) cout << #x << " = " << (x) << endl;// debug cout
#define YES(n) cout << ((n) ? "YES" : "NO" ) << endl;
#define Yes(n) cout << ((n) ? "Yes" : "No" ) << endl;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)// for macro
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define CIN(x) int x;cin>>x;
#define VECCIN(x) for(auto&youso_: (x) )cin>>youso_;
#define VECCOUT(x) for(auto&youso_: (x) )cout<<youso_<<" ";cout<<endl;
#define ALL(obj) (obj).begin(),(obj).end()// iterator
#define P pair<int,int>
#define V vector<int>
#define pb(a) push_back(a)//push_back
#define mp make_pair// make_pair
int main(){
CIN(n);
int sum=0;
REP(i,n+1);sum+=i;
cout<<sum<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:35:21: error: 'i' was not declared in this scope
35 | REP(i,n+1);sum+=i;
| ^
|
s817455783
|
p04029
|
C
|
#include<stdio.h>
int main(){
int n, i;
int sum = 0;
scanf("%d", &n);
for(i = 0; i < = n; i++){
sum += i;
}
printf("%d\n", sum);
return 0;
}
|
main.c: In function 'main':
main.c:6:18: error: expected expression before '=' token
6 | for(i = 0; i < = n; i++){
| ^
|
s747122467
|
p04029
|
Java
|
import java.util.*;
public static void main (String argv[]){
Scanner input=new Scanner (System.in);
int n=input.nextInt();
int sum=0;
for (int i=0;i++<n;)
sum+=i;
System.out.print(sum);
}
|
Main.java:3: error: unnamed classes are a preview feature and are disabled by default.
public static void main (String argv[]){
^
(use --enable-preview to enable unnamed classes)
1 error
|
s564843869
|
p04029
|
Java
|
import java.util.*;
public class b043 {
public static void main (String argv[]){
Scanner input=new Scanner (System.in);
int n=input.nextInt();
int sum=0;
for (int i=0;i++<n;)
sum+=i;
System.out.print(sum);
}
}
|
Main.java:2: error: class b043 is public, should be declared in a file named b043.java
public class b043 {
^
1 error
|
s647284547
|
p04029
|
Java
|
import java.util.*;
public class {
public static void main (String argv[]){
Scanner input=new Scanner (System.in);
int n=input.nextInt();
int sum=0;
for (int i=0;i++<n;)
sum+=i;
System.out.print(sum);
}
}
|
Main.java:2: error: <identifier> expected
public class {
^
1 error
|
s071375121
|
p04029
|
C++
|
# -*- coding: utf-8 -*-
import math
import sys
import itertools
import numpy as np
import functools
import collections
mo = 1000000007
INF = 10**100
r = range
class infix(object):
def __init__(self, function):
self.function = function
def __ror__(self, other):
self.left = other
return self
def __or__(self, other):
return self.function(self.left, other)
def __call__(self, value1, value2):
return self.function(value1, value2)
@infix
def c(f_t_u, f_u_r): return lambda t: f_u_r(f_t_u(t))
class _Ap(object):
def __rlshift__(self, other):
self.value = other
return self
def __rshift__(self, other):
return other(self.value)
Ap = _Ap()
ap = Ap
#d = {1:2, 3:5, 6:10, 1000043:3814}
#zip(d.keys(), d.values())<<ap>>(list |c| sorted |c| reversed |c| list |c| print)
n = int(input())
print(n*(n+1)//2)
|
a.cc:1:3: error: invalid preprocessing directive #-
1 | # -*- coding: utf-8 -*-
| ^
a.cc:26:1: error: stray '@' in program
26 | @infix
| ^
a.cc:39:2: error: invalid preprocessing directive #d
39 | #d = {1:2, 3:5, 6:10, 1000043:3814}
| ^
a.cc:40:2: error: invalid preprocessing directive #zip
40 | #zip(d.keys(), d.values())<<ap>>(list |c| sorted |c| reversed |c| list |c| print)
| ^~~
a.cc:2:1: error: 'import' does not name a type
2 | import math
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
|
s783946010
|
p04029
|
C++
|
#include<iostream>
using namespace std;
int main(){
int a;
cin>>a;
cout<<n*(n+1)/2<<endl;
}
|
a.cc: In function 'int main()':
a.cc:6:15: error: 'n' was not declared in this scope
6 | cout<<n*(n+1)/2<<endl;
| ^
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.