submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s807821614
p02259
C++
#include <iostream> #include "algorithm" using namespace std; int main() { int n; int *a; cin >> n; a = new int [n]; for ( int i = 0; i <n ; i++ ) { cin >> a[i] ; } int sw = 0; for (int i = 0; i < n; i++) { for (int j = n -1; j >= i + 1; j--) { if (a[j] < a...
a.cc: In function 'int main()': a.cc:26:27: error: expected ';' before 'cout' 26 | if (i) cout << " " | ^ | ; 27 | cout << a[i] ; | ~~~~
s075640409
p02259
C++
using System; using System.Collections.Generic; using System.Linq; namespace Aizu { class Program { static void Main(string[] args) { var n = int.Parse(Console.ReadLine()); var data = Console.ReadLine().Split(' ').Select(d => int.Parse(d)).ToList<int>(); int...
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:2:7: error: expected nested-name-specifier before 'System' 2 | using System.Collections.Generic; | ^~~~~~ a.cc:3:7: error: expected nested-name-specifier before 'System' 3 | using System.L...
s173679892
p02259
C++
using System; using System.Collections.Generic; using System.Linq; namespace Aizu { class Program { static void Main(string[] args) { var n = int.Parse(Console.ReadLine()); var data = Console.ReadLine().Split(' ').Select(d => int.Parse(d)).ToList<int>(); int...
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:2:7: error: expected nested-name-specifier before 'System' 2 | using System.Collections.Generic; | ^~~~~~ a.cc:3:7: error: expected nested-name-specifier before 'System' 3 | using System.L...
s045954116
p02259
C++
using System; using System.Collections.Generic; using System.Linq; namespace Aizu { class Program { static void Main(string[] args) { var n = int.Parse(Console.ReadLine()); var data = Console.ReadLine().Split(' ').Select(d => int.Parse(d)).ToList<int>(); int...
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:2:7: error: expected nested-name-specifier before 'System' 2 | using System.Collections.Generic; | ^~~~~~ a.cc:3:7: error: expected nested-name-specifier before 'System' 3 | using System.L...
s193219291
p02259
C++
#include<stdio.h> int main(){ int A[100], n, i, j, t, sw = 0 scanf("%d", &n); for ( i = 0; i < n; i++ ) scanf("%d", &A[i]); for ( i = 0; i < n; i++ ){ for ( j = n-1; j >= i+1; j-- ){ if ( A[j] < A[j-1] ){ t = A[j]; A[j] = A[j-1]; A[j-1] = t; sw++; } } } for ( i = 0; i < n; i++ ){ ...
a.cc: In function 'int main()': a.cc:6:3: error: expected ',' or ';' before 'scanf' 6 | scanf("%d", &n); | ^~~~~
s287482830
p02259
C++
#include<stdio.h> int main(){ int A[100], n, i, j, t, sw = 0 scanf("%d", &n); for ( i = 0; i < n; i++ ) scanf("%d", &A[i]); for ( i = 0; i < n; i++ ){ for ( j = n-1; j >= i+1; j-- ){ if ( A[j] < A[j-1] ){ t = A[j]; A[j] = A[j-1]; A[j-1] = t; sw++; } } } for ( i = 0; i < n; i++ ){ ...
a.cc: In function 'int main()': a.cc:6:3: error: expected ',' or ';' before 'scanf' 6 | scanf("%d", &n); | ^~~~~
s202450388
p02259
C++
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s629678289
p02259
C++
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s749399610
p02259
C++
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s405698261
p02259
C++
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s773621116
p02259
C++
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s003043779
p02259
C++
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s390151249
p02259
C++
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s697744200
p02259
C++
#include<stdio.h> int main(){ int A[100], n, i, j, t, sw = 0 scanf("%d", &n); for ( i = 0; i < n; i++ ) scanf("%d", &A[i]); for ( i = 0; i < n; i++ ){ for ( j = n-1; j >= i+1; j-- ){ if ( A[j] < A[j-1] ){ t = A[j]; A[j] = A[j-1]; A[j-1] = t; sw++; } } } for ( i = 0; i < n; i++ ){ ...
a.cc: In function 'int main()': a.cc:6:3: error: expected ',' or ';' before 'scanf' 6 | scanf("%d", &n); | ^~~~~
s793716582
p02259
C++
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s353359733
p02259
C++
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s605458092
p02259
C++
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s933623038
p02259
C++
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s596040896
p02259
C++
#include <bits/stdc++.h> using namespace std; int main() { int num; cin>>num; int a[num]; int tmp=0; for(int i=0;i<num;i++) cin>>a[i]; for(int i=0;i<num;i++) {for(int j=num-1;j>i;j--) if(a[j]>a[j-1]) {swap(a[j],a[j-1]) tmp+=1;} } for(int ...
a.cc: In function 'int main()': a.cc:14:29: error: expected ';' before 'tmp' 14 | {swap(a[j],a[j-1]) | ^ | ; 15 | tmp+=1;} | ~~~
s043702916
p02259
C++
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s333140915
p02259
C++
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s533410968
p02259
C++
#include<iostream> using namespace std; //flag を用いたバブルソート int bubbleSort(int A[],int N){ int sw = 0; bool flag = 1; for (int i = 0; flag; i++){ flag = 0; for( int j = N - 1; j >= i + 1; j--){ if( A[j] < A[j - 1]){ //隣接要素を交換する。 swap(A[j],A[j - 1]); flag = 1; sw++; } } } return sw;...
a.cc: In function 'int main()': a.cc:34:11: error: 'end1' was not declared in this scope 34 | cout << end1; | ^~~~
s360531454
p02259
C++
#include<iostream> using namespace std; //flag を用いたバブルソート int bubbleSort(int A[],int N){ int sw = 0; bool flag = 1; for (int i = 0; flag; i++){ flag = 0; for( int j = N - 1; j >= i + 1; j--){ if( A[j] < A[j - 1]){ //隣接要素を交換する。 swap(A[j],A[j - 1]); flag = 1; sw++; } } } return sw;...
a.cc: In function 'int main()': a.cc:34:11: error: 'end1' was not declared in this scope 34 | cout << end1; | ^~~~
s320164335
p02259
C++
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s901085654
p02259
C++
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s435730392
p02259
C++
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s297463374
p02259
C++
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s992431510
p02259
C++
include<iostream> using namespace std; int Bsort(int A[],int N){ int x=0; bool flag=1; for(int i=0;flag;i++) { flag=0; for(int j=N-1;j>=i+1;j--) { if(A[j]<A[j-1]) { swap(A[j],A[j-1]); flag=1; x++; } } }...
a.cc:1:1: error: 'include' does not name a type 1 | include<iostream> | ^~~~~~~ a.cc: In function 'int Bsort(int*, int)': a.cc:13:15: error: 'swap' was not declared in this scope 13 | swap(A[j],A[j-1]); | ^~~~ a.cc: In function 'int main()': a.cc:24:3: error: 'cin' was not...
s673769182
p02259
C++
N = int(input()) l = input().split() l = [int(s) for s in l] count = 0 for j in range(N): for i in range(N-1): if( l[i] > l[i+1]): l[i], l[i+1] = l[i+1], l[i] count += 1 for i in range(0,len(l)-1): print(l[i],end=' ') print(l[N-1]) print(count)
a.cc:1:1: error: 'N' does not name a type 1 | N = int(input()) | ^
s497111706
p02259
C++
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s910886724
p02259
C++
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s997634227
p02259
C++
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s186366058
p02259
C++
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s610471168
p02259
C++
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s476833844
p02259
C++
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s608127464
p02259
C++
#include<iostream> using namespace std; // flagを用いたバブルソート int bubbleSort(int A[], int N) { int sw_cnt = 0; bool flag = 1; // 1:未完了 | 0:完了 // iを増やしながら、flagの値によるwhileをforで再現 for (int i = 0; flag; i++) { // 何もなければ完了とする flag = 0; //iが下から迫り、jが上から迫るので、徐々に探索範囲は狭まる for (int j = N - 1; j >= i + 1; j--) ...
a.cc: In function 'int bubbleSort(int*, int)': a.cc:22:10: error: 'sw' was not declared in this scope 22 | return sw | ^~ a.cc:22:12: error: expected ';' before '}' token 22 | return sw | ^ | ; 23 | } | ~
s215664809
p02259
C++
#include<iostream> using namespace std; // flagを用いたバブルソート int bubbleSort(int A[], int N) { int sw_cnt = 0; bool flag = 1; // 1:未完了 | 0:完了 // iを増やしながら、flagの値によるwhileをforで再現 for (int i = 0; flag; i++) { // 何もなければ完了とする flag = 0; //iが下から迫り、jが上から迫るので、徐々に探索範囲は狭まる for (int j = N - 1; j >= i + 1; j--) ...
a.cc: In function 'int bubbleSort(int*, int)': a.cc:22:10: error: 'sw' was not declared in this scope 22 | return sw | ^~ a.cc:22:12: error: expected ';' before '}' token 22 | return sw | ^ | ; 23 | } | ~
s032387242
p02259
C++
#include<iostream> using namespace std; // flagを用いたバブルソート int bubbleSort(int A[], int N) { int sw_cnt = 0; bool flag = 1; // 1:未完了 | 0:完了 // iを増やしながら、flagの値によるwhileをforで再現 for (int i = 0; flag; i++) { // 何もなければ完了とする flag = 0; //iが下から迫り、jが上から迫るので、徐々に探索範囲は狭まる for (int j = N - 1; j >= i + 1; j--) ...
a.cc: In function 'int bubbleSort(int*, int)': a.cc:22:10: error: 'sw' was not declared in this scope 22 | return sw | ^~ a.cc:22:12: error: expected ';' before '}' token 22 | return sw | ^ | ; 23 | } | ~
s985171068
p02259
C++
#include<iostream> using namespace std; int bubbleSort(int p[],int n) { // int flag=1; int count=0; for(int i=0;i<n-1;i++){ // if(!flag)break; // flag=0; for(int j=n-1;j>i;j--) if(p[j]<p[j-1]){ flag=1; int t=p[j]; p[j]=p[j-1]; ...
a.cc: In function 'int bubbleSort(int*, int)': a.cc:12:16: error: 'flag' was not declared in this scope 12 | flag=1; | ^~~~
s662335008
p02259
C++
import java.io.*; import java.util.*; class Main{ public static void main(String[] args) throws Exception{ int i = 0; int tmp; int Count_Sort = 0; boolean flag = true; BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String N_str = br.readLine(); int N = Integer.parseInt(N_str); ...
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.*; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:5:11:...
s140790765
p02259
C++
#include <stdio.h> int main() { int N; int temp; int flag; int count = 0; int A[1000] = {}; scanf("%d", &N); for(int i = 0; i < N; i++) { scanf("%d", &A[i]); } while(flag) { flag = 0; for(int i = 0; i < N-1; i++) { if(A[i] > A[i+1]) { temp = A[i+1]; A[i+1] = A[i]; A[i] = temp; flag...
a.cc: In function 'int main()': a.cc:30:39: error: invalid conversion from 'const char*' to 'int' [-fpermissive] 30 | if(i != N-1) putchar(" "); | ^~~ | | | const char*...
s046570871
p02259
C++
#include<iostream> #include<vector> using namespace std; int main(){ int n; cin>>n; vector<int> a(n); for(int i=0;i<n;i++) cin>>a[i]; int count = 0; for(int i=n-1;i>0;i—){ for(int j=i;j>0;j—){ if(a[j] < a[j-1]){ sawp(a[j] , a[j-1]); ...
a.cc:11:23: error: extended character — is not valid in an identifier 11 | for(int i=n-1;i>0;i—){ | ^ a.cc:12:26: error: extended character — is not valid in an identifier 12 | for(int j=i;j>0;j—){ | ^ a.cc: In function 'int main()': a.cc:11:...
s743445856
p02259
C++
#include<iostream> #include<vector> using namespace std; int main(){ int n; cin>>n; vector<int> a(n); for(int i=0;i<n;i++) cin>>a[i]; int count = 0; for(int i=n-1;i>0;i−−){ for(int j=i;j>0;j−−){ if(a[j] < a[j-1]){ sawp(a[j] , a[j-1]); ...
a.cc:11:23: error: extended character − is not valid in an identifier 11 | for(int i=n-1;i>0;i−−){ | ^ a.cc:11:23: error: extended character − is not valid in an identifier a.cc:12:26: error: extended character − is not valid in an identifier 12 | for(int j=i;j>0;j−−){ ...
s126086255
p02259
C++
#include<iostream> #include<vector> using namespace std; int main(){ int n; cin>>n; vector<int> a(n); for(int i=0;i<n;i++) cin>>a[i]; int count = 0; for(int i=0;i<n-1;i++){ for(int j=i;j<n-1;j++){ if(a[j] > a[j+1]){ sawp(a[j] , a[jj+1]); ...
a.cc: In function 'int main()': a.cc:14:35: error: 'jj' was not declared in this scope; did you mean 'j'? 14 | sawp(a[j] , a[jj+1]); | ^~ | j a.cc:14:21: error: 'sawp' was not declared in this scope 14 | ...
s285409223
p02259
C++
#include<iostream> #include<vector> using namespace std; int main(){ int n; cin>>n; vector<int> a(n); for(int i=0;i<n;i++) cin>>a[i]; int count = 0; for(int i=0;i<n-1;i++){ for(int j=i;j<n-1;j++){ if(a[j] > a[j+1]){ sawp(a[j] , a[j+1]); ...
a.cc: In function 'int main()': a.cc:14:21: error: 'sawp' was not declared in this scope 14 | sawp(a[j] , a[j+1]); | ^~~~
s164627032
p02259
C++
#include<iostream> using namespace std; #define MAX 100 int BubbleSort(int x[],int n); int main(){ int i,N,count; int x[MAX] = {0} ; cin >> N ; for(i=0;i<N;i++){ cin >> x[i] ; } count = BubbleSort(y,N); for(i=0;i<N;i++){ if(i<(N-2))cout << x[i] << ' ' ; if(i == (N-1))cout << x[i] << endl ; } cout ...
a.cc: In function 'int main()': a.cc:16:28: error: 'y' was not declared in this scope 16 | count = BubbleSort(y,N); | ^
s714555808
p02259
C++
#include<iostream> using namespace std; #define MAX 100 int BubbleSort(int x[],int n); int main(){ int i,N,count; int x[MAX] = {0} ; cin >> N ; for(i=0;i<N;i++){ cin >> x[i] ; } count = BubbleSort(y,N); for(i=0;i<N;i++){ if(i<(N-2))cout << x[i] << ' ' ; if(i == (N-1))cout << x[i] << endl ; } cout ...
a.cc: In function 'int main()': a.cc:16:28: error: 'y' was not declared in this scope 16 | count = BubbleSort(y,N); | ^
s938062337
p02259
C++
#include<iostream> using namespace std; #define MAX 100 int BubbleSort(int x[],int n); int main(){ int i,N,count; int x[MAX] = {0} ; cin >> N ; for(i=0;i<N;i++){ cin >> x[i] ; } count = BubbleSort(y,N); for(i=0;i<N;i++){ if(i<(N-2))cout << x[i] << ' ' ; if(i == (N-1))cout << x[i] << endl ; } cout ...
a.cc: In function 'int main()': a.cc:16:28: error: 'y' was not declared in this scope 16 | count = BubbleSort(y,N); | ^
s610181472
p02259
C++
#include<iostream> using namespace std; #define MAX 100 int BubbleSort(int x[],int n); int main(){ int i,N,count; int x[MAX] = {0} ; cin >> N ; for(i=0;i<N;i++){ cin >> x[i] ; } count = BubbleSort(y,N); for(i=0;i<N;i++){ if(i<(N-2))cout << x[i] << ' ' ; if(i == (N-1))cout << x[i] << endl ; } cout ...
a.cc: In function 'int main()': a.cc:16:28: error: 'y' was not declared in this scope 16 | count = BubbleSort(y,N); | ^
s403445159
p02259
C++
#include<iostream> using namespace std; #define MAX 100 int BubbleSort(int x[],int n); int main(){ int i,N,count; int x[MAX] = {0} ; cin >> N ; for(i=0;i<N;i++){ cin >> x[i] ; } count = BubbleSort(y,N); for(i=0;i<N;i++){ if(i<(N-2))cout << x[i] << ' ' ; if(i == (N-1))cout << x[i] << endl ; } cout ...
a.cc: In function 'int main()': a.cc:16:28: error: 'y' was not declared in this scope 16 | count = BubbleSort(y,N); | ^
s823511302
p02259
C++
#include<iostream> using namespace std; #define MAX 100 int BubbleSort(int x[],int n); int main(){ int i,N,count; int x[MAX] = {0} ; cin >> N ; for(i=0;i<N;i++){ cin >> x[i] ; } count = BubbleSort(y,N); for(i=0;i<N;i++){ if(i<(N-2))cout << x[i] << ' ' ; if(i == (N-1))cout << x[i] << endl ; } cout ...
a.cc: In function 'int main()': a.cc:16:28: error: 'y' was not declared in this scope 16 | count = BubbleSort(y,N); | ^
s594919894
p02259
C++
#include<iostream> using namespace std; #define MAX 100 int BubbleSort(int x[],int n); int main(){ int i,N,count; int x[MAX] = {0} ; cin >> N ; for(i=0;i<N;i++){ cin >> x[i] ; } count = BubbleSort(y,N); for(i=0;i<N;i++){ if(i<(N-2))cout << x[i] << ' ' ; if(i == (N-1))cout << x[i] << endl ; } cout ...
a.cc: In function 'int main()': a.cc:16:28: error: 'y' was not declared in this scope 16 | count = BubbleSort(y,N); | ^
s558361702
p02259
C++
#include<iostream> using namespace std; #define MAX 100 int BubbleSort(int x[],int n); int main(){ int i,N,count; int x[MAX] = {0} ; cin >> N ; for(i=0;i<N;i++){ cin >> x[i] ; } count = BubbleSort(y,N); for(i=0;i<N;i++){ if(i<(N-2))cout << x[i] << ' ' ; if(i == (N-1))cout << x[i] << endl ; } cout ...
a.cc: In function 'int main()': a.cc:16:28: error: 'y' was not declared in this scope 16 | count = BubbleSort(y,N); | ^
s272341204
p02259
C++
#include<cstdio> #include<algorithm> using namespace std; int main(){ int N; cin >> N; int array[N]; for(int i = 0; i <N; i++) cin >> array[i]; int cnt = 0; for(int i = 0; i <= N-1; i++){ for(int j = N-1; j >= i+1; j--){ if(array[j] < array[j-1]) { swap(array[j], array[j-1]); cnt++; } } } ...
a.cc: In function 'int main()': a.cc:8:9: error: 'cin' was not declared in this scope 8 | cin >> N; | ^~~ a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 2 | #include<algorithm> +++ |+#include <iostream> 3 |
s358552834
p02259
C++
#include<iostream> using namespace std; int main() { int n,a[100],ans=0; cin >> n; for(int i=0;i<n;i++)cin >> a[i]; for(int i=0;i<n;i++){ for(int j=n-1;j>=i+1;j--){ if(a[j]<a[j-1]){swap(a[j],a[j-1]); } } for(int i=0;i<n;i++){ if(i==n-1)cout << a[i] << "\n"; else cout << a[i] << " "; } cout << ans << "\n"; return 0; }
a.cc: In function 'int main()': a.cc:19:2: error: expected '}' at end of input 19 | } | ^ a.cc:4:1: note: to match this '{' 4 | { | ^
s770491920
p02260
Java
import java.util.Scanner; public class SelectionSort { private static int N_MAX = 99999; static int[] a = new int[N_MAX]; public static void main(String[] args){ Scanner scan = new Scanner(System.in); int n; n = scan.nextInt(); int ans = 0; for (int i = 0; i < n; i++){ a[i]= scan.nextInt(); }...
Main.java:2: error: class SelectionSort is public, should be declared in a file named SelectionSort.java public class SelectionSort { ^ 1 error
s904431047
p02260
Java
import java.util.Scanner; public class SelectionSort { private static int N_MAX = 99999; static int[] a = new int[N_MAX]; public static void main(String[] args){ Scanner scan = new Scanner(System.in); int n; n = scan.nextInt(); int ans = 0; for (int i = 0; i < n; i++){ a[i]= scan.nextInt(); }...
Main.java:2: error: class SelectionSort is public, should be declared in a file named SelectionSort.java public class SelectionSort { ^ 1 error
s850245623
p02260
Java
import java.util.Scanner; public class SelectionSort { private static int N_MAX = 99999; static int[] a = new int[N_MAX]; public static void main(String[] args){ Scanner scan = new Scanner(System.in); int n; n = scan.nextInt(); int ans = 0; for (int i = 0; i < n; i++){ a[i]= scan.nextInt(); }...
Main.java:2: error: class SelectionSort is public, should be declared in a file named SelectionSort.java public class SelectionSort { ^ 1 error
s020669856
p02260
Java
import java.util.Scanner; public class SelectionSort{ private static int N_MAX = 99999; static int[] a = new int[N_MAX]; public static void main(String[] args){ Scanner scan = new Scanner(System.in); int n; n = scan.nextInt(); int ans = 0; for (int i = 0; i < n; i++){ a[i]= scan.nextInt(); ...
Main.java:2: error: class SelectionSort is public, should be declared in a file named SelectionSort.java public class SelectionSort{ ^ 1 error
s032864345
p02260
Java
import java.util.Arrays; public class Main { int[] random(int n) { int[] a = new int[n]; for(int i = 0; i < n; i++) { a[i] = (int)(Math.random() * 1000); } return a; } void swap(int[] a, int i, int j) { int temp = a[i]; a[i] = a...
Main.java:22: error: reached end of file while parsing } ^ 1 error
s263700740
p02260
Java
import java.util.Arrays;public class Main { int[] random(int n) { int[] a = new int[n]; for(int i = 0; i < n; i++) { a[i] = (int)(Math.random() * 1000); } return a; } void swap(int[] a, int i, int j) { int temp = a[i]; a[i] = a[j]; a[j] = temp; } void bubbleSort(int[] a) { ...
Main.java:36: error: class, interface, enum, or record expected } ^ 1 error
s629942420
p02260
Java
import java.util.Arrays;public class Main { int[] random(int n) { int[] a = new int[n]; for(int i = 0; i < n; i++) { a[i] = (int)(Math.random() * 1000); } return a; } void swap(int[] a, int i, int j) { int temp = a[i]; a[i] = a[j]; a[j] = temp; } void bubbleSort(int[] a) { ...
Main.java:36: error: class, interface, enum, or record expected } ^ 1 error
s217512453
p02260
Java
package day6; import java.util.Arrays;public class Main { int[] random(int n) { int[] a = new int[n]; for(int i = 0; i < n; i++) { a[i] = (int)(Math.random() * 1000); } return a; } void swap(int[] a, int i, int j) { int temp = a[i]; a[i] = a[j]; a[j] = temp; } void bubbleSort(i...
Main.java:37: error: class, interface, enum, or record expected } ^ 1 error
s267686404
p02260
Java
import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main102b { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader b...
Main.java:8: error: class Main102b is public, should be declared in a file named Main102b.java public class Main102b { ^ 1 error
s289514149
p02260
Java
import java.io.*; import java.util.*; /* SelectionSort(A) 1 for i = 0 to A.length-1 2 mini = i 3 for j = i to A.length-1 4 if A[j] < A[mini] 5 mini = j 6 swap A[i] and A[mini] 入力例 1 5 5 3 2 4 1 */ public class Main{ public static void main(String args[]){ Scanner scan = new Sca...
Main.java:24: error: cannot find symbol BubbleSort sort = new BubbleSort(scan.nextInt()); ^ symbol: class BubbleSort location: class Main Main.java:24: error: cannot find symbol BubbleSort sort = new BubbleSort(scan.nextInt()); ^ symbol: class BubbleSort location: class Main 2 ...
s324215740
p02260
Java
a
Main.java:1: error: reached end of file while parsing a ^ 1 error
s959185430
p02260
Java
public class Main { Scanner sc = new Scanner(System.in); StringBuilder out; void run() { int N = sc.nextInt(); int[] A = new int[N]; for (int i = 0; i < A.length; i++) { A[i] = sc.nextInt(); } int cnt = 0; for (int i = 0; i < N; i++) { boolean swap = false; int min = i; for (int j = i + 1; ...
Main.java:2: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:2: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s000206452
p02260
Java
import java.io.BufferedReader; import java.io.InputStreamReader; public class ALDS1_2_B { public static void main(String[] args) throws Exception { BufferedReader breader = getReader(); int n = getInt(breader); int[] num = getAry(breader); int snum = 0; for(int i = 0; i < n ; i++ ) { int mini=i; for...
Main.java:4: error: class ALDS1_2_B is public, should be declared in a file named ALDS1_2_B.java public class ALDS1_2_B { ^ 1 error
s804092775
p02260
Java
import java.io.*; import java.util.StringTokenizer; class Main{ static final PrintWriter out=new PrintWriter(System.out); static int ans=0; public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line=""; while((line=br.readLine())!...
Main.java:29: error: cannot find symbol for(int i=0;i<n;i++){ ^ symbol: variable n location: class Main Main.java:31: error: cannot find symbol for(int j=i;j<n;j++){ ^ symbol: variable n location: class Main 2 errors
s568500824
p02260
Java
import java.io.*; public class Main { public static void main(String[] args) { try { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); int count = Integer.parseInt(in.readLine()); int[] iArr; String[] sArr = in.readLine().split(" "); for(int i=0; i<sArr.lengt...
Main.java:11: error: variable iArr might not have been initialized iArr[i] = Integer.parseInt(sArr[i]); ^ Main.java:14: error: variable iArr might not have been initialized for(int i = 0; i < iArr.length-1; i++) { ^ 2 errors
s683216476
p02260
Java
??? import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int N = scan.nextInt(); int[] A = new int[N]; for (int i = 0; i < N; i++) { A[i] = scan.nextInt(); } selectionSrot(A, N); scan.close(); } pub...
Main.java:1: error: class, interface, enum, or record expected ??? ^ Main.java:4: error: class, interface, enum, or record expected import java.util.Scanner; ^ 2 errors
s740846595
p02260
Java
import java.lang.StringBuilder; import java.lang.Math; public class Main { private static int N; private static int[] a; private static void print() { StringBuilder result = new StringBuilder(); for (int i = 0; i < N; i++) { result.append(a[i]); result.append(" "); } System.out.print...
Main.java:45: error: cannot find symbol Scanner in = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:45: error: cannot find symbol Scanner in = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s555444891
p02260
Java
import java.util.Scanner; /** * Created by ??\??? on 2016/12/6. */ public class ALDS1_2_B { static int si(String s){ return Integer.parseInt(s); } static int run(String[] args){ Scanner scan = new Scanner(System.in); int T = si(scan.nextLine()); int sum = 0; Stri...
Main.java:6: error: class ALDS1_2_B is public, should be declared in a file named ALDS1_2_B.java public class ALDS1_2_B { ^ 1 error
s835445272
p02260
Java
import java.util.*; public class Main{ private static final Scanner scan = new Scanner(System.in); public static void main(String[] args){ int n = scan.nextInt(); int[] arr = new int[n]; for(int i = 0; i < n; i++){ arr[i] = scan.nextInt(); } int count = 0; for(int i = 0; i < n; i++){ int minj = i...
Main.java:21: error: ';' expected int small = arr[minj] ^ 1 error
s420031954
p02260
Java
mport java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws Exception { int count = 0; Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] array = new int[n]; for(int i = 0; i<n; i++){ arr...
Main.java:1: error: class, interface, enum, or record expected mport java.io.*; ^ Main.java:2: error: class, interface, enum, or record expected import java.util.*; ^ 2 errors
s818398782
p02260
Java
import java.util.Scanner; public class Main { static Scanner sc = new Scanner(System.in); static void checkArray(int[] a){ int i ; for( i = 0; i < a.length -1; i++){ System.out.print(a[i] +" "); } System.out.print(a[i]); System.out.println(); } ...
Main.java:55: error: reached end of file while parsing } ^ 1 error
s614194607
p02260
Java
import java.util.Scanner; public class bh { public static void main(String[] arges) { Scanner sc = new Scanner(System.in); String line = sc.nextLine(); int v = Integer.parseInt(line); int[] vs = new int[v]; String line2 = sc.nextLine(); String[] k = line2.split(" "); for (int i = 0; i < v; i++) { vs...
Main.java:3: error: class bh is public, should be declared in a file named bh.java public class bh { ^ 1 error
s835038219
p02260
Java
import java.util.List; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; class Main { int count = 0; public static void main(String[] args) { InputOutput stdIO = new InputOutput(); int n = stdIO.getValue(); List...
Main.java:21: error: cannot find symbol ALDS1_2_B_Selection_Sort my = new ALDS1_2_B_Selection_Sort(); ^ symbol: class ALDS1_2_B_Selection_Sort location: class Main Main.java:21: error: cannot find symbol ALDS1_2_B_Selection_Sort my = new ALDS1_2_B_Selection_Sort(); ^ sy...
s240033412
p02260
Java
import java.util.List; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; class Main { int count = 0; public static void main(String[] args) { InputOutput stdIO = new InputOutput(); int n = stdIO.getValue(); List<...
Main.java:20: error: cannot find symbol ALDS1_2_B_Selection_Sort my = new ALDS1_2_B_Selection_Sort(); ^ symbol: class ALDS1_2_B_Selection_Sort location: class Main Main.java:20: error: cannot find symbol ALDS1_2_B_Selection_Sort my = new ALDS1_2_B_Selection_Sort(); ^ sy...
s464033317
p02260
Java
import java.util.*; class Main{ public static void main(String args[]){ Scanner sc = new Scanner(System.in); int n = Integer.parseInt(sc.nextLine()); String[] line = sc.nextLine().split(" "); int[] arr = new int[n]; int temp; int count = 0; for(int x = 0; x <...
Main.java:40: error: reached end of file while parsing } ^ 1 error
s158973438
p02260
Java
import java.util.*; class Main{ public static void main(String args[]){ Scanner sc = new Scanner(System.in); int n = Integer.parseInt(sc.nextLine()); String[] line = sc.nextLine().split(" "); int[] arr = new int[n]; int temp; int count = 0; for(int x = 0; x <...
Main.java:41: error: illegal start of type ??? ^ Main.java:41: error: reached end of file while parsing ??? ^ 2 errors
s649109795
p02260
Java
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N[] = new int[100]; int n = sc.nextInt(); int m = 0; for (int i = 0; i < n; i++) N[i] = sc.nextInt(); for (int i = 0; i < n-1; i++) { int min = i; fo...
Main.java:12: error: cannot find symbol for (j = i+1; j < n; j++) { ^ symbol: variable j location: class Main Main.java:12: error: cannot find symbol for (j = i+1; j < n; j++) { ^ symbol: variable j location: class Main Main.java:12: error: cannot find symb...
s161151568
p02260
Java
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N[] = new int[100]; int n = sc.nextInt(); int m = 0; for (int i = 0; i < n; i++) N[i] = sc.nextInt(); for (int i = 0; i < n-1; i++) { int min = i; fo...
Main.java:12: error: cannot find symbol for (j = i+1; j < n; j++) { ^ symbol: variable j location: class Main Main.java:12: error: cannot find symbol for (j = i+1; j < n; j++) { ^ symbol: variable j location: class Main Main.java:12: error: cannot find symb...
s478503071
p02260
Java
import java.awt.datatransfer.FlavorEvent; import java.util.Scanner; import javax.sound.midi.SysexMessage; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); String str = sc.nextLine(); String str2[] = str.spl...
Main.java:28: error: cannot find symbol if(minj!=j){ ^ symbol: variable j location: class Main 1 error
s258899879
p02260
Java
import java.io.BufferedReader; import java.io.InputStreamReader; public class Contest { public static void main(String args[]) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String ns = br.readLine(); int n = Integer.parseInt(ns); String as = br.readLine(); S...
Main.java:4: error: class Contest is public, should be declared in a file named Contest.java public class Contest { ^ 1 error
s963751883
p02260
Java
import java.util.Scanner; public class _2_BSelectionSort { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int a[] = new int[n]; for (int i = 0; i < a.length; i++) { a[i]=sc.nextInt(); } int sum = 0; ...
Main.java:3: error: class _2_BSelectionSort is public, should be declared in a file named _2_BSelectionSort.java public class _2_BSelectionSort { ^ 1 error
s347471268
p02260
Java
import java.util.Scanner; public class _2_BSelectionSort { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int a[] = new int[n]; for (int i = 0; i < a.length; i++) { a[i] = sc.nextInt(); } int sum = 0; ...
Main.java:3: error: class _2_BSelectionSort is public, should be declared in a file named _2_BSelectionSort.java public class _2_BSelectionSort { ^ 1 error
s747266168
p02260
Java
#include <iostream> using namespace std; int selectionSort(int A[], int N){ int i, j, s, tmp, minj; for(i=0; i<N-1; i++){ minj = i; for(j=i; j<N; j++){ if(A[j]<A[minj]) minj = j; } tmp = A[i]; A[i] = A[minj]; A[minj] = tmp; if(i != min...
Main.java:1: error: illegal character: '#' #include <iostream> ^ Main.java:1: error: class, interface, enum, or record expected #include <iostream> ^ Main.java:3: error: unnamed classes are a preview feature and are disabled by default. int selectionSort(int A[], int N){ ^ (use --enable-preview to enable unn...
s015869565
p02260
Java
#include<stdio.h> #include<stdlib.h> int main(){ int i; int j; int change = 0; int num = 0; int count = 0; int min = 0; int *data; scanf("%d",&num); data = (int *)malloc(sizeof(int)*num); for(j = 0;j < num;j++){ scanf("%d",&data[j]); } for(i = 0;i < num - 1;i++){ min = i; for(j = i;j < num;j++){...
Main.java:1: error: illegal character: '#' #include<stdio.h> ^ Main.java:1: error: class, interface, enum, or record expected #include<stdio.h> ^ Main.java:2: error: illegal character: '#' #include<stdlib.h> ^ Main.java:6: error: unnamed classes are a preview feature and are disabled by default. int j; ^ ...
s090651961
p02260
Java
#include <stdio.h> int main(){ int minj,i,j,n,tmp; int count=0; scanf("%d",&n); int A[n]; for(i=0; i<n; i++) scanf("%d",&A[i]); for(i=0; i<=n-1; i++){ minj = i; for(j=i; j<=n-1; j++){ if(A[j]<A[minj]){ minj = j; } } if(A[i]>A[minj]){ tmp = A[i]; A[i] = A[minj]; A[mi...
Main.java:1: error: illegal character: '#' #include <stdio.h> ^ Main.java:1: error: class, interface, enum, or record expected #include <stdio.h> ^ Main.java:4: error: unnamed classes are a preview feature and are disabled by default. int count=0; ^ (use --enable-preview to enable unnamed classes) Main.jav...
s055025189
p02260
Java
import java.util.Scanner; public class B { private static Scanner scanner; public static void main(String args[]) { scanner = new Scanner(System.in); int a = scanner.nextInt(); int[] b = new int[a]; int minj,count = 0; for(int i=0;i < a;i++) b[i] = scanner.nextInt(); for(int i = 0;i < a;i++) { for(i...
Main.java:2: error: class B is public, should be declared in a file named B.java public class B { ^ 1 error
s062988946
p02260
Java
#include <stdio.h> int x[100]; int main(){ int i,j; int tem; int n; int cnt = 0; int minj; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&x[i]); } for(i=0;i<n-1;i++){ minj = i; for(j=i;j<n-1;j++){ if(x[j] < x[minj]){ minj = j; } } tem = x[i]; x[i] =...
Main.java:1: error: illegal character: '#' #include <stdio.h> ^ Main.java:1: error: class, interface, enum, or record expected #include <stdio.h> ^ Main.java:5: error: unnamed classes are a preview feature and are disabled by default. int main(){ ^ (use --enable-preview to enable unnamed classes) Main.java:1...
s833681463
p02260
Java
#include <stdio.h> int x[100]; int main(){ int i,j; int tem; int n; int cnt = 0; int minj; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&x[i]); } for(i=0;i<n-2;i++){ minj = i; for(j=i;j<n-1;j++){ if(x[j] < x[minj]){ minj = j; } } tem = x[i]; x[i] =...
Main.java:1: error: illegal character: '#' #include <stdio.h> ^ Main.java:1: error: class, interface, enum, or record expected #include <stdio.h> ^ Main.java:5: error: unnamed classes are a preview feature and are disabled by default. int main(){ ^ (use --enable-preview to enable unnamed classes) Main.java:1...
s811156820
p02260
Java
import java.io.*; import java.util.*; class Main{ public static void main(String[] args) throws Exception{ int i=0; int tmp; int[] A; int Count_Sort = 0; BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String N_str = br.readLine(); String A_str = br.readLine(); int N = Intege...
Main.java:29: error: cannot find symbol for(j=i;j<N-1;j++){ ^ symbol: variable j location: class Main Main.java:29: error: cannot find symbol for(j=i;j<N-1;j++){ ^ symbol: variable j location: class Main Main.java:29: error: cannot find symbol for(j=i;j<N-1;j++){ ...
s223796693
p02260
Java
import java.io.*; import java.util.*; class Main{ public static void main(String[] args) throws Exception{ int i=0,j=0; int tmp; int[] A; int Count_Sort = 0; BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String N_str = br.readLine(); String A_str = br.readLine(); int N = In...
Main.java:37: error: cannot find symbol A[minj] = temp; ^ symbol: variable temp location: class Main Main.java:42: error: package Syhstem does not exist Syhstem.out.print(A[i]); ^ 2 errors
s481712651
p02260
Java
import java.io.*; import java.util.*; class Main{ public static void main(String[] args) throws Exception{ int i=0; int j=0; int tmp; int Count_Sort = 0; BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String N_str = br.readLine(); int N = Integer.parseInt(N_str); int[] A; A...
Main.java:37: error: ';' expected Count_Sort++: ^ 1 error
s915971233
p02260
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; public class SelectionSort { public static void main(String args[]) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int elementNum = Integer.parseIn...
Main.java:7: error: class SelectionSort is public, should be declared in a file named SelectionSort.java public class SelectionSort { ^ 1 error
s464063085
p02260
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; public class SelectionSort { public static void main(String args[]) throws IOException { // ??\???????????? BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int elementN...
Main.java:6: error: class SelectionSort is public, should be declared in a file named SelectionSort.java public class SelectionSort { ^ 1 error
s647840968
p02260
C
}
main.c:1:1: error: expected identifier or '(' before '}' token 1 | } | ^
s353352209
p02260
C
#include <stdio.h> int main () { int n,o.minj,j,x,count = 0; scanf("%d", &n); int a[n]; for (i = 0; i < n; i++) { minj = i; for (j = i; j < (n -1); j++) { if (a[j] < a[minj]) { minj = j; x = i; a[i] = a[minj]; a[minj] = a[x]; count++; } } } for (i = 0; i < n; i++) {...
main.c: In function 'main': main.c:4:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token 4 | int n,o.minj,j,x,count = 0; | ^ main.c:9:14: error: 'i' undeclared (first use in this function) 9 | for (i = 0; i < n; i++) { | ^ main.c:9...