submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s432845577 | p02255 | C++ | #define MAX_INPUT 1000
// function
void inputArray(int a[], int *num);
void insertionSort(int a[], int num);
void outputArray(int a[], int num);
int main(void)
{
int size;
int input[MAX_INPUT];
inputArray(input, &size);
insertionSort(input, size);
return 0;
}
void inputArray(int a[], int *num)
{
// pr... | a.cc: In function 'void inputArray(int*, int*)':
a.cc:22:3: error: 'scanf' was not declared in this scope
22 | scanf("%d", num);
| ^~~~~
a.cc: In function 'void outputArray(int*, int)':
a.cc:51:5: error: 'printf' was not declared in this scope
51 | printf("%d ", a[i]);
| ^~~~~~
a.cc:1:1: n... |
s666538285 | p02255 | C++ | #include<iostream>
using namespace std;
int main(){
int N,i;
cin >> N;
int A[N];
for (i=0;i<=N-1;i++){
cin >> A[i];
}
for (i=1;i<=N-1;i++){
v=A[i];
int j=i-1;
while(j>=0 && A[j]>v){
A[j+1]=A[j];
j--;
}
A[j+1]=v;
cout << A << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:13:17: error: 'v' was not declared in this scope
13 | v=A[i];
| ^
|
s085502759 | p02255 | C++ | import Data.List
toDice :: [Int] -> [[Int]]
toDice [a,b,c,d,e,f] = [[a,f],[b,e],[c,d]]
pattern1 :: [Int] -> [String]
pattern1 x = map show [(x !! 0),(x !! 1),(x !! 5),(x !! 4),(x !! 0)]
pattern2 :: [Int] -> [String]
pattern2 x = map show [(x !! 1),(x !! 2),(x !! 4),(x !! 3),(x !! 1)]
pattern3 :: [Int] -> [Strin... | a.cc:36:36: error: stray '\' in program
36 | main = getContents >>= putStrLn . (\xs -> if diff xs (mkstr $ head xs) then "Yes" else "No") . map(map read . words) . tail . lines
| ^
a.cc:1:1: error: 'import' does not name a type
1 | import Data.List
| ^~~~~~
a.cc:1:1... |
s134183287 | p02255 | C++ | for i = 1 to A.length-1
key = A[i]
/* insert A[i] into the sorted sequence A[0,...,j-1] */
j = i - 1
while j >= 0 and A[j] > key
A[j+1] = A[j]
j--
A[j+1] = key | a.cc:1:1: error: expected unqualified-id before 'for'
1 | for i = 1 to A.length-1
| ^~~
|
s146314459 | p02255 | C++ | #include<stdio.h>
static const int N = 1000;
void trace(int A[], int n){
int i;
for ( i = 1; i <= n; i++ ){
if ( i > 1 ) printf(" ");
printf("%d", A[i]);
}
printf("\n");
}
int main(){
int n, i, j,v;
int A[N+1];
scanf("%d", &n); /*Input includes an integer n*/
for ( i = 1; i <= n; i++ ) scanf... | a.cc: In function 'int main()':
a.cc:35:2: error: expected '}' at end of input
35 | }
| ^
a.cc:14:11: note: to match this '{'
14 | int main(){
| ^
|
s299807724 | p02255 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main()
{
int N;
vecter<int> A;
cin >> N;
for (int i = 0; i < N; ++i)
cin >> A[i];
for (int i = 1; i <= A.size() - 1; ++i)
{
int key = A[i];
int j = i - 1;
while (j >= 0 && A[j] > key) {
A[j + 1] = A[j];
j--;
}
A[j + 1] = k... | a.cc: In function 'int main()':
a.cc:9:9: error: 'vecter' was not declared in this scope
9 | vecter<int> A;
| ^~~~~~
a.cc:9:16: error: expected primary-expression before 'int'
9 | vecter<int> A;
| ^~~
a.cc:13:24: error: 'A' was not declared in this scope
13 ... |
s906836631 | p02255 | C++ | import java.util.*;
class Main{
public static void main(String[] args){
Scanner scanner = new Scanner(System.in);
int N = scanner.nextInt();
int[] A = new int[N];
for(int i=0; i<N; i++){
A[i] = scanner.nextInt();
... | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:15: error: expected ':' before 'static'
4 | public static void main(String[] args){
| ^~~~~~~
| :
a.cc:4:... |
s717526856 | p02255 | C++ | include <iostream>
#include <vector>
using namespace std;
void insertionSort(int *A, int N) {
for (int i = 1; i <= N-1; i++) {
int v = A[i];
int j = i-1;
while (j >= 0 && A[j] > v) {
A[j+1] = A[j];
j--;
}
A[j+1] = v;
... | a.cc:1:1: error: 'include' does not name a type
1 | include <iostream>
| ^~~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
from /usr/include/c++/14/vector:62,
from a.cc:2:
/usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu... |
s898417958 | p02255 | C++ | #include<bits/stdc++.h>
using namespace std;
static const int MAX=100;
void trace(int a[],int N){
for(i=0;i<N;i++){
if(i>0)cout<<" ";
cout<<a[i];
}
cout<<endl;
}
void insertionSort(int a[],int N){
int j,i,v;
for(i=1;i<n;i++){
v=a[i];
j=i-1;
while(j>=0 && a[j]>v){
a[j+1]=a[j];
j--;
}
a[j+1]=v;
trace(a,N);
}
}
int mai... | a.cc: In function 'void trace(int*, int)':
a.cc:6:5: error: 'i' was not declared in this scope
6 | for(i=0;i<N;i++){
| ^
a.cc: In function 'void insertionSort(int*, int)':
a.cc:15:11: error: 'n' was not declared in this scope
15 | for(i=1;i<n;i++){
| ^
a.cc: In function 'int main()':
a.... |
s192006608 | p02255 | C++ | #include<bits/stdc++.h>
using namespace std;
static const int MAX=100;
void trace(int a[],int n){
for(i=0;i<n;i++){
if(i>0)cout<<" ";
cout<<a[i];
}
cout<<endl;
}
void insertionSort(int a[],int n){
int j,i,v;
for(i=1;i<n;i++){
v=a[i];
j=i-1;
while(j>=0 && a[j]>v){
a[j+1]=a[j];
j--;
}
a[j+1]=v;
trace(a,n);
}
}
int mai... | a.cc: In function 'void trace(int*, int)':
a.cc:6:5: error: 'i' was not declared in this scope
6 | for(i=0;i<n;i++){
| ^
|
s412516538 | p02255 | C++ | void intsertionSort(int a[],int n);
int main(){
int a[1000],n,i;
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d",a+i);
intsertionSort(a,n);
//output
for(i=0;i<n;i++){
printf("%d",a[i]);
if(i!=(n-1))
printf(" ");
}
printf("\n");
}
void intsertionSort(int a[],int n){
int i,j,k;
int v;
for(i=1;i<=n... | a.cc: In function 'int main()':
a.cc:5:9: error: 'scanf' was not declared in this scope
5 | scanf("%d",&n);
| ^~~~~
a.cc:13:17: error: 'printf' was not declared in this scope
13 | printf("%d",a[i]);
| ^~~~~~
a.cc:1:1: note: 'printf' is defined in header... |
s317644863 | p02255 | C++ | #include <iostream>
#include <cmath>
using namespace std;
void insertionSort(int A[], int N) {
for(int k=0;k<N;k++) {
cout << A[k];
if(k!=N-1) {
cout << " ";
}
}
cout << endl;
for(int i=1;i<N;i++) {
int v = A[i];
int j = i - 1;
while(... | a.cc: In function 'int main()':
a.cc:45:25: error: expected '}' at end of input
45 | insertionSort(a, n);
| ^
a.cc:35:16: note: to match this '{'
35 | int main(void) {
| ^
|
s422204994 | p02255 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
void trace(int A[], int N){
int i;
for ( i = 0; i < N; i++){
if ( i > 0 ) printf(" ");
printf("%d",A[i] );
}
printf("\n" );
}
void insertionSort(int A[], int N){
int j, i ,v;
for (i = 1, i < N, i ++){
v = A[i];
j = i - 1;
whi... | a.cc: In function 'void insertionSort(int*, int)':
a.cc:16:26: error: expected ';' before ')' token
16 | for (i = 1, i < N, i ++){
| ^
| ;
a.cc:26:1: error: expected primary-expression before '}' token
26 | }
| ^
a.cc:25:4: error: expected ';' ... |
s902111141 | p02255 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
void trace(int A[], int N){
int i;
for ( i = 0; i < N; i++){
if ( i > 0 ) printf(" ");
printf("%d",A[i] );
}
printf("\n" );
}
void insertionSort(int A[], int N){
int j, i ,v;
for (i = 1, i < N, i ++){
v = A[i];
j = i - 1;
whi... | a.cc: In function 'void insertionSort(int*, int)':
a.cc:16:26: error: expected ';' before ')' token
16 | for (i = 1, i < N, i ++){
| ^
| ;
a.cc:26:1: error: expected primary-expression before '}' token
26 | }
| ^
a.cc:25:4: error: expected ';' ... |
s123112208 | p02255 | C++ | #include<iostream>
#include<vector>
using namespace std;
insertsort(vector<int> &A,int n){
for(int i = 0;i < n;i++){
int v = A[i];
int j = i;
while(j >= 0 && v > A[j]){
A[j+1] = A[j];
j--;
}
A[j+1] = v;
for(j=0;j<n;j++)cout << A[j];
cout << endl;
}
}
int main(){
int n,a;
cin >> n;
vector<i... | a.cc:6:1: error: ISO C++ forbids declaration of 'insertsort' with no type [-fpermissive]
6 | insertsort(vector<int> &A,int n){
| ^~~~~~~~~~
a.cc: In function 'int insertsort(std::vector<int>&, int)':
a.cc:19:1: warning: no return statement in function returning non-void [-Wreturn-type]
19 | }
| ^
|
s965281350 | p02255 | C++ | #include <cstdio>
int main(void)
{
int i;
int num;
int elem[100];
scanf("%d", num);
for (i = 0; i < num; i++) {
scanf("%d", elem[i]);
}
for (i = 1; i < num; i++) {
if (j = i; j < 0; j--) {
if (elem[j] < elem[j-1]) {
tmp = elem[j];
... | a.cc: In function 'int main()':
a.cc:15:13: error: 'j' was not declared in this scope
15 | if (j = i; j < 0; j--) {
| ^
a.cc:15:25: error: expected ')' before ';' token
15 | if (j = i; j < 0; j--) {
| ~ ^
| )
a.cc:15:27: e... |
s791428266 | p02255 | C++ | #include <cstdio>
int main(void)
{
int i, j, k;
int num;
int elem[100];
scanf("%d", num);
for (i = 0; i < num; i++) {
scanf("%d", elem[i]);
}
for (i = 1; i < num; i++) {
if (j = i; j < 0; j--) {
if (elem[j] < elem[j-1]) {
tmp = elem[j];
... | a.cc: In function 'int main()':
a.cc:15:25: error: expected ')' before ';' token
15 | if (j = i; j < 0; j--) {
| ~ ^
| )
a.cc:15:30: error: expected ';' before ')' token
15 | if (j = i; j < 0; j--) {
| ^
... |
s794387045 | p02255 | C++ | #include <cstdio>
int main(void)
{
int i, j, k;
int num;
int tmp;
int elem[100];
scanf("%d", num);
for (i = 0; i < num; i++) {
scanf("%d", elem[i]);
}
for (i = 1; i < num; i++) {
if (j = i; j < 0; j--) {
if (elem[j] < elem[j-1]) {
tmp ... | a.cc: In function 'int main()':
a.cc:16:25: error: expected ')' before ';' token
16 | if (j = i; j < 0; j--) {
| ~ ^
| )
a.cc:16:30: error: expected ';' before ')' token
16 | if (j = i; j < 0; j--) {
| ^
... |
s145390975 | p02255 | C++ | #include <cstdio>
int main(void)
{
int i, j, k;
int num;
int tmp;
int elem[100];
scanf("%d", num);
for (i = 0; i < num; i++) {
scanf("%d", elem[i]);
}
for (i = 1; i < num; i++) {
if (j = i; j < 0; j--) {
if (elem[j] < elem[j-1]) {
tmp ... | a.cc: In function 'int main()':
a.cc:16:25: error: expected ')' before ';' token
16 | if (j = i; j < 0; j--) {
| ~ ^
| )
a.cc:16:30: error: expected ';' before ')' token
16 | if (j = i; j < 0; j--) {
| ^
... |
s428625551 | p02255 | C++ | #include <stdio.h>
int main(void)
{
int i, j, k;
int num;
int tmp;
int elem[100];
scanf("%d", num);
for (i = 0; i < num; i++) {
scanf("%d", elem[i]);
}
for (i = 1; i < num; i++) {
if (j = i; j < 0; j--) {
if (elem[j] < elem[j-1]) {
tmp ... | a.cc: In function 'int main()':
a.cc:16:25: error: expected ')' before ';' token
16 | if (j = i; j < 0; j--) {
| ~ ^
| )
a.cc:16:30: error: expected ';' before ')' token
16 | if (j = i; j < 0; j--) {
| ^
... |
s410384321 | p02255 | C++ | #include <stdio.h>
int main(void)
{
int i, j, k;
int num;
int tmp;
int elem[100];
scanf("%d", &num);
for (i = 0; i < num; i++) {
scanf("%d", &elem[i]);
}
for (i = 1; i < num; i++) {
if (j = i; j < 0; j--) {
if (elem[j] < elem[j-1]) {
tmp ... | a.cc: In function 'int main()':
a.cc:16:25: error: expected ')' before ';' token
16 | if (j = i; j < 0; j--) {
| ~ ^
| )
a.cc:16:30: error: expected ';' before ')' token
16 | if (j = i; j < 0; j--) {
| ^
... |
s218960853 | p02255 | C++ | #include <stdio.h>
int main(void)
{
int i, j, k;
int num;
int tmp;
int elem[100];
scanf("%d", &num);
for (i = 0; i < num; i++) {
scanf("%d", &elem[i]);
}
for (i = 1; i < num; i++) {
if (j = i; j > 0; j--) {
if (elem[j] < elem[j-1]) {
tmp ... | a.cc: In function 'int main()':
a.cc:16:25: error: expected ')' before ';' token
16 | if (j = i; j > 0; j--) {
| ~ ^
| )
a.cc:16:30: error: expected ';' before ')' token
16 | if (j = i; j > 0; j--) {
| ^
... |
s406308555 | p02255 | C++ | #include <stdio.h>
int main(void)
{
int i, j, k;
int num;
int tmp;
int elem[100];
scanf("%d", &num);
for (i = 0; i < num; i++) {
scanf("%d", &elem[i]);
}
for (i = 1; i < num; i++) {
for (j = i; j > 0; j--) {
if (elem[j] < elem[j-1]) {
tmp ... | a.cc: In function 'int main()':
a.cc:23:33: error: invalid types 'int[int]' for array subscript
23 | printf("%d", num[0]);
| ^
a.cc:24:33: error: 'n' was not declared in this scope
24 | for (k = 1; k < n; k++) {
| ... |
s115274453 | p02255 | C++ | #include <stdio.h>
int main(void)
{
int i, j, k;
int num;
int tmp;
int elem[100];
scanf("%d", &num);
for (i = 0; i < num; i++) {
scanf("%d", &elem[i]);
}
for (i = 1; i < num; i++) {
for (j = i; j > 0; j--) {
if (elem[j] < elem[j-1]) {
tmp ... | a.cc: In function 'int main()':
a.cc:24:33: error: 'n' was not declared in this scope
24 | for (k = 1; k < n; k++) {
| ^
|
s124982192 | p02255 | C++ | #include <stdio.h>
void DispArg(int elem[], int num)
{
int i;
printf("%d", elem[0]);
for (i = 1; i < num; i++) {
printf(" %d", elem[i]);
}
printf("\n");
return;
}
int main(void)
{
int i, j, k;
int num;
int tmp;
int elem[100];
scanf("%d", &num);
for (i = 0; i ... | a.cc: In function 'int main()':
a.cc:34:36: error: expected ';' before '}' token
34 | elem[j] = elem[j-1]
| ^
| ;
35 | }
| ~
|
s672030575 | p02255 | C++ | #include <stdio.h>
void DispArg(int elem[], int num)
{
int i;
printf("%d", elem[0]);
for (i = 1; i < num; i++) {
printf(" %d", elem[i]);
}
printf("\n");
return;
}
int main(void)
{
int i, j, k;
int num;
int tmp;
int elem[100];
scanf("%d", &num);
for (i = 0; i ... | a.cc: In function 'int main()':
a.cc:34:36: error: expected ';' before '}' token
34 | elem[j] = elem[j-1]
| ^
| ;
35 | }
| ~
|
s016242696 | p02255 | C++ | #include<cstdio>
#include<vector>
using namespace std;
void print(const vector<int> & arr) {
printf("%d");
for(vector<int>::iterator itr=++(arr.begin()); itr!=arr.end(); ++itr){
printf(" %d");
}
printf("\n");
}
int main() {
vector<int> arr;
int n, tmp, i, j;
scanf("%d", &n);
for(i=0; i<n; ++i) {
scanf("%d", &tmp);
a... | a.cc: In function 'void print(const std::vector<int>&)':
a.cc:7:31: error: conversion from '__normal_iterator<const int*,[...]>' to non-scalar type '__normal_iterator<int*,[...]>' requested
7 | for(vector<int>::iterator itr=++(arr.begin()); itr!=arr.end(); ++itr){
| ^~~~~~~~~~~~~... |
s026977899 | p02255 | C++ | void InsertSort(vector<int> A, int i){
for(int i = 0; i < A.size(); i++){
int v = A[i];
int j = i - 1;
while(j >= 0 && A[j] > v){
A[j+1] = A[j];
j--;
}
A[j+1] = v;
}
}
void Output(vector<int> A){
int n = A.size() - 1;
for(int i = 0; i < n; i++) cout << A[i] << ' ';
cout << A[n] << endl;
}
int mai... | a.cc:1:6: error: variable or field 'InsertSort' declared void
1 | void InsertSort(vector<int> A, int i){
| ^~~~~~~~~~
a.cc:1:17: error: 'vector' was not declared in this scope
1 | void InsertSort(vector<int> A, int i){
| ^~~~~~
a.cc:1:24: error: expected primary-expression befor... |
s171865268 | p02255 | C++ | #include <iostream>
using namespace std;
int main(){
int A[110],n,a;
cin>>n;
for(int i=0;i<n;i++){
cin>>A[i];
}
for(int i=0;i<n;i++){
cout<<A[i]<<;
if(i!=n-1)cout<<" ";
}
cout<<endl;
for(int i=1;i<n;i++){
for(int j=i;j>=1;j--){
if(A[j]<A[j-1]){
a=A[j];
A[j]=A[j-1];
A[j-1]=a;
}
}
f... | a.cc: In function 'int main()':
a.cc:11:29: error: expected primary-expression before ';' token
11 | cout<<A[i]<<;
| ^
|
s706447084 | p02255 | C++ | #include<iostream>
#include <cstdio>
using namespace std;
int main(){
int i, j,k, N,a[100],v;
cin >> N;
for (i = 0; i < N; i++) cin >> a[i];
for (i = 0; i < N; ++)
printf("%d ", a[i]);
putchar('\n');
for (i = 1; i < N ; i++) {
v = a[i];
j = i - 1;
while(j >= 0 & a[j] > v){
a[j + 1] = a[j];
j--;... | a.cc: In function 'int main()':
a.cc:12:30: error: expected primary-expression before ')' token
12 | for (i = 0; i < N; ++)
| ^
|
s129479128 | p02255 | C++ | include<iostream>
//include<algorithm>
//using namespace std;
const int MAX = 100;
void trace(int a[], int n){
int i;
for( i = 0; i < n; i++ ){
if ( i > 0 ) printf(" ");
printf("%d", a[i]);
}
printf("\n");
}
void insertionSort(int a[], int n){
int j, i, v;
for(int i = 1; i < n; i++){
v = a[i];... | a.cc:1:1: error: 'include' does not name a type
1 | include<iostream>
| ^~~~~~~
a.cc: In function 'void trace(int*, int)':
a.cc:9:18: error: 'printf' was not declared in this scope
9 | if ( i > 0 ) printf(" ");
| ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; t... |
s420912504 | p02255 | C++ | using System.IO;
using System.Text;
using System;
namespace AOJ
{
class Scanner : StringReader
{
string _currentWord;
public Scanner(string source) : base(source)
{
ReadNextWord();
}
private void ReadNextWord()
{
StringBuild... | a.cc:1:7: error: expected nested-name-specifier before 'System'
1 | using System.IO;
| ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
2 | using System.Text;
| ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
3 | using System;
| ... |
s124879862 | p02255 | C++ | #include<stdio.h>
main(){
int n;
int A[100];
int i,j,k,key;
scanf("%d",&n);
for(k=0;k<n;k++){
scanf("%d",&A[k]);
}
for(i=1;i<n;i++){
key = a[i]; /* insert A[i] into the sorted sequence A[0,...,j-1] */
j = i - 1;
while(j >= 0 && A[j] > key){
A[j+1] = A[j];
j--;
}
A[j+... | a.cc:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
2 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:11:11: error: 'a' was not declared in this scope
11 | key = a[i]; /* insert A[i] into the sorted sequence A[0,...,j-1] */
| ^
|
s995466962 | p02255 | C++ | #include<stdio.h>
main(){
int i,j,k,key;
int A[100];
for(i=1;i<n;i++){
key = A[i];
/* insert A[i] into the sorted sequence A[0,...,j-1] */
j = i - 1;
while(j >= 0 && A[j] > key){
A[j+1] = A[j];
j--;
}
A[j+1] = key;
printf(A);
}
} | a.cc:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
2 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:5:13: error: 'n' was not declared in this scope
5 | for(i=1;i<n;i++){
| ^
a.cc:14:12: error: cannot convert 'int*' to 'const char*'
14 | ... |
s056812891 | p02255 | C++ | #include static const int N = 1000;
void trace(int A[], int n){
int i;
for ( i = 1; i <= n; i++ ){
if ( i > 1 ) printf(" ");
printf("%d", A[i]);
}
printf("\n");
}
int main(){ int n, i, j; int A[N+1]; scanf("%d", &n); for ( i = 1; i <= n; i++ ) scanf("%d", &A[i]); trace(A, n); /* your code */ ret... | a.cc:1:10: error: #include expects "FILENAME" or <FILENAME>
1 | #include static const int N = 1000;
| ^~~~~~
a.cc: In function 'void trace(int*, int)':
a.cc:5:18: error: 'printf' was not declared in this scope
5 | if ( i > 1 ) printf(" ");
| ^~~~~~
a.cc:1:1: note: 'prin... |
s195089824 | p02255 | C++ | #include<stdio.h>
void InsertionSort(int A[],int N)
{
int i,j,v;
for(i=1;i <= N-1;i++){
v=A[1];
j = i -1;
while(j >= && A[j]>v)
{
A[j+1] =A[j];
j--;
}
A[j+1] = v;
trace(A,N);
}
}
void trace(int A[],int N){
for(int i=0;i < N;i++)
{
if(i > 0)printf (" ");
printf("%d",A[i]);
}
printf("\n"... | a.cc: In function 'void InsertionSort(int*, int)':
a.cc:9:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
9 | while(j >= && A[j]>v)
| ~~^~~~~~~
a.cc:9:32: error: expected ')' before '[' token
9 | while(j >= && A[j]>v)
... |
s835399496 | p02255 | C++ | #include<stdio.h>
void InsertionSort(int A[],int N)
{
int i,j,v;
for(i=1;i <= N-1;i++){
v=A[1];
j = i -1;
while(j >= && A[j]>v)
{
A[j+1] =A[j];
j--;
}
A[j+1] = v;
trace(A,N);
}
}
void trace(int A[],int N){
for(int i=0;i < N;i++)
{
if(i > 0)printf (" ");
printf("%d",A[i]);
}
printf("\n"... | a.cc: In function 'void InsertionSort(int*, int)':
a.cc:9:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
9 | while(j >= && A[j]>v)
| ~~^~~~~~~
a.cc:9:32: error: expected ')' before '[' token
9 | while(j >= && A[j]>v)
... |
s266601194 | p02255 | C++ | #include<stdio.h>
void InsertionSort(int A[],int N)
{
int i,j,v;
for(i=1;i <= N-1;i++){
v=A[1];
j = i -1;
while(j >= 0&& A[j]>v)
{
A[j+1] =A[j];
j--;
}
A[j+1] = v;
trace(A,N);
}
}
void trace(int A[],int N){
for(int i=0;i < N;i++)
{
if(i > 0) printf (" ");
printf("%d",A[i]);
}
printf("\... | a.cc: In function 'void InsertionSort(int*, int)':
a.cc:15:17: error: 'trace' was not declared in this scope
15 | trace(A,N);
| ^~~~~
a.cc: At global scope:
a.cc:30:1: error: '::main' must return 'int'
30 | void main(){
| ^~~~
|
s735798830 | p02255 | C++ | #include<stdio.h>
void InsertionSort(int A[],int N)
{
int i,j,v;
for(i=1;i <= N-1;i++){
v=A[1];
j = i -1;
while(j >= 0&& A[j]>v)
{
A[j+1] =A[j];
j--;
}
A[j+1] = v;
trace(A,N);
}
}
void trace(int A[],int N){
for(int i=0;i < N;i++)
{
if(i > 0) printf (" ");
printf("%d",A[i]);
}
printf("\... | a.cc: In function 'void InsertionSort(int*, int)':
a.cc:15:17: error: 'trace' was not declared in this scope
15 | trace(A,N);
| ^~~~~
|
s116781712 | p02255 | C++ | #include <iostream>
namespace myspace{
class vector{
public:
void push_back(int);
int size();
int &operator[](int);
void resize(int);
vector();
vector(const vector&);
~vector();
private:
int s;
int* box;
int capa;
};
vector::vector()
{
box = NULL;
s = 0;
capa = 0;
}
vector::vect... | a.cc: In member function 'void myspace::vector::resize(int)':
a.cc:51:33: error: 'reserve' was not declared in this scope
51 | if(capa < input)reserve(input);
| ^~~~~~~
a.cc: At global scope:
a.cc:55:14: error: no declaration matches 'void myspace::vector::reserv... |
s496665458 | p02255 | C++ |
#include "stdafx.h"
#include<cstdio>
#include<iostream>
#include<cctype>
#include<algorithm>
using namespace std;
void trace(int N, int A[]) {
for (int i = 0; i < N; i++) {
cout << A[i];
if (0 < i < N - 1)cout << " ";
}
cout << endl;
}
void insertSort(int N, int A[]) {
for (int i = 1; i < N; i++) {
int v =... | a.cc:2:10: fatal error: stdafx.h: No such file or directory
2 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s749309073 | p02255 | C++ | d34aa344-a18a-46f1-be49-80aac86d0a39
#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <set>
#include <iomanip>
#include <fstream>
#include <stdint.h>
#include <cmath>
#include <algorithm>
#include <utility>
#include <numeric>
using namespace std;
constexpr int INF = 1000000000;/* 1... | a.cc:1:1: error: 'd34aa344' does not name a type
1 | d34aa344-a18a-46f1-be49-80aac86d0a39
| ^~~~~~~~
In file included from /usr/include/c++/14/iosfwd:42,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:4... |
s096630255 | p02255 | C++ | #include <iostream>
namespace myspace{
template<typename Type>
class vector{
public:
void push_back(T);
int size();
Type &operator[](int);
void resize(int);
void reserve(int);
vector();
vector(const vector&);
~vector();
private:
int s;
int* box;
int capa;
};
template<typename Type>
vect... | a.cc:8:32: error: 'T' has not been declared
8 | void push_back(T);
| ^
|
s800408038 | p02255 | C++ | #include <cstdio>
void trace(int A[], int N) {
for (int i = 0; i < N; ++i) {
if (i > 0) printf(" ");
printf("%d", A[i]);
}
printf("/n")
}
void insertionSort(int A[], int N) {
for (int i = 1; i < N; ++i) {
int v = A[i];
int j = i - 1;
while (j >= 0 && A[j] > v) {
A[j + 1] = A[j];
... | a.cc: In function 'void trace(int*, int)':
a.cc:8:15: error: expected ';' before '}' token
8 | printf("/n")
| ^
| ;
9 | }
| ~
|
s912860134 | p02255 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <stdlib>
using namespace std;
void display(vector<int> ary_i) {
for (int i = 0; i < ary_i.size(); i++) {
if (i > 0) cout << " ";
cout << ary_i[i];
}
cout << endl;
}
void insertSort(vector<int> ary) {
int v, i, j;
for (i = 0; i < ary.... | a.cc:4:10: fatal error: stdlib: No such file or directory
4 | #include <stdlib>
| ^~~~~~~~
compilation terminated.
|
s487118133 | p02255 | C++ | def InsertionSort(A , N):
for i in range(1,N):
v = A[i]
j = i -1
while j > -1 and A[j] > v:
A[j+1] = A[j]
j = j -1
A[j+1] = v
print " ".join(map(str, A))
def main():
N = int( raw_input() )
A = map(int, raw_input().split())
print " ".join(map(str, A))
InsertionSort(A, N)
if __name__=='__main__'... | a.cc:17:14: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
17 | if __name__=='__main__':
| ^~~~~~~~~~
a.cc:1:1: error: 'def' does not name a type
1 | def InsertionSort(A , N):
| ^~~
|
s688552358 | p02255 | C++ | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int n=Integer.valueOf(sc.next());
int[] arr= new int[n];
for(int i=0;i<n;i++){
arr[i]=Integer.valueOf(sc.next());
}
sc.close();
for(int i=1;i<n;i++){
print(arr);
int t=arr[... | 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 {
| ^~~~~~
|
s707206560 | p02255 | C++ | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int n=Integer.valueOf(sc.next());
int[] arr= new int[n];
for(int i=0;i<n;i++){
arr[i]=Integer.valueOf(sc.next());
}
sc.close();
for(int i=1;i<n;i++){
print(arr);
int t=arr[... | 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 {
| ^~~~~~
|
s819518181 | p02255 | C++ | #include <bits\stdc++.h>
#define rep(i,o,u) for(int i = o;i <= u; i++)
using namespace std;
int a[101];
int b[1001];
int main(){
int n;
cin >> n;
rep(i,1,n){
cin >> a[i];
}
memset(b,0,sizeof(b));
rep(i,1,n){
b[a[i]]++;
int k = 0;
rep(j,1,1001){
int l = b[j];
while(l > 0){
cout << j << " ";
... | a.cc:1:10: fatal error: bits\stdc++.h: No such file or directory
1 | #include <bits\stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s433009566 | p02255 | C++ | #include <bits\stdc++.h>
#define rep(i,o,u) for(int i = o;i <= u; i++)
using namespace std;
int a[101];
int b[1001];
int main(){
int n;
cin >> n;
rep(i,1,n){
cin >> a[i];
}
memset(b,0,sizeof(b));
rep(i,1,n){
b[a[i]]++;
int k = 0;
rep(j,1,1001){
int l = b[j];
while(l > 0){
cout << j << " ";
... | a.cc:1:10: fatal error: bits\stdc++.h: No such file or directory
1 | #include <bits\stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s681583351 | p02255 | C++ | include<iostream>
using namespace std;
int main(){
int n; cin >> n;
int A[1000];
for (int i = 0; i < n; i++){
cin >> A[i];
}
for ( int i = 1; i <= n; i++){
for ( int k = 0; k < n; k++){
cout << A[k] << " ";
... | a.cc:1:1: error: 'include' does not name a type
1 | include<iostream>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:16: error: 'cin' was not declared in this scope
6 | int n; cin >> n;
| ^~~
a.cc:15:25: error: 'cout' was not declared in this scope
15 | ... |
s705389377 | p02255 | C++ | #include <iostream>
using namespace std;
int k;
int cnt[102];
void print(int kj){
for(int i=0;i<kj-1;i++){
cout<<cnt[i]<<' ';
}
cout<<cnt[kj-1]<<'\n';
}
int main(){
cin>>k;
for (int i=0;i<k;++i){
cin>>cnt[i];
}
print(k)
for (int j=1,j<k;++j){
int key = cnt[j];
... | a.cc: In function 'int main()':
a.cc:16:13: error: expected ';' before 'for'
16 | print(k)
| ^
| ;
17 | for (int j=1,j<k;++j){
| ~~~
a.cc:17:24: error: 'j' was not declared in this scope
17 | for (int j=1,j<k;++j){
| ^... |
s879512115 | p02255 | C++ | #include <iostream>
using namespace std;
int k;
int cnt[102];
void print(int kj){
for(int i=0;i<kj-1;i++){
cout<<cnt[i]<<' ';
}
cout<<cnt[kj-1]<<'\n';
}
int main(){
cin>>k;
for (int i=0;i<k;++i){
cin>>cnt[i];
}
print(k)
for (int j=1;j<k;++j){
int key = cnt[j];
... | a.cc: In function 'int main()':
a.cc:16:13: error: expected ';' before 'for'
16 | print(k)
| ^
| ;
17 | for (int j=1;j<k;++j){
| ~~~
a.cc:17:18: error: 'j' was not declared in this scope
17 | for (int j=1;j<k;++j){
| ^
|
s684944589 | p02255 | C++ | #include<stdio.h>
void trace(int A[],int N){
int i;
for(i=1;i<N;i++){
if(i>0)printf(" ");
printf("%d",A[i]);
}
printf("\n")
}
int insertionSort(int A[],int N){
int j,i,v;
for(i=1;i<N;i++){
v=A[i];
j=i-1;
while(j>=0&&a[j]>v){
A[j+1]=A[j];
j--;
... | a.cc: In function 'void trace(int*, int)':
a.cc:9:16: error: expected ';' before '}' token
9 | printf("\n")
| ^
| ;
10 | }
| ~
a.cc: In function 'int insertionSort(int*, int)':
a.cc:22:19: error: 'a' was not declared in this scope
22 | wh... |
s693011901 | p02255 | C++ | #include<stdio.h>
void trace(int A[],int N){
int i;
for(i=1;i<N;i++){
if(i>0)printf(" ");
printf("%d",A[i]);
}
printf("\n")
}
int insertionSort(int A[],int N){
int j,i,v;
for(i=1;i<N;i++){
v=A[i];
j=i-1;
while(j>=0&&A[j]>v){
A[j+1]=A[j];
j--;
... | a.cc: In function 'void trace(int*, int)':
a.cc:9:16: error: expected ';' before '}' token
9 | printf("\n")
| ^
| ;
10 | }
| ~
a.cc: In function 'int insertionSort(int*, int)':
a.cc:33:1: warning: no return statement in function returning non-void... |
s560965775 | p02255 | C++ | #include<stdio.h>
void trace(int A[],int N){
int i;
for(i=1;i<N;i++){
if(i>0)printf(" ");
printf("%d",A[i]);
}
printf("\n")
}
int insertionSort(int A[],int N){
int j,i,v;
for(i=1;i<N;i++){
v=A[i];
j=i-1;
while(j>=0&&A[j]>v){
A[j+1]=A[j];
j--;
... | a.cc: In function 'void trace(int*, int)':
a.cc:9:16: error: expected ';' before '}' token
9 | printf("\n")
| ^
| ;
10 | }
| ~
a.cc: In function 'int insertionSort(int*, int)':
a.cc:33:1: warning: no return statement in function returning non-void... |
s704338601 | p02255 | C++ | #include<stdio.h>
void trace(int A[],int N){
int i;
for(i=0;i<N;i++){
if(i>0)printf(" ");
printf("%d",A[i]);
}
printf("\n")
}
int insertionSort(int A[],int N){
int j,i,v;
for(i=1;i<N;i++){
v=A[i];
j=i-1;
while(j>=0&&A[j]>v){
A[j+1]=A[j];
j--;
... | a.cc: In function 'void trace(int*, int)':
a.cc:9:16: error: expected ';' before '}' token
9 | printf("\n")
| ^
| ;
10 | }
| ~
a.cc: In function 'int insertionSort(int*, int)':
a.cc:33:1: warning: no return statement in function returning non-void... |
s776482855 | p02255 | C++ | #include <stdio.h>
int main(void)
{
int i, j, N, A[100], v;
scanf ("%d\n", &N);
for (i = 0; i < N; i++) {
scanf ("%d ", &A[i]);
}
for (i = 1; i < N; i++) {
v = A[i];
j = i - 1
while (j >= 0 && A[j] > v) {
A[j+1] = A[j];
j--;
}
A[j+1] = v;
for (i = 0; i < N; i++) {
p... | a.cc: In function 'int main()':
a.cc:16:13: error: expected ';' before 'while'
16 | j = i - 1
| ^
| ;
17 | while (j >= 0 && A[j] > v) {
| ~~~~~
a.cc:29:2: error: expected '}' at end of input
29 | }
| ^
a.cc:4:1: note: to match this '{'
4 | {
... |
s849453583 | p02255 | C++ | #include <stdio.h>
int main(void)
{
int i, j, N, v, k;
int A[100];
scanf ("%d\n", &N);
for (i = 0; i < N; i++) {
scanf ("%d ", &A[i]);
}
for (i = 1; i < N+1; i++) {
v = A[i];
j = i - 1;
for (k = 0; k < N; k++) {
printf("%d", A[k]);
if (k < N-1) printf(" ");
else pr... | a.cc: In function 'int main()':
a.cc:33:2: error: expected '}' at end of input
33 | }
| ^
a.cc:4:1: note: to match this '{'
4 | {
| ^
|
s060981062 | p02255 | C++ | #include<stdio.h>
int main (void) {
int i, n, j, a[1000], b[1000][1000] = 0, k = 0, v, temp;
scanf("%d", &n);
for (i = 0; i < n; ++i)
{
scanf("%d", &a[i]);
}
for (i = 1; i < n; ++i)
{
v = a[i];
j = i - 1;
while (j >= 0 && a[j] > v)
{
a[j+1] = a[j];
j--;
}
a[j+1] = v;
for (j = ... | a.cc: In function 'int main()':
a.cc:4:47: error: array must be initialized with a brace-enclosed initializer
4 | int i, n, j, a[1000], b[1000][1000] = 0, k = 0, v, temp;
| ^
|
s692240125 | p02255 | C++ | #include<stdio.h>
int main(void) {
int i, n, j, a[1000], b[1000][1000] = 0, k = 0, v, temp;
scanf("%d", &n);
for (i = 0; i < n; ++i)
{
scanf("%d", &a[i]);
}
for (i = 1; i < n; ++i)
{
v = a[i];
j = i - 1;
while (j >= 0 && a[j] > v)
{
a[j+1] = a[j];
j--;
}
a[j+1] = v;
for (j = 0... | a.cc: In function 'int main()':
a.cc:4:47: error: array must be initialized with a brace-enclosed initializer
4 | int i, n, j, a[1000], b[1000][1000] = 0, k = 0, v, temp;
| ^
|
s728557701 | p02255 | C++ | #include<stdio.h>
int main(void) {
int i, n, j, a[1000], k = 0, v;
scanf("%d", &n);
for (i = 0; i < n; ++i)
{
scanf("%d", &a[i]);
}
for (j = 0; j < n; ++j)
{
printf("%d", a[j]);
if (j != n-1) printf(" ")
}
printf("\n");
for (i = 1; i < n; ++i)
{
v = a[i];
j = i - 1;
while (j >= 0 && a[... | a.cc: In function 'int main()':
a.cc:15:42: error: expected ';' before '}' token
15 | if (j != n-1) printf(" ")
| ^
| ;
16 | }
| ~
a.cc:35:50: error:... |
s775611700 | p02255 | C++ | #include <iostream>
#include <sstream>
using namespace std;
void split(int * array){
string strhozon, str;
getline(cin, strhozon);
stringstream ss(strhozon);
int i =0;
while(getline(ss, str, ' ')){
array[i] = stoi(str);
i++;
}
}
void show(int * array, int x){
for (int i=0; i... | a.cc: In function 'int main(int, char**)':
a.cc:29:5: error: 'sprit' was not declared in this scope; did you mean 'split'?
29 | sprit(a) ;
| ^~~~~
| split
|
s978583355 | p02255 | C++ | #include <iostream>
#include <sstream>
using namespace std;
void split(int * array){
string strhozon, str;
getline(cin, strhozon);
stringstream ss(strhozon);
int i =0;
while(getline(ss, str, ' ')){
array[i] = stoi(str);
i++;
}
}
void show(int * array, int x){
for (int i=0; i... | a.cc: In function 'int main(int, char**)':
a.cc:28:5: error: 'sprit' was not declared in this scope; did you mean 'split'?
28 | sprit(a) ;
| ^~~~~
| split
|
s351619053 | p02255 | C++ | import java.io.IOException;
import java.util.Scanner;
class Test {
public static void main(String args[]) throws IOException {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int a[] = new int[n];
int val;
for(int i=0;i<n;i++){
val = scan.nextInt();
// System.out... | a.cc:1:1: error: 'import' does not name a type
1 | import java.io.IOException;
| ^~~~~~
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 '-fmodule... |
s407572253 | p02255 | C++ | #include <stdio.h>
#include <stdlib.h>
int main(void){
int i = 0;
int k = 0;
int j = 0;
int n;
int input;
int *num;
int temp;
scanf("%d", &n);
num = (int *)malloc(n * sizeof(int));
for(i = 0; i < n; i++){
scanf("%d", &input);
num[i] = input;
}
for(i = 1; i < n; i++){
for(k = i; k... | a.cc: In function 'int main()':
a.cc:26:22: error: expected ';' before '}' token
26 | num[k] = temp
| ^
| ;
27 | }
| ~
|
s488566644 | p02255 | C++ | #include <stdio.h>
#include <stdlib.h>
int main(void){
int i = 0;
int k = 0;
int j = 0;
int n;
int input;
int *num;
int temp;
scanf("%d", &n);
num = (int *)malloc(n * sizeof(int));
for(i = 0; i < n; i++){
scanf("%d", &input);
num[i] = input;
}
for(i = 1; i < n; i++){
for(k = i; k... | a.cc: In function 'int main()':
a.cc:29:9: error: 'print' was not declared in this scope; did you mean 'printf'?
29 | print("%d ", num[j]);
| ^~~~~
| printf
|
s325970345 | p02255 | C++ | #include <stdio.h>
#include <stdlib.h>
int main(void){
int i = 0;
int k = 0;
int j = 0;
int n;
int input;
int *num;
int temp;
scanf("%d", &n);
num = (int *)malloc(n * sizeof(int));
for(i = 0; i < n; i++){
scanf("%d", &input);
num[i] = input;
}
for(i = 0; i < n; i++){
printf("%d",... | a.cc: In function 'int main()':
a.cc:24:5: error: 'pintf' was not declared in this scope; did you mean 'printf'?
24 | pintf(" ");
| ^~~~~
| printf
a.cc:26:3: error: 'prinf' was not declared in this scope; did you mean 'printf'?
26 | prinf("\n")
| ^~~~~
| printf
a.cc:28:24... |
s925747515 | p02255 | C++ | #include <stdio.h>
#include <stdlib.h>
int main(void){
int i = 0;
int k = 0;
int j = 0;
int n;
int input;
int *num;
int temp;
scanf("%d", &n);
num = (int *)malloc(n * sizeof(int));
for(i = 0; i < n; i++){
scanf("%d", &input);
num[i] = input;
}
for(i = 0; i < n; i++){
printf("%d",... | a.cc: In function 'int main()':
a.cc:26:3: error: 'prinf' was not declared in this scope; did you mean 'printf'?
26 | prinf("\n")
| ^~~~~
| printf
a.cc:28:24: error: expected ';' before ')' token
28 | for(i = 1; i < n; i++){
| ^
| ;
|
s121129451 | p02255 | C++ | #include <iostream>
#include <sstream>
#include <string>
#include <stdio.h>
#include <tchar.h>
using namespace std;
string intArrayToString(int* ary, int ary_size);
void insert_sort(string ary, int ary_size);
int main()
{
string str;
getline(cin, str);
stringstream ss_size(str);
int ary_size;
ss_size >> ary_siz... | a.cc:5:10: fatal error: tchar.h: No such file or directory
5 | #include <tchar.h>
| ^~~~~~~~~
compilation terminated.
|
s082215054 | p02255 | C++ | #include <iostream>
using namespace std;
int main() {
int N,s;
cin >> N;
int A[N];
cin >> A[N];
for (i=1; i<=N-1; i++) {
v=A[i];
j=i-1;
while (j>=0 && A[j]>v){
A[j+1]=A[j];
j--;
}
A[j+1]=v;
for (s=0; s<=N-2; s++)
cout<<A[s]<<" ";
cout<<A[N-1]<<'\n';
}
// your code goes here
r... | a.cc: In function 'int main()':
a.cc:10:14: error: 'i' was not declared in this scope
10 | for (i=1; i<=N-1; i++) {
| ^
a.cc:11:17: error: 'v' was not declared in this scope
11 | v=A[i];
| ^
a.cc:12:17: error: 'j' was not declared in this scope
1... |
s335809287 | p02255 | C++ | #include <iostream>
using namespace std;
int main() {
int N, i, v, j, s;
cin >> N;
int A[N];
cin >> A[N];
for (i=1; i<=N-1; i++) {
v=A[i];
j=i-1;
while (j>=0 && A[j]>v){
A[j+1]=A[j];
j--;
}
A[j+1]=v;
for (s=0; s<=N-2; s++)
cout<<A[s]<<" ";
cout<<A[N-1]<<'\n';
}
// your code go... | a.cc:32:9: error: expected unqualified-id before 'return'
32 | return 0;
| ^~~~~~
a.cc:33:1: error: expected declaration before '}' token
33 | }
| ^
|
s171495864 | p02255 | C++ | #include <iostream>
void traceALDS11A(int arr[], int max) {
for (int i = 0; i < max; ++i) {
if (i)
std::cout << " ";
std::cout << arr[i];
}
std::cout << std::endl;
}
int ALDS11A() {
int N;
std::cin >> N;
int arr[N];
for (int i = 0; i < N; ++i) {
std::cin >> arr[i];
}
traceALDS11A(arr, N);
for (i... | /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
|
s022742254 | p02255 | C++ | #include <iostream>
void traceALDS11A(int arr[], int max) {
for (int i = 0; i < max; ++i) {
if (i)
std::cout << " ";
std::cout << arr[i];
}
std::cout << std::endl;
}
int ALDS11A() {
int N;
std::cin >> N;
int arr[N];
for (int i = 0; i < N; ++i) {
std::cin >> arr[i];
}
traceALDS11A(arr, N);
for (i... | /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
|
s718595729 | p02255 | C++ | int main(void) {
int N;
int A[1000];
int v;
int j;
scanf("%d", &N);
for (int i = 0; i < N; i++) scanf("%d", &A[i]);
//for (int j = 0; j < N; j++) printf("%d", A[j]);
for (int i = 0; i < N; i++) {
v = A[i];
j = i - 1;
while (j>=0) {
if (A[j] <= v) break;
A[j + 1] = A[j];
j--;
}
A[j + 1] = v;
... | a.cc: In function 'int main()':
a.cc:6:9: error: 'scanf' was not declared in this scope
6 | scanf("%d", &N);
| ^~~~~
a.cc:19:37: error: 'printf' was not declared in this scope
19 | for (int k = 0; k < N; k++) printf("%d\n", A[k]);
| ^~~~~~
a... |
s834201835 | p02255 | C++ | include<stdio.h>
void trace(int A[], int N){
int;i
for(i=0;i<N;i++){
if(i>0)printf(" ");
printf("%d", A[i]);
}
printf("\n");
}
void insertionSort(int A[], int N){
int j,i,v;
for(i=1;i<N;i++){
v = A[i];
j = i-1;
while(j>=0 && A[j] > v){
A[j+1] = A[j];
j--;
}
A[j+1] = v;
trace(A,N);
}
}
int mai... | a.cc:1:1: error: 'include' does not name a type
1 | include<stdio.h>
| ^~~~~~~
a.cc: In function 'void insertionSort(int*, int)':
a.cc:23:17: error: 'trace' was not declared in this scope
23 | trace(A,N);
| ^~~~~
a.cc: In function 'int main()':
a.cc:32:9: error: 'scanf... |
s705860818 | p02255 | C++ | #include<stdio.h>
void trace(int A[], int N){
int;i
for(i=0;i<N;i++){
if(i>0)printf(" ");
printf("%d", A[i]);
}
printf("\n");
}
void insertionSort(int A[], int N){
int j,i,v;
for(i=1;i<N;i++){
v = A[i];
j = i-1;
while(j>=0 && A[j] > v){
A[j+1] = A[j];
j--;
}
A[j+1] = v;
trace(A,N);
}
}
int ma... | a.cc: In function 'void trace(int*, int)':
a.cc:5:2: error: declaration does not declare anything [-fpermissive]
5 | int;i
| ^~~
a.cc:5:6: error: 'i' was not declared in this scope
5 | int;i
| ^
|
s681518196 | p02255 | C++ | import java.util.Scanner;
class InsertionSort {
static void arrayContents(int[] a){
for(int i = 0;i < a.length;i++){
if(i < a.length - 1){
System.out.print(a[i] + " ");
}
else{
System.out.print(a[i]);
}
}
System.out.println();
}
public static void main(St... | 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:4:35: error: expected ',' or '...' before 'a'
4 | static void arrayContents(int[] a){
| ^
a.cc:15:9: error:... |
s750527125 | p02255 | C++ | #include<iostream>
#include<vector>
using namespace std;
int main() {
int size;
cin >> size;
int* A = new int[10];
for(int i = 0; i < size; ++i) {
cin >> A[i];
cout << A[i];
????????????if(i!=size-1) cout<<" ";
}
cout << endl;
int key;
for(int i = 1; i < size; ++... | a.cc: In function 'int main()':
a.cc:12:1: error: expected primary-expression before '?' token
12 | ????????????if(i!=size-1) cout<<" ";
| ^
a.cc:12:2: error: expected primary-expression before '?' token
12 | ????????????if(i!=size-1) cout<<" ";
| ^
a.cc:12:3: error: expected primary-expression befor... |
s301704735 | p02255 | C++ | #define REP(i,n) for (int i=0;i<(n);i++)
using namespace std;
int N,v,j;
void insertionSort(int *list, int size);
void print(int *list, int size);
int main()
{
scanf("%d", &N);
int list[N];
REP(i, N){
scanf("%d", &list[i]);
}
insertionSort(list, N);
return 0;
}
void insertionSort(int ... | a.cc: In function 'int main()':
a.cc:12:5: error: 'scanf' was not declared in this scope
12 | scanf("%d", &N);
| ^~~~~
a.cc: In function 'void insertionSort(int*, int)':
a.cc:24:9: error: 'i' was not declared in this scope
24 | FOR(i, 1, size){
| ^
a.cc:24:5: error: 'FOR' was not d... |
s356552299 | p02255 | C++ | #include <iostream>
#define REP(i,n) for (int i=0;i<(n);i++)
using namespace std;
int N,v,j;
void insertionSort(int *list, int size);
void print(int *list, int size);
int main()
{
scanf("%d", &N);
int list[N];
REP(i, N){
scanf("%d", &list[i]);
}
insertionSort(list, N);
return 0;
}
voi... | a.cc: In function 'void insertionSort(int*, int)':
a.cc:25:9: error: 'i' was not declared in this scope
25 | FOR(i, 1, size){
| ^
a.cc:25:5: error: 'FOR' was not declared in this scope
25 | FOR(i, 1, size){
| ^~~
|
s043136163 | p02255 | C++ | #include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <math.h>
#include <time.h>
using namespace std;
void insertSort(int arr[], int n){
for(int i = 1;i < n;i++){
int temp = arr[i];
int j = i-1;
for(;j>=0;j--){
if(temp < arr[j]){
... | a.cc:57:5: error: redefinition of 'int main()'
57 | int main(){
| ^~~~
a.cc:34:5: note: 'int main()' previously defined here
34 | int main(){
| ^~~~
|
s765800468 | p02255 | C++ |
int main (void)
{
int i, N;
int A[100];
scanf("%d", &N);
for (i = 0; i < N; i++) {
scanf("%d", &A[i]);
}
for (i = 1; i < N; i++) {
int v = A[i];
int j = i - 1;
while (j >= 0 && A[j] > v) {
A[j+1] = A[j];
j--;
}
A[j+1] = v;
{
int k;
for ... | a.cc: In function 'int main()':
a.cc:6:4: error: 'scanf' was not declared in this scope
6 | scanf("%d", &N);
| ^~~~~
a.cc:23:21: error: 'printf' was not declared in this scope
23 | if (k > 0) printf(" ");
| ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstd... |
s137497684 | p02255 | C++ |
#include "stdafx.h"
#include<iostream>
using namespace std;
void trace(int A[], int N) {
for (int i = 0; i < N; i++) {
if(i>0){
cout << " " << endl;
}
cout << A[i] << endl;
}
}
void insertionSort(int A[], int N){
int v;
for (int i=1; i < N; i++) {
v = A[i];
int j = i - 1;
while (i >= 0 && A[j] > v... | a.cc:2:10: fatal error: stdafx.h: No such file or directory
2 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s233160947 | p02255 | C++ | #include<iostream>
#include<stdio.h>
#include<string>
#include<math.h>
#include<iomanip>
#include<algorithm>
#include<string.h>
#include<cctype>
#include<map>
#include<set>
#include<vector>
#include<sstream>
#include<stack>
#include<queue>
using namespace std;
int arr[100+5];
int main()
{
int... | a.cc: In function 'int main()':
a.cc:39:16: error: 'k' was not declared in this scope
39 | cout<<arr[k-1]<<endl;
| ^
|
s555086059 | p02255 | C++ | #include <stdio.h>
static const int N = 100;
void trace(int a[], int n) {
for (int i = 0; i < n; i++) {
if (i != 0) printf(" ");
printf("%d", a[i]);
}
printf("\n");
}
int main() {
int n;
int a[N];
scanf("%d", &n);
for (int i = 0; i < n; i++) scanf("%d", &a[i]);
for (i... | a.cc: In function 'int main()':
a.cc:29:6: error: expected '}' at end of input
29 | }
| ^
a.cc:13:12: note: to match this '{'
13 | int main() {
| ^
|
s178289892 | p02255 | C++ | #include<stdio.h>
static const int N = 1000;
void trace(int A[], int n){
int i;
for ( i = 1; i <= n; i++ ){
if ( i > 1 ){
printf(" ");
printf("%d", A[i]);
}
printf("\n");
}
int main(){
int n, i, j;
int A[N+1];
scanf("%d", &n);
for ( i = 1; i <= n; i++ ){
???scanf("%d", &A[i]);
... | a.cc: In function 'void trace(int*, int)':
a.cc:15:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
15 | int main(){
| ^~
a.cc:15:9: note: remove parentheses to default-initialize a variable
15 | int main(){
| ^~
| --
a.cc:15:9: ... |
s860945057 | p02255 | C++ | #include <iostream>
#include <vector>
int main()
{
std::vector<int> array;
std::vector<int>::iterator it;
it = array.begin;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:16: error: no match for 'operator=' (operand types are 'std::vector<int>::iterator' and '<unresolved overloaded function type>')
8 | it = array.begin;
| ^~~~~
In file included from /usr/include/c++/14/string:48,
from /usr/include/c++/1... |
s754603308 | p02255 | C++ | #include <iostream>
#include <vector>
int main()
{
std::vector<int> array;
std::vector<int>::iterator it;
it = array.begin;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:16: error: no match for 'operator=' (operand types are 'std::vector<int>::iterator' and '<unresolved overloaded function type>')
8 | it = array.begin;
| ^~~~~
In file included from /usr/include/c++/14/string:48,
from /usr/include/c++/1... |
s441847682 | p02255 | C++ | #include<stdio.h>
static const int N = 1000;
void trace(int A[], int n){
int i;
for ( i = 1; i <= n; i++ ){
if ( i > 1 ) printf(" ");
printf("%d", A[i]);
}
printf("\n");
}
void selectionSort(int A[], int n){
for(int i = 1; i < n; i++){
int temp = a[i];
int j = i-1;
while(j>=0 && temp < ... | a.cc: In function 'void selectionSort(int*, int)':
a.cc:16:16: error: 'a' was not declared in this scope
16 | int temp = a[i];
| ^
|
s065779113 | p02255 | C++ | #include <iostream>
using namespace std;
vector<int> A;
int N;
cin >> N;
for(int i = 0; i < N; i++)
{
cin >> A[i];
}
for(int i = 1; i < N-1; i++)
{
int j = i - 1;
int key = A[i];
while( j >= 0 && A[j] > key)
{
A[j + 1] = A[j];
j--;
}
A[j + 1] = key;
} | a.cc:4:1: error: 'vector' does not name a type
4 | vector<int> A;
| ^~~~~~
a.cc:7:1: error: 'cin' does not name a type
7 | cin >> N;
| ^~~
a.cc:8:1: error: expected unqualified-id before 'for'
8 | for(int i = 0; i < N; i++)
| ^~~
a.cc:8:16: error: 'i' does not name a type
8 | for(int i... |
s964275715 | p02255 | C++ | #include <iostream>
using namespace std;
vector<int> A;
int N;
cin >> N;
for(int i = 0; i < N; i++)
{
cin >> A[i];
}
for(int i = 1; i < N-1; i++)
{
int j = i - 1;
int key = A[i];
while( j >= 0 && A[j] > key)
{
A[j + 1] = A[j];
j--;
}
A[j + 1] = key;
} | a.cc:4:1: error: 'vector' does not name a type
4 | vector<int> A;
| ^~~~~~
a.cc:7:1: error: 'cin' does not name a type
7 | cin >> N;
| ^~~
a.cc:8:1: error: expected unqualified-id before 'for'
8 | for(int i = 0; i < N; i++)
| ^~~
a.cc:8:16: error: 'i' does not name a type
8 | for(int i... |
s128692610 | p02255 | C++ | #include <iostream>
#include <vector>
using namespace std;
vector<int> A;
int N;
cin >> N;
for(int i = 0; i < N; i++)
{
cin >> A[i];
}
for(int i = 1; i < N-1; i++)
{
int j = i - 1;
int key = A[i];
while( j >= 0 && A[j] > key)
{
A[j + 1] = A[j];
j--;
}
A[j + 1] = key;
} | a.cc:8:1: error: 'cin' does not name a type
8 | cin >> N;
| ^~~
a.cc:9:1: error: expected unqualified-id before 'for'
9 | for(int i = 0; i < N; i++)
| ^~~
a.cc:9:16: error: 'i' does not name a type
9 | for(int i = 0; i < N; i++)
| ^
a.cc:9:23: error: 'i' does not name a type... |
s458507118 | p02255 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main(){
vector<int> A;
int N;
cin >> N;
for(int i = 0; i < N; i++)
{
cin >> A[i];
}
for(int i = 1; i < N-1; i++)
{
int j = i - 1;
int key = A[i];
while( j >= 0 && A[j] > key)
{
A[j + 1] = A[j];
j--... | a.cc: In function 'int main()':
a.cc:25:23: error: expected ';' before 'i'
25 | for(int i= 0; i< N i++)
| ^~
| ;
|
s370327985 | p02255 | C++ | def insertion_sort(array, element_number):
for i in range(0, element_number):
v = array[i]
j = i - 1
while(j>=0 and array[j] > v):
array[j+1] = array[j]
j = j - 1
array[j+1] = v
for k in range(0, element_number):
if k < element_number:
... | a.cc:14:43: error: empty character constant
14 | print(array[k] + ' ', end='')
| ^~
a.cc:16:37: error: empty character constant
16 | print(array[k], end='')
| ^~
a.cc:19:29: error: empty chara... |
s214503087 | p02255 | C++ | // InsertionSort.cpp
#include <iostream>
const int ele_Ary = 1000;
void insertionSort(int *Ary, int Num) {
for(int i=1; i<Num; i++) {
int ver = Ary[i];
while( j>=0 && Ary[j] > ver) {
Ary[j+1] = Ary[j];
j--;
}
A[j+1] = ver;
}
};
int main(void) {
int Num;
int Ary[ele_Ary];
cin >> Num;
for(int i=0... | a.cc: In function 'void insertionSort(int*, int)':
a.cc:10:24: error: 'j' was not declared in this scope
10 | while( j>=0 && Ary[j] > ver) {
| ^
a.cc:14:17: error: 'A' was not declared in this scope
14 | A[j+1] = ver;
| ^
a.cc:14:1... |
s290166742 | p02255 | C++ | // InsertionSort.cpp
#include <iostream>
const int ele_Ary = 1000;
void insertionSort(int *Ary, int Num) {
for(int i=1; i<Num; i++) {
int ver = Ary[i];
while( int j>=0 && Ary[j] > ver) {
Ary[j+1] = Ary[j];
j--;
}
A[j+1] = ver;
}
};
int main(void) {
int Num;
int Ary[ele_Ary];
cin >> Num;
for(int... | a.cc: In function 'void insertionSort(int*, int)':
a.cc:10:29: error: expected initializer before '>=' token
10 | while( int j>=0 && Ary[j] > ver) {
| ^~
a.cc:10:29: error: expected ')' before '>=' token
10 | while( int j>=0 && Ary[j] > ver) {
... |
s966292726 | p02255 | C++ | #include<iostream>
//#include<cstdio>
//#include<cstdlib>
//#pragma warning(disable:4996)
using namespace std;
int main()
{
//freopen("debug\\input.txt", "r", stdin);
//freopen("debug\\output.txt", "w", stdout);
int N = 0;
cin >> N; //?????\?????????????´???°???
int * arry = new int[N]; //??????????????°????... | a.cc: In function 'int main()':
a.cc:32:30: error: 'j' was not declared in this scope
32 | cout << arry[j];
| ^
a.cc: At global scope:
a.cc:34:9: error: expected unqualified-id before 'return'
34 | return 0;
| ^~~~~~
a.cc:36:1: error: expect... |
s185001677 | p02255 | C++ | #include<iostream>
using namespace std;
int main()
{
int N = 0;
cin >> N; //?????\?????????????´???°???
int * arry = new int[N]; //??????????????°???????????°???
for (int i = 0; i < N; i++)
{
cin >> arry[i];
}
//??°????????¨??????
//insert sort ??§???
void Insertion_sort(int *, int);
Insertio... | a.cc: In function 'int main()':
a.cc:26:30: error: 'j' was not declared in this scope
26 | cout << arry[j];
| ^
a.cc: At global scope:
a.cc:28:9: error: expected unqualified-id before 'return'
28 | return 0;
| ^~~~~~
a.cc:30:1: error: expect... |
s259797436 | p02255 | C++ | #include<stdio.h>
int main(){
int i, j, k;
int N;
int num[100];
int tmp;
scanf("%d", &N);
for(i=0; i<n; i++){
scanf("%d", &num[i]);
}
for(i=0; i<n; i++){
for(j=0; j<n-1; j++){
if(num[j] >= num[j+1]){
tmp = num[j];
num[j] = num[j... | a.cc: In function 'int main()':
a.cc:8:16: error: 'n' was not declared in this scope
8 | for(i=0; i<n; i++){
| ^
a.cc:11:16: error: 'n' was not declared in this scope
11 | for(i=0; i<n; i++){
| ^
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.