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;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef pair<int,int> P;
const int INF=1e+9;
const double EPS=1e-9;
const int MOD=1000000007;
const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};
signed main(){
cin >> n;
cout << n*(n+1)/2 <<endl;
return 0;
}
|
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;
| ^~~~
a.cc:12:20: error: 'endl' 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: 'cin' does not name a type
7 | cin>>n;
| ^~~
a.cc:8:2: error: 'cout' does not name a type
8 | cout<<(n*n+n)/2<<endl;
| ^~~~
a.cc:9:1: error: expected declaration before '}' token
9 | }
| ^
|
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: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
8 | if __name__ == '__main__':
| ^~~~~~~~~~
|
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 << S << endl;
| ^~~~
|
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
| std::basic_ostream<char>
a.cc:9:30: note: candidate: 'operator>>(int, int)' (built-in)
9 | cout << n * (n + 1) >> 1;
| ~~~~~~~~~~~~~~~~~~~~~^~~~
a.cc:9:30: note: no known conversion for argument 1 from 'std::basic_ostream<char>' to 'int'
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41,
from a.cc:1:
/usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)'
131 | operator>>(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: cannot convert 'std::cout.std::basic_ostream<char>::operator<<((n * (n + 1)))' (type 'std::basic_ostream<char>') to type 'std::byte'
9 | cout << n * (n + 1) >> 1;
| ~~~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:55,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
835 | operator>>(basic_istream<_CharT, _Traits>& __in,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed:
a.cc:9:33: note: 'std::basic_ostream<char>' is not derived from 'std::basic_istream<_CharT, _Traits>'
9 | cout << n * (n + 1) >> 1;
| ^
/usr/include/c++/14/bitset:1597:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, bitset<_Nb>&)'
1597 | operator>>(std::basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x)
| ^~~~~~~~
/usr/include/c++/14/bitset:1597:5: note: template argument deduction/substitution failed:
a.cc:9:33: note: 'std::basic_ostream<char>' is not derived from 'std::basic_istream<_CharT, _Traits>'
9 | cout << n * (n + 1) >> 1;
| ^
In file included from /usr/include/c++/14/istream:1109,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)'
978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c)
| ^~~~~~~~
/usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed:
a.cc:9:33: note: 'std::basic_ostream<char>' is not derived from 'std::basic_istream<_CharT, _Traits>'
9 | cout << n * (n + 1) >> 1;
| ^
/usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)'
849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed:
a.cc:9:33: note: 'std::basic_ostream<char>' is not derived from 'std::basic_istream<char, _Traits>'
9 | cout << n * (n + 1) >> 1;
| ^
/usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)'
854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed:
a.cc:9:33: note: 'std::basic_ostream<char>' is not derived from 'std::basic_istream<char, _Traits>'
9 | cout << n * (n + 1) >> 1;
| ^
/usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)'
896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed:
a.cc:9:33: note: 'std::basic_ostream<char>' is not derived from 'std::basic_istream<_CharT, _Traits>'
9 | cout << n * (n + 1) >> 1;
| ^
/usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)'
939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed:
a.cc:9:33: note: 'std::basic_ostream<char>' is not derived from 'std::basic_istream<char, _Traits>'
9 | cout << n * (n + 1) >> 1;
| ^
/usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)'
945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed:
a.cc:9:33: note: 'std::basic_ostream<char>' is not derived from 'std::basic_istream<char, _Traits>'
9 | cout << n * (n + 1) >> 1;
| ^
/usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
/usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = int]':
a.cc:9:26: required from here
9 | cout << n * (n + 1) >> 1;
| ^
/usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
/usr/include/c++/14/complex:509:5: note: candidate: 'template<class _Tp, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, complex<_Tp>&)'
509 | operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x)
| ^~~~~~~~
/usr/include/c++/14/complex:509:5: note: template argument deduction/substitution failed:
a.cc:9:33: note: 'std::basic_ostream<char>' is not derived from 'std::basic_istream<_CharT, _Traits>'
9 | cout << n * (n + 1) >> 1;
| ^
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:143:
/usr/include/c++/14/iomanip:76:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Resetiosflags)'
76 | operator>>(basic_istream<_CharT, _Traits>& __is, _Resetiosflags __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:76:5: note: template argument deduction/substitution failed:
a.cc:9:33: note: 'std::basic_ostream<char>' is not derived from 'std::basic_istream<_CharT, _Traits>'
9 | cout << n * (n + 1) >> 1;
| ^
/usr/include/c++/14/iomanip:106:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setiosflags)'
106 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setiosflags __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:106:5: note: template argument deduction/substitution failed:
a.cc:9:33: note: 'std::basic_ostream<char>' is not derived from 'std::basic_istream<_CharT, _Traits>'
9 | cout << n * (n + 1) >> 1;
| ^
/usr/include/c++/14/iomanip:137:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setbase)'
137 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setbase __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:137:5: note: template argument deduction/substitution failed:
a.cc:9:33: note: 'std::basic_ostream<char>' is not derived from 'std::basic_istream<_CharT, _Traits>'
9 | cout << n * (n + 1) >> 1;
| ^
/usr/include/c++/14/iomanip:177:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setfill<_CharT>)'
177 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setfill<_CharT> __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:177:5: note: template argument deduction/substitution failed:
a.cc:9:33: note: 'std::basic_ostream<char>' is not derived from 'std::basic_istream<_CharT, _Traits>'
9 | cout << n * (n + 1) >> 1;
| ^
/usr/include/c++/14/iomanip:207:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_
|
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 1000000007
#define LL long long
using Coord = pair<int, int>;
int main() {
int n;
cin >> n;
cout << (n + 1) * n / 2 << endl;`
}
|
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++){
taihi+=m.charAt(j);
}
m=taihi;
taihi="";
}else{
m+=s.charAt(i);
}
}
System.out.println(m);
}
}
|
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 sum = 0, i;
for (i = 1; i <= N; i++) {
sum += i;
}
System.out.println(sum);
}
}
|
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 print(){
System.out.println("hello world");
return;
}
}//1からnまで足す
|
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: error: 'String' has not been declared
5 | public static void main(String args[]){
| ^~~~~~
a.cc:27:2: error: expected ';' after class definition
27 | }//1からnまで足す
| ^
| ;
a.cc: In static member function 'static void Hello::main(int*)':
a.cc:8:9: error: 'Scanner' was not declared in this scope
8 | Scanner scan = new Scanner(System.in);
| ^~~~~~~
a.cc:10:13: error: 'scan' was not declared in this scope
10 | x = scan.nextInt();
| ^~~~
a.cc:20:9: error: 'System' was not declared in this scope
20 | System.out.println(sum);
| ^~~~~~
a.cc: In static member function 'static void Hello::print()':
a.cc:24:9: error: 'System' was not declared in this scope
24 | System.out.println("hello world");
| ^~~~~~
|
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 result = 0;
for (int i= 0; i < N; i++) {
scanf("%d", a + i);
}
b_dbl = array_sum(a, N) / N;
b = int(b_dbl + 0.5);
for (int i = 0; i < N; i++) {
result += (*(a + i) - b) * (*(a + i) - b);
}
printf("%d\n", result);
return 0;
}
|
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>'; this is probably fixable by adding '#include <cstdio>'
+++ |+#include <cstdio>
1 |
|
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 identifier
a.cc:7:1: error: extended character is not valid in an identifier
7 | cout<<a*(a+1)/2<<endl;
| ^
a.cc:7:1: error: extended character is not valid in an identifier
a.cc:8:1: error: extended character is not valid in an identifier
8 | return 0;
| ^
a.cc:8:1: error: extended character is not valid in an identifier
a.cc: In function 'int main()':
a.cc:5:1: error: '\U00003000\U00003000int' was not declared in this scope
5 | int a;
| ^~~~~~~
a.cc:6:1: error: '\U00003000\U00003000cin' was not declared in this scope
6 | cin>>a;
| ^~~~~~~
a.cc:6:10: error: 'a' was not declared in this scope
6 | cin>>a;
| ^
a.cc:7:1: error: '\U00003000\U00003000cout' was not declared in this scope
7 | cout<<a*(a+1)/2<<endl;
| ^~~~~~~~
a.cc:8:1: error: '\U00003000\U00003000return' was not declared in this scope
8 | return 0;
| ^~~~~~~~~~
|
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;
for (int i=0; i-1<N; i++){
candy = candy +i ;
}
System.out.println(candy);
}
}
|
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:4:1: error: expected unqualified-id before 'public'
4 | public class Main {
| ^~~~~~
|
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 int index)
{
vector.erase(vector.begin() + index);
}
using namespace std;
ll ans = 0, sum = 0, n, k, t;
string s;
map<ll, ll> m;
int main() {
cin >> n;
cout << n*(n + 1) / 2 << endl;
}
|
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>
7 | const long long INF = LLONG_MAX / 2;
|
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;
return 0;
}
|
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 standard input
| ^~~
a.cc:6:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
6 | 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:6:12: error: 'n' cannot be used as a function
6 | cout << n(n-1)/2 << endl;
| ~^~~~~
a.cc:6:23: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
6 | 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)
| ^~~~
|
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:14:4: note: each undeclared identifier is reported only once for each function it appears in
|
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 '__attribute__' at end of input
5 | end
| ^~~
|
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 ++){
result += i;
}
System.out.print(result);
}
}
|
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
2 errors
|
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 record expected
for(int i = 1 ; i <= input ; i ++){
^
Main.java:4: error: class, interface, enum, or record expected
for(int i = 1 ; i <= input ; i ++){
^
Main.java:6: error: class, interface, enum, or record expected
}
^
5 errors
|
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;
}
System.out.print(result);
|
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);
^
Main.java:2: error: unnamed class should not have package declaration
package coder;
^
3 errors
|
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[] 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;
}
System.out.print(result);
}
}
|
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??)
^
Main.java:2: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String args??)
^
(use --enable-preview to enable unnamed classes)
Main.java:5: error: class, interface, enum, or record expected
for(student_num=0;student_num?N; student_num++)?
^
Main.java:5: error: illegal character: '\uff1c'
for(student_num=0;student_num?N; student_num++)?
^
Main.java:5: error: class, interface, enum, or record expected
for(student_num=0;student_num?N; student_num++)?
^
Main.java:5: error: illegal character: '\uff5b'
for(student_num=0;student_num?N; student_num++)?
^
Main.java:7: error: illegal character: '\uff5d'
?
^
Main.java:8: error: class, interface, enum, or record expected
System.out.println(candySum);
^
Main.java:9: error: illegal character: '\uff5d'
?
^
Main.java:9: error: reached end of file while parsing
?
^
12 errors
|
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??)
^
Main.java:2: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String args??)
^
(use --enable-preview to enable unnamed classes)
Main.java:5: error: class, interface, enum, or record expected
for(student_num=0 ,student_num?N, student_num++)?
^
Main.java:5: error: illegal character: '\uff1c'
for(student_num=0 ,student_num?N, student_num++)?
^
Main.java:5: error: illegal character: '\uff5b'
for(student_num=0 ,student_num?N, student_num++)?
^
Main.java:7: error: illegal character: '\uff5d'
?
^
Main.java:8: error: class, interface, enum, or record expected
System.out.println(candySum);
^
Main.java:9: error: illegal character: '\uff5d'
?
^
Main.java:9: error: reached end of file while parsing
?
^
11 errors
|
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.readLine();
int N = Integer.parseInt(str);
int h = 0;
while(N > 0){
h = h + N;
N--;
}
System.out.println(N);
}catch(IOException e){
System.out.println(e);
}
}
}
|
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 BuffredReader
location: class ChildrenCandies
2 errors
|
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--;
}
System.out.println(N);
}catch(IOException e){
System.out.println(e);
}
}
}
|
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 BuffredReader
location: class ChildrenCandies
2 errors
|
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>
+++ |+#include <cstring>
2 | #include<string>
|
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<<endl;
return 0;
}
|
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: variable n
location: class Main
3 errors
|
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(is);
System.out.print("人数を入力:");
String str=reader.readLine();
int N =Integer.parseInt(str);
for(int i=1;i<=N;i++){
sum = sum + i;
}
System.out.println("必要なキャンディーは:"+sum);
}
}
|
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++)
#define pb push_back
#define pf push_front
#define sec second
#define sz(x) ((int)(x).size())
#define ALL( c ) (c).begin(), (c).end()
#define gcd(a,b) __gcd(a,b)
#define mem(x,n) memset(x,n,sizeof(x))
#define endl "\n"
using namespace std;
template <int POS, class TUPLE> void deploy(std::ostream &os, const TUPLE &tuple){}
template <int POS, class TUPLE, class H, class ...Ts> void deploy(std::ostream &os, const TUPLE &t){ os << (POS == 0 ? "" : ", ") << get<POS>(t); deploy<POS + 1, TUPLE, Ts...>(os, t); }
template <class T,class U> std::ostream& operator<<(std::ostream &os, std::pair<T,U> &p){ os << "(" << p.first <<", " << p.second <<")";return os; }
template <class T> std::ostream& operator<<(std::ostream &os, std::vector<T> &v){ int remain = v.size(); os << "{"; for(auto e: v) os << e << (--remain == 0 ? "}" : ", "); return os; }
template <class T> std::ostream& operator<<(std::ostream &os, std::set<T> &v){ int remain = v.size(); os << "{"; for(auto e: v) os << e << (--remain == 0 ? "}" : ", "); return os; }
template <class T, class K> std::ostream& operator<<(std::ostream &os, std::map<T, K> &mp){ int remain = mp.size(); os << "{"; for(auto e: mp) os << "(" << e.first << " -> " << e.second << ")" << (--remain == 0 ? "}" : ", "); return os; }
#define DEBUG1(var0) { std::cerr << (#var0) << "=" << (var0) << endl; }
#define DEBUG2(var0, var1) { std::cerr << (#var0) << "=" << (var0) << ", ";DEBUG1(var1); }
#define DEBUG3(var0, var1, var2) { std::cerr << (#var0) << "=" << (var0) << ", ";DEBUG2(var1,var2); }
#define DEBUG4(var0, var1, var2, var3) { std::cerr << (#var0) << "=" << (var0) << ", ";DEBUG3(var1,var2,var3); }
using ll = long long;
int main()
{
cin.tie(0);
ios_base::sync_with_stdio(0);
cout << N * (N+1) / 2 << endl;
return 0;
}
|
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:1:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
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 input
| ^~~
a.cc:5:1: 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:22: 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)
| ^~~~
|
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);
| ^~~~~~~~~~~~
main.c:5:22: note: each undeclared identifier is reported only once for each function it appears in
|
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 * (N+1) / 2 << endl;
| ^~~~
a.cc:6:34: error: 'endl' was not declared in this scope
6 | cout << N * (N+1) / 2 << endl;
| ^~~~
|
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
// aaqwertyuiop:最初
static String line;
static int N;
public static void main(String args[]) throws NumberFormatException, IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
line = br.readLine();
String text[] = line.split("");
N = text.length;
method(text);
}
static void method(String text[]) {
for (int i = 0; i < text.length - 2; i++) {
if (text[i].equals(text[i + 2])) {
i++;
System.out.println(i + " " + (i + 2));
return;
}
}
for (int i = 0; i < text.length - 1; i++) {
if (text[i].equals(text[i + 1])) {
i++;
System.out.println(i + " " + (i + 1));
return;
}
}
System.out.println("-1 -1");
}
}
|
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 <utility>
#include <vector>
#include <list>
using namespace std;
typedef long long ll;
#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(ll i=(a);i<(b);++i)
#define clr(a, b) memset((a), (b) ,sizeof(a))
#define ctos(d) string(1,d)
#define print(x) cout<<#x<<" = "<<x<<endl;
#define MOD 1000000007
int main() {
ll n;
cin>>n;
cout << n*(n+1)/2 << endk;
return 0;
}
|
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 input
| ^~~
a.cc:6:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
6 | cout << a * (a -1 ) /2;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
|
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 < j; k++) printf("%c", r[k]);
return 0;
}
|
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, r[j] = '\0'; k < j; k++) printf("%c", r[k]);
}
return 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;
S2[j - 1] = 0;
}
if ( S[i] == 1) {
j = j + 1;
S2[j - 1] = 1;
}
if ( S[i] == 'B') {
j = j - 1;
}
printf("%s\n",S2);
return 0;
}
|
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 end of input
34 | }
| ^
|
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.out.println(result);
}
}
|
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 | var n = int.Parse(Console.ReadLine());
| ^~~
a.cc:6:21: error: expected ';' before 'a'
6 | var a = 0;
| ^
a.cc:7:36: error: 'n' was not declared in this scope
7 | for(int i = 1;i <= n;i++) {
| ^
a.cc:8:25: error: 'a' was not declared in this scope
8 | a += i;
| ^
a.cc:10:17: error: 'Console' was not declared in this scope
10 | Console.WriteLine(a);
| ^~~~~~~
a.cc:10:35: error: 'a' was not declared in this scope
10 | Console.WriteLine(a);
| ^
|
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.println();
}
public static void main(String[] args) throws Exception {
new Main().run();
}
MyScanner sc = null;
PrintWriter out = null;
public void run() throws Exception {
sc = new MyScanner(System.in);
out = new PrintWriter(System.out);
for (;sc.hasNext();) {
solve();
out.flush();
}
out.close();
}
class MyScanner {
String line;
BufferedReader reader;
StringTokenizer tokenizer;
public MyScanner(InputStream stream) {
reader = new BufferedReader(new InputStreamReader(stream));
tokenizer = null;
}
public void eat() {
while (tokenizer == null || !tokenizer.hasMoreTokens()) {
try {
line = reader.readLine();
if (line == null) {
tokenizer = null;
return;
}
tokenizer = new StringTokenizer(line);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}
public String next() {
eat();
return tokenizer.nextToken();
}
public String nextLine() {
try {
return reader.readLine();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
public boolean hasNext() {
eat();
return (tokenizer != null && tokenizer.hasMoreElements());
}
public int nextInt() {
return Integer.parseInt(next());
}
public long nextLong() {
return Long.parseLong(next());
}
public double nextDouble() {
return Double.parseDouble(next());
}
public int[] nextIntArray(int n) {
int[] a = new int[n];
for (int i = 0; i < n; i++) a[i] = nextInt();
return a;
}
}
}
|
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*(n + 1)/2);
}
}
|
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.