submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s282859613 | p02261 | C | #include <stdio.h>
struct Card{
char suit;
char value;
};
void BubbleSort(struct Card *A, int length){
int i,j;
char a,b;
for(i=0;i<length;i++){
for(j=length-1;j>i;j--){
if(A[j].value<A[j-1].value){
a=A[j].value;
b=A[j].suit;
A[j].value=A[j-1].value;
A[j].suit=A[j-1].suit;
A[j-1].value=a;
... | main.c:126:8: error: redefinition of 'struct Card'
126 | struct Card{
| ^~~~
main.c:3:8: note: originally defined here
3 | struct Card{
| ^~~~
main.c:131:6: error: conflicting types for 'BubbleSort'; have 'void(struct Card *, int)'
131 | void BubbleSort(struct Card *A, int length){
... |
s472264671 | p02261 | C | #include<stdio.h>
struct Card{
char suit;
char value;
};
typedef struct Card Card;
void swap(Card *a, Card *b){
Card k;
k = *b;
*b = *a;
*a = k;
}
void Bubble(Card *C, int n){
int i, j;
for (i = 0; i <= n - 1; i++){
for (j = n - 1; j >= i + 1; j--){
if (C[j].value <... | main.c: In function 'main':
main.c:60:9: error: expected declaration or statement at end of input
60 | C2[i] = C1[i];
| ^~
main.c:60:9: error: expected declaration or statement at end of input
|
s189173831 | p02261 | C | #include<stdio.h>
struct Card{
char suit;
char value;
};
typedef struct Card Card;
void Bubble(Card *C, int n){
int i, j;
for (i = 0; i <= n - 1; i++){
for (j = n - 1; j >= i + 1; j--){
if (C[j].value < C[j - 1].value){
swap(&C[j], &C[j - 1]);
}
... | main.c: In function 'Bubble':
main.c:16:17: error: implicit declaration of function 'swap' [-Wimplicit-function-declaration]
16 | swap(&C[j], &C[j - 1]);
| ^~~~
main.c: In function 'Selection':
main.c:23:19: error: expected identifier or '(' before ';' token
23 | int i, j... |
s846410889 | p02261 | C++ | #include <bits/stdc++.h>
using namespace std;
void swap(string& card1, string& card2) {
string tmp = card1;
card1 = card2;
card2 = tmp;
}
int peek_number(string card) {
return atoi(&card[1]);
}
vector<string> bubble_sort(vector<string> cards) {
for (int i = 0; i < cards.size(); i++) {
for (int j = cards.size... | a.cc: In function 'bool is_stable(std::vector<std::__cxx11::basic_string<char> >, std::vector<std::__cxx11::basic_string<char> >)':
a.cc:41:37: error: no match for 'operator!=' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type... |
s357268924 | p02261 | 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
| |
s134733422 | p02261 | C++ | #define _CRT_SECURE_NO_WARNINGS
#include "bits/stdc++.h"
#include "libs.h"
#include <random>
#include <unordered_map>
#include <unordered_set>
//#include <opencv2/core.hpp>
//#include <opencv2/highgui.hpp>
//#include <opencv2/imgproc.hpp>
using namespace std;
//呪文
#define DUMPOUT cerr
#define dump(...) DUMPOUT<<" ";... | a.cc:3:10: fatal error: libs.h: No such file or directory
3 | #include "libs.h"
| ^~~~~~~~
compilation terminated.
|
s763735178 | p02261 | 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
| |
s108779978 | p02261 | C++ | #include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <map>
#define rep(i,n) Rep(i,0,n)
#define Rep(i,k,n) for(int i=k ; i<n ; i++)
#define rep1(i,n) for(int i=1 ; i<=n ; i++)
#define vi vector<int>
#define vii vector<int,int>
#define Sort(v) sort(v.begin(),v.end())
#de... | a.cc:23:30: error: use of parameter outside function body before ']' token
23 | void BubbleSort(int n,int x[n],string y[n]){
| ^
a.cc:23:31: error: expected ')' before ',' token
23 | void BubbleSort(int n,int x[n],string y[n]){
| ~ ^
| ... |
s108144729 | p02261 | C++ | #include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <map>
#define rep(i,n) Rep(i,0,n)
#define Rep(i,k,n) for(int i=k ; i<n ; i++)
#define rep1(i,n) for(int i=1 ; i<=n ; i++)
#define vi vector<int>
#define vii vector<int,int>
#define Sort(v) sort(v.begin(),v.end())
#de... | a.cc:23:30: error: use of parameter outside function body before ']' token
23 | void BubbleSort(int n,int x[n],string y[n]){
| ^
a.cc:23:31: error: expected ')' before ',' token
23 | void BubbleSort(int n,int x[n],string y[n]){
| ~ ^
| ... |
s640728991 | p02261 | C++ | #include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <map>
#define rep(i,n) Rep(i,0,n)
#define Rep(i,k,n) for(int i=k ; i<n ; i++)
#define rep1(i,n) for(int i=1 ; i<=n ; i++)
#define vi vector<int>
#define vii vector<int,int>
#define Sort(v) sort(v.begin(),v.end())
#de... | a.cc:23:30: error: use of parameter outside function body before ']' token
23 | void BubbleSort(int n,int x[n],string y[n]){
| ^
a.cc:23:31: error: expected ')' before ',' token
23 | void BubbleSort(int n,int x[n],string y[n]){
| ~ ^
| ... |
s942525286 | p02261 | C++ | #include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <map>
#define rep(i,n) Rep(i,0,n)
#define Rep(i,k,n) for(int i=k ; i<n ; i++)
#define rep1(i,n) for(int i=1 ; i<=n ; i++)
#define vi vector<int>
#define vii vector<int,int>
#define Sort(v) sort(v.begin(),v.end())
#de... | a.cc:58:30: error: use of parameter outside function body before ']' token
58 | string check(int n,string x[n] , string y[n]){
| ^
a.cc:58:31: error: expected ')' before ',' token
58 | string check(int n,string x[n] , string y[n]){
| ~ ^~
... |
s022912614 | p02261 | C++ | #include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <map>
#define rep(i,n) Rep(i,0,n)
#define Rep(i,k,n) for(int i=k ; i<n ; i++)
#define rep1(i,n) for(int i=1 ; i<=n ; i++)
#define vi vector<int>
#define vii vector<int,int>
#define Sort(v) sort(v.begin(),v.end())
#de... | a.cc:58:30: error: use of parameter outside function body before ']' token
58 | string check(int n,string x[n] , string y[n]){
| ^
a.cc:58:31: error: expected ')' before ',' token
58 | string check(int n,string x[n] , string y[n]){
| ~ ^~
... |
s005108353 | p02261 | C++ | #include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int bubble(int n, char a[n], int b[n]){
for(int i = 0; i < n; i++){
for(int j = n-1; j > 0; j--){
if(b[j] < b[j-1]){
swap(b[j], b[j-1]);
swap(a[j], a[j-1]);
}
}
}... | a.cc:6:27: error: use of parameter outside function body before ']' token
6 | int bubble(int n, char a[n], int b[n]){
| ^
a.cc:6:28: error: expected ')' before ',' token
6 | int bubble(int n, char a[n], int b[n]){
| ~ ^
| ... |
s724315052 | p02261 | C++ | #include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int bubble(int n, char a[n], int b[n]){
for(int i = 0; i < n; i++){
for(int j = n-1; j > 0; j--){
if(b[j] < b[j-1]){
swap(b[j], b[j-1]);
swap(a[j], a[j-1]);
}
}
}... | a.cc:6:27: error: use of parameter outside function body before ']' token
6 | int bubble(int n, char a[n], int b[n]){
| ^
a.cc:6:28: error: expected ')' before ',' token
6 | int bubble(int n, char a[n], int b[n]){
| ~ ^
| ... |
s438013875 | p02261 | C++ | #include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int bubble(int n, char a[n], int b[n]){
for(int i = 0; i < n; i++){
for(int j = n-1; j > 0; j--){
if(b[j] < b[j-1]){
swap(b[j], b[j-1]);
swap(a[j], a[j-1]);
}
}
}... | a.cc:6:27: error: use of parameter outside function body before ']' token
6 | int bubble(int n, char a[n], int b[n]){
| ^
a.cc:6:28: error: expected ')' before ',' token
6 | int bubble(int n, char a[n], int b[n]){
| ~ ^
| ... |
s291121419 | p02261 | C++ | #include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int bubble(int n, char a[n], int b[n]){
for(int i = 0; i < n; i++){
for(int j = n-1; j > 0; j--){
if(b[j] < b[j-1]){
swap(b[j], b[j-1]);
swap(a[j], a[j-1]);
}
}
}... | a.cc:6:27: error: use of parameter outside function body before ']' token
6 | int bubble(int n, char a[n], int b[n]){
| ^
a.cc:6:28: error: expected ')' before ',' token
6 | int bubble(int n, char a[n], int b[n]){
| ~ ^
| ... |
s925041661 | p02261 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int bubble(int n, char a[n], int b[n]){
for(int i = 0; i < n; i++){
for(int j = n-1; j > 0; j--){
if(b[j] < b[j-1]){
swap(b[j], b[j-1]);
swap(a[j], a[j-1]);
}
}
}
return 0;
}
... | a.cc:5:27: error: use of parameter outside function body before ']' token
5 | int bubble(int n, char a[n], int b[n]){
| ^
a.cc:5:28: error: expected ')' before ',' token
5 | int bubble(int n, char a[n], int b[n]){
| ~ ^
| ... |
s940239400 | p02261 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int bubble(int n, vector<char> a, vector<int> b){
for(int i = 0; i < n; i++){
for(int j = n-1; j > 0; j--){
if(b[j] < b[j-1]){
swap(b[j], b[j-1]);
swap(a[j], a[j-1]);
}
}
}
re... | a.cc:5:19: error: 'vector' has not been declared
5 | int bubble(int n, vector<char> a, vector<int> b){
| ^~~~~~
a.cc:5:25: error: expected ',' or '...' before '<' token
5 | int bubble(int n, vector<char> a, vector<int> b){
| ^
a.cc: In function 'int bubble(i... |
s273239808 | p02261 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int bubble(int n, char a[], int b[]){
for(int i = 0; i < n; i++){
for(int j = n-1; j > 0; j--){
if(b[j] < b[j-1]){
swap(b[j], b[j-1]);
swap(a[j], a[j-1]);
}
}
}
return 0;
}
in... | a.cc:38:30: error: use of parameter outside function body before ']' token
38 | bool isstable(int n, char a[n], char b[n]){
| ^
a.cc:38:31: error: expected ')' before ',' token
38 | bool isstable(int n, char a[n], char b[n]){
| ~ ^
| ... |
s644697268 | p02261 | C++ | #include<iostream>
struct Card {char suit, value; };
void bubble(struct Card A[], int N) {
for (int i = 0; i < N; i++) {
for (int j = N - 1; j >= i; j--) {
if (A[j].value < A[j-1].value) {
Card t = A[j]; A[j] = A[j - 1]; A[j - 1] = t;
}
}
}
}
void selection(struct Card A[], int N) {
for (int i = 0... | a.cc: In function 'int main()':
a.cc:63:14: error: 'print' is not a member of 'std'; did you mean 'printf'?
63 | std::print(C1, N);
| ^~~~~
| printf
a.cc:65:14: error: 'print' is not a member of 'std'; did you mean 'printf'?
65 | std::print(C2, N);
| ... |
s251355228 | p02261 | C++ | #include<iostream>
using namespace std;
struct Stable {
int Number;
char Mark;
};
void BubbleSort(Stable* Line, int N) {
for (int i = 0; i < N; ++i) {
for (int j = N - 1; j > i; --j) {
if (Line[j].Number < Line[j - 1].Number) {
int Case = Line[j].Number;
Line[j].Number = Line[j - 1].Number;
Line[j... | a.cc:80:1: error: extended character is not valid in an identifier
80 | Show(LineB, N);
| ^
a.cc:80:1: error: extended character is not valid in an identifier
a.cc:80:1: error: extended character is not valid in an identifier
a.cc:80:1: error: extended character is not valid in an identifier
a.cc: ... |
s574087278 | p02261 | C++ | #include<iostream>
using namespace std;
struct Stable {
int Number;
char Mark;
};
void BubbleSort(Stable* Line, int N) {
for (int i = 0; i < N; ++i) {
for (int j = N - 1; j > i; --j) {
if (Line[j].Number < Line[j - 1].Number) {
int Case = Line[j].Number;
Line[j].Number = Line[j - 1].Number;
Line[j... | a.cc:80:1: error: extended character is not valid in an identifier
80 | Show(LineB, N);
| ^
a.cc:80:1: error: extended character is not valid in an identifier
a.cc:80:1: error: extended character is not valid in an identifier
a.cc:80:1: error: extended character is not valid in an identifier
a.cc: ... |
s458999991 | p02261 | C++ | #include <iostream>
#include <algorithm>
#include <stdio.h>
#include <string>
static const int MAX = 200000;
using namespace std;
struct Card {char suit, value;};
void trace(Card a[], int n){
for(int i = 0; i < n; i++){
if(i) cout << " ";
cout << a[i].suit << a[i].value;
}
cout << endl;
}
void sSort(Ca... | a.cc: In function 'int main(int, const char**)':
a.cc:59:3: error: 'memcpy' was not declared in this scope
59 | memcpy(b, a, sizeof(a));
| ^~~~~~
a.cc:3:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include <algorithm>
+++ |+#include ... |
s994894033 | p02261 | C++ | #include <iostream>
#include <algorithm>
#include <stdio.h>
#include <string>
static const int MAX = 200000;
using namespace std;
struct Card {char suit, value;};
void trace(Card a[], int n){
for(int i = 0; i < n; i++){
if(i) cout << " ";
cout << a[i].suit << a[i].value;
}
cout << endl;
}
void sSort(Ca... | a.cc: In function 'int main(int, const char**)':
a.cc:59:3: error: 'memcpy' was not declared in this scope
59 | memcpy(b, a, sizeof(a));
| ^~~~~~
a.cc:3:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include <algorithm>
+++ |+#include ... |
s899189224 | p02261 | C++ | #include <iostream>
#include <algorithm>
#include <stdio.h>
#include <string>
static const int MAX = 200000;
using namespace std;
struct Card {char suit, value;};
void trace(Card a[], int n){
for(int i = 0; i < n; i++){
if(i) cout << " ";
cout << a[i].suit << a[i].value;
}
cout << endl;
}
void sSort(Ca... | a.cc: In function 'int main(int, const char**)':
a.cc:59:3: error: 'memcpy' was not declared in this scope
59 | memcpy(b, a, sizeof(a));
| ^~~~~~
a.cc:3:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include <algorithm>
+++ |+#include ... |
s859409947 | p02261 | C++ | #include <iostream>
#include <algorithm>
#include <stdio.h>
#include <string>
static const int MAX = 200000;
using namespace std;
struct Card {char suit, value;};
void trace(Card a[], int n){
for(int i = 0; i < n; i++){
if(i) cout << " ";
cout << a[i].suit << a[i].value;
}
cout << endl;
}
void sSort(C... | a.cc: In function 'int main(int, const char**)':
a.cc:60:3: error: 'memcpy' was not declared in this scope
60 | memcpy(b, a, sizeof(a));
| ^~~~~~
a.cc:3:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include <algorithm>
+++ |+#include ... |
s965432247 | p02261 | C++ | #include <iostream>
#include <algorithm>
#include <stdio.h>
#include <string>
static const int MAX = 200000;
using namespace std;
struct Card {char suit, value;};
void trace(Card a[], int n){
for(int i = 0; i < n; i++){
if(i) cout << " ";
cout << a[i].suit << a[i].value;
}
cout << endl;
}
void sSort(C... | a.cc: In function 'int main(int, const char**)':
a.cc:60:8: error: 'memcpy' is not a member of 'std'; did you mean 'wmemcpy'?
60 | std::memcpy(b, a, sizeof(a));
| ^~~~~~
| wmemcpy
|
s246045709 | p02261 | C++ | #include <stdio.h>
#include <algorithm>
using namespace std;
struct TRAMP{
char mark;
int number;
};
int main()
{
int n,min;
char buf[3];
scanf("%d",&n);
TRAMP selectArray[n],bubbleArray[n];
for(int i=0;i<n;i++){
scanf("%s",buf);
selectArray[i].mark=buf[0];
selectArray[i].number=buf[1... | a.cc: In function 'int main()':
a.cc:46:35: error: unable to find string literal operator 'operator""selectArray' with 'const char [6]', 'long unsigned int' arguments
46 | for(int i=0;i<n-1;i++) printf("%c%d "selectArray[i].mark,selectArray[i].number);
| ^~~~~~~~~~~~~~~~~~... |
s759155557 | p02261 | C++ | def bubble(A):
flag=True;
n=len(A)
i=0
while flag:
for j in range(n-1,i,-1):
if A[j][1]<A[j-1][1]:
A[j],A[j-1]=A[j-1],A[j]
flag=True
i+=1
def selection(A):
n=len(A)
for i in range(n):
minj=i
for j in range(i,n):
... | a.cc:30:7: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes
30 | print('Stable')
| ^~~~~~~~
a.cc:37:11: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes
37 | print('Stable')
| ^~~~~~~~
a.cc:39:11: warning: multi-charac... |
s767655750 | p02261 | C++ | #include<iostream>
using namespace std;
Struct Card{ char suit,value; };
void bubble(struct Card A[], int N) {
for (int i = 0;i < N;i++) {
for (int j = N - 1;j >= i + 1;j--) {
if (A[j].value < A[j - 1].value) {
Card t = A[j];
A[j] = A[j - 1];
A[j - 1] = t;
}
}
}
}
void selection(struct Card A... | a.cc:4:1: error: 'Struct' does not name a type; did you mean 'struct'?
4 | Struct Card{ char suit,value; };
| ^~~~~~
| struct
a.cc: In function 'void bubble(Card*, int)':
a.cc:9:32: error: invalid use of incomplete type 'struct Card'
9 | if (A[j].value < A[j - 1].value) {
... |
s206808860 | p02261 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
Struct Card {
unsigned int c;
unsigned int n;
};
// unsigned int e[101];
// unsigned int d[101];
unsigned char e[101][2];
unsigned char d[101][2];
bublesort(unsigned char d[][2], n)
{
unsigned int num = 0;
bool flag = true;
while (flag) {
flag = f... | a.cc:6:1: error: 'Struct' does not name a type; did you mean 'struct'?
6 | Struct Card {
| ^~~~~~
| struct
a.cc:15:33: error: 'n' has not been declared
15 | bublesort(unsigned char d[][2], n)
| ^
a.cc:15:1: error: ISO C++ forbids declaration of 'bublesort' with n... |
s247819885 | p02261 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
Struct Card {
unsigned int c;
unsigned int n;
} card;
// unsigned int e[101];
// unsigned int d[101];
unsigned char e[101][2];
unsigned char d[101][2];
bublesort(unsigned char d[][2], unsigned int n)
{
unsigned int num = 0;
bool flag = true;
while (... | a.cc:6:1: error: 'Struct' does not name a type; did you mean 'struct'?
6 | Struct Card {
| ^~~~~~
| struct
a.cc:9:3: error: 'card' does not name a type
9 | } card;
| ^~~~
a.cc:15:1: error: ISO C++ forbids declaration of 'bublesort' with no type [-fpermissive]
15 | bublesort(unsigned char ... |
s549697896 | p02261 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
Struct Card {
unsigned int c;
unsigned int n;
} card;
// unsigned int e[101];
// unsigned int d[101];
unsigned char e[101][2];
unsigned char d[101][2];
bublesort(unsigned char d[][2], unsigned int n)
{
unsigned int num = 0;
bool flag = true;
while (... | a.cc:6:1: error: 'Struct' does not name a type; did you mean 'struct'?
6 | Struct Card {
| ^~~~~~
| struct
a.cc:9:3: error: 'card' does not name a type
9 | } card;
| ^~~~
a.cc:15:1: error: ISO C++ forbids declaration of 'bublesort' with no type [-fpermissive]
15 | bublesort(unsigned char ... |
s910461977 | p02261 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
// unsigned int e[101];
// unsigned int d[101];
unsigned char e[101][2];
unsigned char d[101][2];
bublesort(unsigned char d[][2], unsigned int n)
{
unsigned int num = 0;
bool flag = true;
while (flag) {
flag = false;
for (unsigned int i = n-1; i ... | a.cc:12:1: error: ISO C++ forbids declaration of 'bublesort' with no type [-fpermissive]
12 | bublesort(unsigned char d[][2], unsigned int n)
| ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:66:29: error: expected primary-expression before ']' token
66 | cin >> e[i][];
| ... |
s001102293 | p02261 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
// unsigned int e[101];
// unsigned int d[101];
unsigned char e[101][2];
unsigned char d[101][2];
bublesort(unsigned int n)
{
unsigned int num = 0;
bool flag = true;
while (flag) {
flag = false;
for (unsigned int i = n-1; i > 0; --i) {
if (e[i]... | a.cc:11:1: error: ISO C++ forbids declaration of 'bublesort' with no type [-fpermissive]
11 | bublesort(unsigned int n)
| ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:65:29: error: expected primary-expression before ']' token
65 | cin >> e[i][];
| ^
a.cc:7... |
s451650582 | p02261 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
// unsigned int e[101];
// unsigned int d[101];
unsigned char e[101][2];
unsigned char d[101][2];
unsigned int bublesort(unsigned int n)
{
unsigned int num = 0;
bool flag = true;
while (flag) {
flag = false;
for (unsigned int i = n-1; i > 0; --i) ... | a.cc: In function 'int main()':
a.cc:65:29: error: expected primary-expression before ']' token
65 | cin >> e[i][];
| ^
a.cc:70:25: error: invalid conversion from 'unsigned char (*)[2]' to 'unsigned int' [-fpermissive]
70 | num = bublesort(e, n);
| ... |
s749926196 | p02261 | C++ | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
// unsigned int e[101];
// unsigned int d[101];
unsigned char e[101][2];
unsigned char d[101][2];
unsigned int bublesort(unsigned int n)
{
unsigned int num = 0;
bool flag = true;
while (flag) {
flag = false;
for (unsigned int i =... | a.cc: In function 'int main()':
a.cc:72:25: error: invalid conversion from 'unsigned char (*)[2]' to 'unsigned int' [-fpermissive]
72 | num = bublesort(e, n);
| ^
| |
| unsigned char (*)[2]
a.cc:72:24: error: too many a... |
s125386675 | p02261 | C++ | def show(array):
for i in range(len(array)):
if (i+1) >= len(array):
print(array[i])
else:
print(array[i], end=' ')
def bubble_sort(c, n):
for i in range(0, n):
for j in range(n-1, i, -1):
if c[j][1:] < c[j-1][1:]:
c[j], c[j-1] = c[j-... | a.cc:24:23: error: ':' without preceding '?'
24 | # if i != minj:
| ^
a.cc:24: error: unterminated #if
24 | # if i != minj:
a.cc:1:1: error: 'def' does not name a type
1 | def show(array):
| ^~~
|
s356542418 | p02261 | C++ | #include "bits/stdc++.h"
using namespace std;
string bubbleSort(vector<char> &Mb,vector<int> &Nb, int A);
string selectionSort(vector<char> &Ms,vector<int> &Ns, int A);
int main(void) {
int A;
cin >> A;
vector<char> M(A), Mb(A), Ms(A);
vector<int> N(A), Nb(A), Ns(A);
for (int i = 0; i < A; i++) cin >> M.at(i)... | a.cc: In function 'int main()':
a.cc:31:17: error: 'YN' was not declared in this scope; did you mean 'N'?
31 | cout << YN << endl;
| ^~
| N
|
s298425489 | p02261 | C++ | #include "bits/stdc++.h"
using namespace std;
string bubbleSort(vector<char> &Mb,vector<int> &Nb, int A);
string selectionSort(vector<char> &Ms,vector<int> &Ns, int A);
int main(void) {
int A;
cin >> A;
vector<char> M(A), Mb(A), Ms(A);
vector<int> N(A), Nb(A), Ns(A);
for (int i = 0; i < A; i++) cin >> M.at(i)... | a.cc: In function 'int main()':
a.cc:31:17: error: 'YN' was not declared in this scope; did you mean 'N'?
31 | cout << YN << endl;
| ^~
| N
|
s507924269 | p02261 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
void trace(string a[], int n) {
for (int i = 0; i < n; i++) {
if (i > 0) cout << " ";
cout << a[i];
}
cout << endl;
}
void bubbleSort(string r[], int n) {
for (int i = 0; i < n - 1; i++) {
for (int j = n - 1; j >= i... | a.cc: In function 'int main()':
a.cc:60:5: error: 'memcpy' was not declared in this scope
60 | memcpy(r1, r, sizeof(r));
| ^~~~~~
a.cc:3:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include <algorithm>
+++ |+#include <cstring>
... |
s849337676 | p02261 | C++ | #include <iostream>
#include <algorithm>
#include <array>
using namespace std;
void trace(string a[], int n) {
for (int i = 0; i < n; i++) {
if (i > 0) cout << " ";
cout << a[i];
}
cout << endl;
}
void bubbleSort(string r[], int n) {
for (int i = 0; i < n - 1; i++) {
for (int ... | a.cc: In function 'int main()':
a.cc:61:5: error: 'memcpy' was not declared in this scope
61 | memcpy(r1, r, sizeof(r));
| ^~~~~~
a.cc:4:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include <array>
+++ |+#include <cstring>
4 ... |
s580031027 | p02261 | C++ | #include <iostream>
#include <algorithm>
#include <array>
using namespace std;
void trace(string a[], int n) {
for (int i = 0; i < n; i++) {
if (i > 0) cout << " ";
cout << a[i];
}
cout << endl;
}
void bubbleSort(string r[], int n) {
for (int i = 0; i < n - 1; i++) {
for (int ... | a.cc: In function 'int main()':
a.cc:61:5: error: 'memcpy' was not declared in this scope
61 | memcpy(r1, r, sizeof(r));
| ^~~~~~
a.cc:4:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include <array>
+++ |+#include <cstring>
4 ... |
s096800117 | p02261 | C++ | #include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
static const int MAX = 36;
void trace(string a[], int n) {
for (int i = 0; i < n; i++) {
if (i > 0) cout << " ";
cout << a[i];
}
cout << endl;
}
void bubbleSort(string r[], int n) {
for (int i = 0; i < n ... | a.cc: In function 'int main()':
a.cc:58:12: error: 'r1' was not declared in this scope; did you mean 'r'?
58 | memcpy(r1, r, sizeof(r));
| ^~
| r
a.cc:59:12: error: 'r2' was not declared in this scope; did you mean 'r'?
59 | memcpy(r2, r, sizeof(r));
| ^~... |
s992070117 | p02261 | 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
| |
s862340230 | p02261 | C++ | #include<iostream>
using namespace std;
struct{
char suit;
int num;
}typedef Card;
bool isStable(Card* a1,Card* a2,int n){
for(int i = 0;i < n;i++){
if(a1[i].suit != a2[i].suit)
return false;
}
return true;
}
void printArray(Card* a,int n){
for(int i = 0;i < n;i++){
cout << a[i].suit << a[i].num << flush... | a.cc: In function 'int main()':
a.cc:67:9: error: 'memcpy' was not declared in this scope
67 | memcpy(a2,a1,n * sizeof(a1[0]));
| ^~~~~~
a.cc:2:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include<iostream>
+++ |+#include... |
s310644154 | p02261 | C++ | #include<stdc++.h>
using namespace std;
struct{
char suit;
int num;
}typedef Card;
bool isStable(Card* a1,Card* a2,int n){
for(int i = 0;i < n;i++){
if(a1[i].suit != a2[i].suit)
return false;
}
return true;
}
void printArray(Card* a,int n){
for(int i = 0;i < n;i++){
cout << a[i].suit << a[i].num << flush... | a.cc:1:9: fatal error: stdc++.h: No such file or directory
1 | #include<stdc++.h>
| ^~~~~~~~~~
compilation terminated.
|
s094347690 | p02261 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(){
int n, minj;
bool flag = false;
cin >> n;
string a[n], b[n], esc;
for(int i=0;i<n;i++){
cin >> a[i];
}
for(int i=0;i<n;i++){
b[i] = a[i];
}
for(int i=0;i<n;i++){
for(int j=n-1;j>i;j--){
... | a.cc: In function 'int main()':
a.cc:18:21: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'value'
18 | if(a[j].value < a[j-1].value){
| ^~~~~
a.cc:18:36: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member n... |
s667160022 | p02261 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(){
int n, minj;
bool flag = false;
cin >> n;
string a[n], b[n], esc;
for(int i=0;i<n;i++){
cin >> a[i];
}
for(int i=0;i<n;i++){
b[i] = a[i];
}
for(int i=0;i<n;i++){
for(int j=n-1;j>i;j--){
... | a.cc: In function 'int main()':
a.cc:18:21: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'value'
18 | if(a[j].value < a[j-1].value){
| ^~~~~
a.cc:18:36: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member n... |
s715556890 | p02261 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(){
int n, minj;
bool flag = false;
cin >> n;
string a[n], b[n], esc;
for(int i=0;i<n;i++){
cin >> a[i];
}
for(int i=0;i<n;i++){
b[i] = a[i];
}
for(int i=0;i<n;i++){
for(int j=n-1;j>i;j--){
... | a.cc: In function 'int main()':
a.cc:18:21: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'value'
18 | if(a[j].value < a[j-1].value){
| ^~~~~
a.cc:18:36: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member n... |
s768839228 | p02261 | C++ | #include <iostream>
#include <string>
#define N 100
using namespace std;
void BubbleSort(string s[N],int n)
{
cout<<
}
void SelectSort(string cs[N],int n,string s[N])
{
int i,j;
string temp[N];
for(i=0;i<n;i++)
{
temp[i]=cs[i];
}
for(i=0;i<n-1;i++)
{
int k=i;
for(j... | a.cc: In function 'void BubbleSort(std::string*, int)':
a.cc:8:1: error: expected primary-expression before '}' token
8 | }
| ^
|
s649965521 | p02261 | C++ | #include <iostream>
using namespace std;
struct card{
int flag;
string data;
};
struct card1[36],card2[36];
void BubbleSort(*struct,int);
void SelectionSort(*struct,int);
int CheckStability(*struct,int);
int main(){
int i,n;
cin>>n;
if(n==1){
cin>>card[0].data;
cout<<card[0].data<<endl;
cout<<card[... | a.cc:9:14: error: expected identifier before numeric constant
9 | struct card1[36],card2[36];
| ^~
a.cc:9:14: error: expected ']' before numeric constant
9 | struct card1[36],card2[36];
| ^~
| ]
a.cc:9:13: error: structured binding declaration cannot have... |
s815238778 | p02261 | C++ | #include <iostream>
using namespace std;
struct card{
int flag;
string data;
};
card card1[36],card2[36];
void BubbleSort(*struct,int);
void SelectionSort(*struct,int);
int CheckStability(*struct,int);
int main(){
int i,n;
cin>>n;
if(n==1){
cin>>card[0].data;
cout<<card[0].data<<endl;
cout<<card[0]... | a.cc:10:6: error: variable or field 'BubbleSort' declared void
10 | void BubbleSort(*struct,int);
| ^~~~~~~~~~
a.cc:10:18: error: expected primary-expression before 'struct'
10 | void BubbleSort(*struct,int);
| ^~~~~~
a.cc:10:25: error: expected primary-expression before 'int'
... |
s169654841 | p02261 | C++ | #include <iostream>
using namespace std;
struct card{
int flag;
string data;
};
card *card1[36],*card2[36];
void BubbleSort(*struct,int);
void SelectionSort(*struct,int);
int CheckStability(*struct,int);
int main(){
int i,n;
cin>>n;
if(n==1){
cin>>card[0].data;
cout<<card[0].data<<endl;
cout<<card[... | a.cc:10:6: error: variable or field 'BubbleSort' declared void
10 | void BubbleSort(*struct,int);
| ^~~~~~~~~~
a.cc:10:18: error: expected primary-expression before 'struct'
10 | void BubbleSort(*struct,int);
| ^~~~~~
a.cc:10:25: error: expected primary-expression before 'int'
... |
s721064299 | p02261 | C++ | struct Ca{char suit,value};
void BubbleSort(C, N){
int tmp;
for(int i = 0 t;i< N;i++){
for(int j = N-1;j>=0;j++){
if( C[j]< C[j-1]){
tmp=C[j];C[j]=C[j-1];C[j-1]=tmp;}
}
void SelectionSort(C, N)
int j,i,tmp,minj;
for(i = 0 t;i< N;i++){
minj = i
for( j = i ;j< N-1;j++){
... | a.cc:1:21: error: expected ';' at end of member declaration
1 | struct Ca{char suit,value};
| ^~~~~
| ;
a.cc:3:6: error: variable or field 'BubbleSort' declared void
3 | void BubbleSort(C, N){
| ^~~~~~~~~~
a.cc:3:17: error: 'C' was not declared... |
s240176357 | p02261 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <cmath>
#include <string>
#include <sstream>
#include <iomanip>
#include <complex>
using namespace std;
#define ll long long
#define vvi vector< vector<int> >
#define vi vector<int>
#define All(X) X.beg... | a.cc: In function 'void SelectionSort()':
a.cc:32:27: error: reference to 'data' is ambiguous
32 | mindata = data[i].second;
| ^~~~
In file included from /usr/include/c++/14/string:53,
from /usr/include/c++/14/bits/locale_classes.h:40,
... |
s768716619 | p02261 | C++ | #include<iostream>
using namespace std;
struct Card {char suit, value; };
void bubble(struct Card A[], int N){
for(int i = 0; i < N; i++){
for(int j = N - 1; j >= i; j--){
if(A[j].value < A[j - 1].value){
Card t = A[j];
A[j] = A[j - 1];
A[j - 1] = t;
}
}
}
}
void selec... | a.cc: In function 'void print(Card*, int)':
a.cc:35:38: error: expected primary-expression before ';' token
35 | cout << A[i].suit << A[i].value<<;
| ^
a.cc: At global scope:
a.cc:40:15: error: 'stable' was not declared in this scope; did you mean 'isStable'?
40 | bo... |
s662030520 | p02261 | C++ | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
int main(){
char A_symbol[36+1];//列の文字のみを格納する配列
char A_symboltmp[36+1];
int A_num[36+1];//列の数字のみ格納する配列
int A_numtmp[36+1];
int num;//数列の長さ(カードの枚数)
char tmpstr[3];
/*配列を0で初期化modify
for(int i=0;i<1001;i++){
A[i] = 0;
}
*/
cin ... | a.cc: In function 'void selectionSort(char*, int*, int)':
a.cc:83:28: error: expected ';' before '}' token
83 | cout <<endl
| ^
| ;
......
86 | }
| ~
|
s166759708 | p02261 | C++ | #include <iostream>
#include <vector>
using namespace std;
namespace util {
template<typename T >
vector<T> read_vector(function<T(string)> parse_func) {
int n;
cin >> n;
vector<T> v;
for (int i = 0; i < n; i++) {
string in;
cin >> in;
v.pus... | a.cc:8:27: error: 'function' was not declared in this scope
8 | vector<T> read_vector(function<T(string)> parse_func) {
| ^~~~~~~~
a.cc:3:1: note: 'std::function' is defined in header '<functional>'; this is probably fixable by adding '#include <functional>'
2 | #include <vec... |
s223140949 | p02261 | C++ | #include <iostream>
using namespace std;
struct Card{int num; char suit;};
void bubbleSort(Card c[], int N);
void selectionSort(Card c[], int N);
void showArray(Card c[], int N);
bool Stable(Card x[], Card y[], int N);
int main()
{
int N;
Card c1[36], c2[36];
cin >> N;
for(int i = 0; i < N; i++)
{
cin >> c1[i... | a.cc: In function 'void selectionSort(Card*, int)':
a.cc:53:31: error: 'j' was not declared in this scope
53 | Card temp = c[j];
| ^
|
s780167541 | p02261 | C++ | #include <iostream>
using namespace std;
struct Card{int num; char suit;};
void bubbleSort(struct Card c[], int N);
void selectionSort(struct Card c[], int N);
void showArray(struct Card c[], int N);
bool Stable(struct Card x[], struct Card y[], int N);
int main()
{
int N;
Card c1[36], c2[36];
cin ... | a.cc:60:6: error: variable or field 'showArray' declared void
60 | void showArray(structCard c[], int N)
| ^~~~~~~~~
a.cc:60:16: error: 'structCard' was not declared in this scope; did you mean 'struct'?
60 | void showArray(structCard c[], int N)
| ^~~~~~~~~~
| ... |
s683440968 | p02261 | C++ | #include <iostream>
using namespace std;
struct Card { int num; char suit; };
void bubbleSort(struct Card c[], int N)
{
for(int i = 0; i < N; i++)
for(int j = N-1; j>=i; j--)
if(c[j].num < c[j-1].num)
{
Card temp = c[j];
c[j] = c[j-1];
c[j-1] = temp;
}
showArray(c, N);
}
void selectionSort(s... | a.cc: In function 'void bubbleSort(Card*, int)':
a.cc:16:9: error: 'showArray' was not declared in this scope
16 | showArray(c, N);
| ^~~~~~~~~
a.cc: In function 'void selectionSort(Card*, int)':
a.cc:32:9: error: 'showArray' was not declared in this scope
32 | showArray(c, N);
... |
s989629393 | p02261 | C++ | # ALDS1_2_C Stable Sort
n = gets.chomp.to_i
a = gets.chomp.split(" ")
def bubbleSort(c, n)
a = c.dup
(0..n-1).each do |i|
(n-1).downto(i) do |j|
if a[j][1].to_i < a[j-1][1].to_i
a[j], a[j-1] = a[j-1], a[j]
end
end
end
return a
end
def selectionSort(c, n)
a = c.dup
(0..n-1).each ... | a.cc:1:3: error: invalid preprocessing directive #ALDS1_2_C
1 | # ALDS1_2_C Stable Sort
| ^~~~~~~~~
a.cc:6:4: error: too many decimal points in number
6 | (0..n-1).each do |i|
| ^~~~
a.cc:18:4: error: too many decimal points in number
18 | (0..n-1).each do |i|
| ^~~~
a.cc:2:1: e... |
s961363263 | p02261 | C++ | #include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b) - 1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=n-1;i>=0;i--)
#define PB push_back
#define INF INT_MAX/3
#define ALL(a) (a).begin(),(a).end()
#define CLR(a) memset(a,0,sizeof(a))
... | a.cc: In function 'int main()':
a.cc:58:10: error: 'cou' was not declared in this scope; did you mean 'cos'?
58 | else cou
| ^~~
| cos
a.cc:58:13: error: expected '}' at end of input
58 | else cou
| ^
a.cc:36:11: note: to match this '{'
36 | int main(){
... |
s180981840 | p02261 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
struct card {
int num;
char ch;
};
void show(card cd[], int n) {
for (int i = 0; i < n - 1; i++)
cout << cd[i].ch<<cd[i].num << " ";
cout << cd[n - 1].ch<< cd[n - 1].num << endl;
}
void isStable(card cd_1[], card cd_2[], int n) {
int j = 0;
for (... | a.cc: In function 'int main()':
a.cc:78:18: error: expected '}' at end of input
78 | return 0;
| ^
a.cc:58:12: note: to match this '{'
58 | int main() {
| ^
|
s622880846 | p02261 | C++ | #include <iostream>
using namespace std;
struct Trump{
string suit;
string num;
};
void bubble_sort(Trump trump[],int n){
for(int i=0;i<n;i++){
for(int j=1;j<n-i;j++){
if(trump[j-1].num > trump[j].num){
swap(trump[j-1],trump[j]);
}
}
}
}
void se... | a.cc: In function 'int main()':
a.cc:52:14: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'Trump')
52 | cout << a[i] << " ";
| ~~~~ ^~ ~~~~
| | |
| | Trump
| std::ostream {aka s... |
s318032925 | p02261 | C++ | #include <iostream>
#include <string>
using namespace std;
struct Trump{
string suit;
string num;
};
void BubbleSort(Trump trump[], int n){
for (int i = 0; i < n-1 ; i++){
for (int j = n - 1; j >= i ; j--){
if (trump[j].num < trump[j - 1].num){
swap(trump[j], trump[j - 1]);
}
}
... | a.cc: In function 'int main()':
a.cc:57:14: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'Trump')
57 | cout << a[i] << " ";
| ~~~~ ^~ ~~~~
| | |
| | Trump
| std::ostream {aka s... |
s468435109 | p02261 | C++ | #include <iostream>
#include <string>
using namespace std;
struct Trump{
string suit;
string num;
};
void BubbleSort(Trump trump[], int n){
for (int i = 0; i < n-1 ; i++){
for (int j = n - 1; j >= i ; j--){
if (trump[j].num < trump[j - 1].num){
swap(trump[j], trump[j - 1]);
}
}
... | a.cc: In function 'int main()':
a.cc:57:14: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'Trump')
57 | cout << a[i] << " ";
| ~~~~ ^~ ~~~~
| | |
| | Trump
| std::ostream {aka s... |
s292187001 | p02261 | C++ | #include <iostream>
#include<algorithm>
using namespace std;
void BubbleSort(string C[], int N)
{
for(int i = 0; i < N; i++)
for(int j = N - 1; j > i; j--)
if(C[j][1] < C[j - 1][1])
swap(C[j], C[j - 1]);
}
void SelectionSort(string C[], int N)
{
for(int i = 0, minj; i < N; i++){
minj = i;
for... | a.cc: In function 'int main()':
a.cc:47:12: error: could not convert 'a[i].std::__cxx11::basic_string<char>::operator=(b[i])' from 'std::__cxx11::basic_string<char>' to 'bool'
47 | if(a[i]=b[i])
| ~~~~^~~~~
| |
| std::__cxx11::basic_string<char>
a.cc:48:5: error: ex... |
s132915046 | p02261 | C++ | #include "iostream"
using namespace std;
void sentaku(int a[100], char k[100][2], int num ) {
for (int i = 0; i < num; i++) {
int minj = i;
int s = 0;
for (int j = i; j < num; j++) {
if (a[j] < a[minj]) {
minj = j;
s = 1;
}
}
if (s == 1) {
int b = a[i];
a[i] = a[minj];
a[minj] = b;
... | a.cc: In function 'void baburu(int*, char (*)[2], int)':
a.cc:60:33: error: 'snum' was not declared in this scope; did you mean 'num'?
60 | snum++;
| ^~~~
| num
|
s319749330 | p02261 | C++ | // -*- mode:c++; coding:utf-8; c-basic-offset:2; -*-
// ALDS1_2-C: Stable Sort
#include <cstring>
#include <algorithm>
#include <iostream>
struct Card {
char suit;
unsigned int rank;
bool operator<(const Card& rhs) { return rank < rhs.rank; }
};
std::ostream& operator<<(std::ostream& os, const Card& card)
{
... | a.cc: In function 'int main()':
a.cc:87:19: error: no match for 'operator!=' (operand types are 'Card' and 'Card')
87 | if (cards2[i] != cards1[i]) {
| ~~~~~~~~~ ^~ ~~~~~~~~~
| | |
| Card Card
a.cc:89:7: error: return-statement with no ... |
s015536792 | p02261 | C++ | #include<stdio.h>
#include<string.h>
#define N 36
void BubbleSort(int, char [][3]);
void SelectionSort(int, char [][3]);
int isStable(char [][3], char [][3],int);
int main(){
int i,j,n;
char array[N][3],arrayB[N][3],arrayS[N][3];
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%s",arrayB[i]);
strcpy(arrayS[i... | a.cc:36:35: error: use of parameter outside function body before ']' token
36 | void BubbleSort(int n,char array[n][3]){
| ^
a.cc: In function 'void BubbleSort(...)':
a.cc:42:11: error: 'n' was not declared in this scope
42 | for(j=n-1;j>0;j--){
| ^
a.cc... |
s757585336 | p02261 | C++ | /***
* ??????????????????
* ???????¨??????????????????§?????????????°????minj???????????????????????????????????????????????´???????????¢?????´????????????
****/
#include <iostream>
#include <vector>
using namespace std;
int main(void) //???????????¢??°
{
int n;
cin >> n;
vector <int> str;
str.resize(n);
f... | a.cc: In function 'int main()':
a.cc:31:33: error: 'cnter' was not declared in this scope
31 | cnter ++;
| ^~~~~
a.cc: At global scope:
a.cc:50:9: error: expected unqualified-id before 'for'
50 | for( int i=0 ; i <= ( n-1 ) ; i++ ){
... |
s871604604 | p02261 | C++ | #include <iostream>
using namespace std;
#define MAX = 36;
int N;
pair<char, int> = arr_bubble[MAX];
pair<char, int> = arr_selection[MAX];
void bubble_sort();
void selection_sort();
int main(){
char type;
int number;
cin >> N;
for(int i=0; i<N; i++){
cin >> type;
cin >> number;
arr_bubble[i].firs... | a.cc:7:17: error: expected unqualified-id before '=' token
7 | pair<char, int> = arr_bubble[MAX];
| ^
a.cc:7:33: error: expected unqualified-id before ']' token
7 | pair<char, int> = arr_bubble[MAX];
| ^
a.cc:8:17: error: expected unqualified-id before... |
s079642408 | p02261 | C++ | #include <iostream>
using namespace std;
#define MAX 36;
int N;
pair<char, int> = arr_bubble[MAX];
pair<char, int> = arr_selection[MAX];
void bubble_sort();
void selection_sort();
int main(){
char type;
int number;
cin >> N;
for(int i=0; i<N; i++){
cin >> type;
cin >> number;
arr_bubble[i].first ... | a.cc:7:17: error: expected unqualified-id before '=' token
7 | pair<char, int> = arr_bubble[MAX];
| ^
a.cc:7:33: error: expected unqualified-id before ']' token
7 | pair<char, int> = arr_bubble[MAX];
| ^
a.cc:8:17: error: expected unqualified-id before... |
s773632289 | p02261 | C++ | #include <iostream>
using namespace std;
#define MAX 36;
int N;
pair<char, int> arr_bubble[MAX];
pair<char, int> arr_selection[MAX];
void bubble_sort();
void selection_sort();
int main(){
char type;
int number;
cin >> N;
for(int i=0; i<N; i++){
cin >> type;
cin >> number;
arr_bubble[i].first = ty... | a.cc:4:15: error: expected ']' before ';' token
4 | #define MAX 36;
| ^
a.cc:7:28: note: in expansion of macro 'MAX'
7 | pair<char, int> arr_bubble[MAX];
| ^~~
a.cc:7:31: error: expected unqualified-id before ']' token
7 | pair<char, int> arr_bubble[MAX];... |
s838020133 | p02261 | C++ | # http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_2_C&lang=jp
sample_input = list(range(3))
sample_input[0] = '''5
H4 C9 S4 D2 C3'''
sample_input[1] = '''2
S1 H1'''
sample_input[2] = '''5
H4 C9 S4 D2 C3'''
give_sample_input = None
if give_sample_input is not None:
sample_input_list = sample_input[giv... | a.cc:1:3: error: invalid preprocessing directive #http
1 | # http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_2_C&lang=jp
| ^~~~
a.cc:3:19: error: empty character constant
3 | sample_input[0] = '''5
| ^~
a.cc:3:21: warning: missing terminating ' character
3 | sa... |
s712014783 | p02261 | C++ | #include<iostream>
using namespace std;
struct Card { char suit, value;};
void bubble{struct Card A[], int N){
for( int i = 0; i < N; i++){
for(int j = N -1; j >= i; j--){
if(A[j].value < A[j-1].value){
Card t = A[j]; A[j] = A[j - 1]; A[j - 1] = t;
}
}
}
}
void selection(struct Card A[], int... | a.cc:6:6: error: variable or field 'bubble' declared void
6 | void bubble{struct Card A[], int N){
| ^~~~~~
a.cc:6:13: error: expected primary-expression before 'struct'
6 | void bubble{struct Card A[], int N){
| ^~~~~~
a.cc:6:13: error: expected '}' before 'struct'
6 | void bub... |
s128071104 | p02261 | C++ | #include<iostream>
using namespace std;
struct Card { char suit, value;};
void bubble(struct Card A[], int N){
for( int i = 0; i < N; i++){
for(int j = N -1; j >= i; j--){
if(A[j].value < A[j-1].value){
Card t = A[j]; A[j] = A[j - 1]; A[j - 1] = t;
}
}
}
}
void selection(struct Card A[], int... | a.cc:34:48: error: expected ')' before ';' token
34 | bool isStable(struct Card C1[],struct Card C2[];, int N){
| ~ ^
| )
a.cc:34:49: error: expected unqualified-id before ',' token
34 | bool isStable(struct Ca... |
s473635257 | p02261 | C++ | #include<iostream>
using namespace std;
struct Card { char suit, value;};
void bubble(struct Card A[], int N){
for( int i = 0; i < N; i++){
for(int j = N -1; j >= i; j--){
if(A[j].value < A[j-1].value){
Card t = A[j]; A[j] = A[j - 1]; A[j - 1] = t;
}
}
}
}
void selection(struct Card A[], int... | a.cc:34:48: error: expected ')' before ';' token
34 | bool isStable(struct Card C1[],struct Card C2[];, int N){
| ~ ^
| )
a.cc:34:49: error: expected unqualified-id before ',' token
34 | bool isStable(struct Ca... |
s138003345 | p02261 | C++ | import java.util.Arrays;
import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
String[] a=new String[n];
String[] b=new String[n];
for(int i=0;i<n;i++){
a[i]=sc.next();
... | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.Arrays;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import java.util.Scanner;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-t... |
s021094801 | p02261 | C++ | #include <algorithm>
#include <cassert>
#include <map>
#include <string>
#include <iostream>
#include <memory>
#include <ostream>
class Trump {
friend std::ostream& operator<<(std::ostream& os, const Trump& trump);
public:
enum class Mark {
None = 0,
Heart,
Diamond,
Spade,
... | a.cc: In member function 'Trump& Trump::operator=(Trump&&)':
a.cc:100:25: error: cannot bind non-const lvalue reference of type 'Trump&' to an rvalue of type 'std::remove_reference<Trump&>::type' {aka 'Trump'}
100 | this->swap(std::move(rhs));
| ~~~~~~~~~^~~~~
a.cc:33:22: note: initializing... |
s002144294 | p02261 | C++ | #include <algorithm>
#include <cassert>
#include <map>
#include <string>
#include <iostream>
#include <memory>
#include <ostream>
class Trump {
friend std::ostream& operator<<(std::ostream& os, const Trump& trump);
public:
enum class Mark {
None = 0,
Heart,
Diamond,
Spade,
... | a.cc: In function 'int main()':
a.cc:277:5: error: 'memcpy' was not declared in this scope
277 | memcpy(arr1.get(), arr0.get(), sizeof(Trump) * n);
| ^~~~~~
a.cc:7:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
6 | #include <memory>
+++ ... |
s128453733 | p02261 | C++ | #include <iostream>
using namespace std;
class Card{
public:
int m;
int n;
};
int main(void){
int n,min,f=0;
Card b[36],s[36];
cin>>n;
for(int i=0;i<n;i++){
cin>>b[i].m>>b[i].n;
s[i]=b[i];
}
for(int i=0;i<n-;i++){
for(int j=n-1;j>i;j--){
if(b[j-1]>b[j])
swap(b[j-1],b[j]);
}
}
... | a.cc: In function 'int main()':
a.cc:16:19: error: expected primary-expression before ';' token
16 | for(int i=0;i<n-;i++){
| ^
a.cc:18:16: error: no match for 'operator>' (operand types are 'Card' and 'Card')
18 | if(b[j-1]>b[j])
| ~~~~~~^~~~~
| ... |
s176261217 | p02261 | C++ | #include<stdio.h>
#include<iostream>
using namespace std;
struct Card{char suit,value };
void bubble(struct Card A[], int n){
int i,j;
bool flag=1;
for ( i = 0; flag; i++ ){
flag=0;
for ( j = n-1; i < j; j-- ){
if(A[j].value < A[j-1].value){
swap(A[j],A[j-1]);
flag=1;
... | a.cc:4:23: error: expected ';' at end of member declaration
4 | struct Card{char suit,value };
| ^~~~~
| ;
a.cc:32:6: error: variable or field 'print' declared void
32 | void print(Struct Card A[],int N){
| ^~~~~
a.cc:32:12: error: 'Struct' ... |
s326611556 | p02261 | C++ | #include<stdio.h>
#include<iostream>
using namespace std;
struct Card{char suit,value;};
void bubble(struct Card A[], int n){
int i,j;
bool flag=1;
for ( i = 0; flag; i++ ){
flag=0;
for ( j = n-1; i < j; j-- ){
if(A[j].value < A[j-1].value){
swap(A[j],A[j-1]);
flag=1;
... | a.cc:32:6: error: variable or field 'print' declared void
32 | void print(Struct Card A[],int N){
| ^~~~~
a.cc:32:12: error: 'Struct' was not declared in this scope; did you mean 'struct'?
32 | void print(Struct Card A[],int N){
| ^~~~~~
| struct
a.cc:32:28: error: exp... |
s084080730 | p02261 | C++ | #include<stdio.h>
#include<iostream>
using namespace std;
struct Card{char suit,value;};
void bubble(struct Card A[], int n){
int i,j;
bool flag=1;
for ( i = 0; flag; i++ ){
flag=0;
for ( j = n-1; i < j; j-- ){
if(A[j].value < A[j-1].value){
swap(A[j],A[j-1]);
flag=1;
... | a.cc: In function 'void print(Card*, int)':
a.cc:33:9: error: 'i' was not declared in this scope
33 | for ( i = 0; i < n; i++ ){
| ^
a.cc:33:20: error: 'n' was not declared in this scope
33 | for ( i = 0; i < n; i++ ){
| ^
a.cc: At global scope:
a.cc:39:32: error: 'Struc... |
s357392716 | p02261 | C++ | #include<stdio.h>
#include<iostream>
using namespace std;
struct Card{char suit,value;};
void bubble(struct Card A[], int n){
int i,j;
bool flag=1;
for ( i = 0; flag; i++ ){
flag=0;
for ( j = n-1; i < j; j-- ){
if(A[j].value < A[j-1].value){
swap(A[j],A[j-1]);
flag=1;
... | a.cc: In function 'void print(Card*, int)':
a.cc:34:20: error: 'n' was not declared in this scope
34 | for ( i = 0; i < n; i++ ){
| ^
a.cc: At global scope:
a.cc:40:32: error: 'Struct' has not been declared
40 | bool isStable(struct Card A1[],Struct Card A2[],int n){
| ... |
s811828962 | p02261 | C++ | #include<stdio.h>
#include<iostream>
using namespace std;
struct Card{char suit,value;};
void bubble(struct Card A[], int n){
int i,j;
bool flag=1;
for ( i = 0; flag; i++ ){
flag=0;
for ( j = n-1; i < j; j-- ){
if(A[j].value < A[j-1].value){
swap(A[j],A[j-1]);
flag=1;
... | a.cc: In function 'void print(Card*, int)':
a.cc:34:20: error: 'n' was not declared in this scope
34 | for ( i = 0; i < n; i++ ){
| ^
a.cc: At global scope:
a.cc:40:32: error: 'Struct' has not been declared
40 | bool isStable(struct Card A1[],Struct Card A2[],int n){
| ... |
s862101358 | p02261 | C++ | #include<stdio.h>
#include<iostream>
using namespace std;
struct Card{char suit,value;};
void bubble(struct Card A[], int n){
int i,j;
bool flag=1;
for ( i = 0; flag; i++ ){
flag=0;
for ( j = n-1; i < j; j-- ){
if(A[j].value < A[j-1].value){
swap(A[j],A[j-1]);
flag=1;
... | a.cc:40:32: error: 'Struct' has not been declared
40 | bool isStable(struct Card A1[],Struct Card A2[],int n){
| ^~~~~~
a.cc:40:44: error: expected ',' or '...' before 'A2'
40 | bool isStable(struct Card A1[],Struct Card A2[],int n){
| ... |
s096296653 | p02261 | C++ | #include<stdio.h>
#include<iostream>
using namespace std;
struct Card{char suit,value;};
void bubble(struct Card A[], int n){
int i,j;
bool flag=1;
for ( i = 0; flag; i++ ){
flag=0;
for ( j = n-1; i < j; j-- ){
if(A[j].value < A[j-1].value){
swap(A[j],A[j-1]);
flag=1;
... | a.cc: In function 'bool isStable(Card*, Card*, int)':
a.cc:42:3: error: expected initializer before 'for'
42 | for ( i = 0; i < n; i++ ){
| ^~~
a.cc:42:16: error: 'i' was not declared in this scope
42 | for ( i = 0; i < n; i++ ){
| ^
a.cc:48:1: warning: no return statement in func... |
s531934950 | p02261 | C++ | #include<stdio.h>
#include<iostream>
using namespace std;
struct Card{char suit,value;};
void bubble(struct Card A[], int n){
int i,j;
bool flag=1;
for ( i = 0; flag; i++ ){
flag=0;
for ( j = n-1; i < j; j-- ){
if(A[j].value < A[j-1].value){
swap(A[j],A[j-1]);
flag=1;
... | a.cc: In function 'int main()':
a.cc:62:24: error: expected ';' before '{' token
62 | if (isStable(C1,C2,n){
| ^
| ;
a.cc:64:4: error: expected primary-expression before 'else'
64 | }else{
| ^~~~
a.cc:64:4: error: expected ')' before 'else'
... |
s232335385 | p02261 | C++ | #include<stdio.h>
#include<iostream>
using namespace std;
struct Card{char suit,value;};
void bubble(struct Card A[], int n){
int i,j;
bool flag=1;
for ( i = 0; flag; i++ ){
flag=0;
for ( j = n-1; i < j; j-- ){
if(A[j].value < A[j-1].value){
swap(A[j],A[j-1]);
flag=1;
... | a.cc: In function 'int main()':
a.cc:63:24: error: expected ';' before '{' token
63 | if (isStable(C1,C2,n){
| ^
| ;
a.cc:65:4: error: expected primary-expression before 'else'
65 | }else{
| ^~~~
a.cc:65:4: error: expected ')' before 'else'
... |
s109289447 | p02261 | C++ | #include <iostream>
#include <map>
struct card {
int number;
char suit;
int order;
};
void swap(int i, int j, card a[]) {
card tmp = a[i];
a[i] = a[j];
a[j] = tmp;
}
int main() {
int n;
std::cin >> n;
int orders[9];
for (int i=0; i<9; i++) {
orders[i] = 0;
}
ca... | a.cc: In function 'int main()':
a.cc:30:5: error: 'memcpy' was not declared in this scope
30 | memcpy(b, a, n * sizeof(card));
| ^~~~~~
a.cc:3:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include <map>
+++ |+#include <cstring>
... |
s451374828 | p02261 | C++ | #include <iostream>
using namespace std;
class Card {
public:
int num;
char ch;
};
inline void bubbleSort(Card a[], int n){
bool flag = 1;
for (int i = 0; flag; i++) {
flag = 0;
for (int j = n - 1; j >= i + 1; j--) {
if (a[j].num < a[j - 1].num) {
swap(a[j], a... | a.cc: In function 'bool isStable(Card*, Card*, int)':
a.cc:40:17: error: no match for 'operator!=' (operand types are 'Card' and 'Card')
40 | if(a[i] != b[i]){
| ~~~~ ^~ ~~~~
| | |
| Card Card
In file included from /usr/include/c++/14/iosfwd:4... |
s819446550 | p02261 | C++ | #include <iostream>
using namespace std;
class Card {
public:
int num;
char ch;
};
inline void bubbleSort(Card a[], int n){
bool flag = 1;
for (int i = 0; flag; i++) {
flag = 0;
for (int j = n - 1; j >= i + 1; j--) {
if (a[j].num < a[j - 1].num) {
swap(a[j], a... | a.cc: In function 'bool isStable(Card*, Card*, int)':
a.cc:40:17: error: no match for 'operator!=' (operand types are 'Card' and 'Card')
40 | if(a[i] != b[i]){
| ~~~~ ^~ ~~~~
| | |
| Card Card
In file included from /usr/include/c++/14/iosfwd:4... |
s000035357 | p02261 | C++ | #include <iostream>
using namespace std;
class Card {
public:
int num;
char ch;
};
inline void bubbleSort(Card a[], int n){
bool flag = 1;
for (int i = 0; flag; i++) {
flag = 0;
for (int j = n - 1; j >= i + 1; j--) {
if (a[j].num < a[j - 1].num) {
swap(a[j], a... | a.cc: In function 'bool isStable(Card*, Card*, int)':
a.cc:40:17: error: no match for 'operator!=' (operand types are 'Card' and 'Card')
40 | if(a[i] != b[i])
| ~~~~ ^~ ~~~~
| | |
| Card Card
In file included from /usr/include/c++/14/iosfwd:42... |
s875228382 | p02261 | C++ | #include<iostream>
using namespace std;
struct Card { char suit, value;} ;
void bubble(struct Card A[], int N){
for(int i=0; i<N; i++){
for(int j=N-1; j>=i; j--){
if(A[j].value<A[j-1].value){
Card t = A[j]; A[j]=A[j-1]; A[j-1] = t;
}
}
}
}
void selection(struct Card A[], int N){
for (int i = 0... | a.cc: In function 'void selection(Card*, int)':
a.cc:17:31: error: expected primary-expression before ';' token
17 | for (int i = 0; i < N,; i++){
| ^
a.cc: In function 'void print(Card*, int)':
a.cc:27:25: error: expected ';' before '<' token
27 | for(int i = 0... |
s250540714 | p02261 | C++ | #include<iostream>
using namespace std;
void swapEx(char *a, char *b)
{
char temp[3];
strcpy(temp, b);
strcpy(b, a);
strcpy(a, temp);
}
void BubleSort(char C[][3], int N)
{
int flag = 1;
for (int i = 0; i < N, flag == 1; i++) {
flag = 0;
for (int j = N-1; j > i; j--) {
if (C[j - 1][1] > C[j][1]) {
sw... | a.cc: In function 'void swapEx(char*, char*)':
a.cc:7:9: error: 'strcpy' was not declared in this scope
7 | strcpy(temp, b);
| ^~~~~~
a.cc:2:1: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include<iostream>
+++ |+#include <... |
s715265901 | p02261 | C++ | #include<iostream>
#include<string>
using namespace std;
void swapEx(char *a, char *b)
{
char temp[3];
strcpy(temp, b);
strcpy(b, a);
strcpy(a, temp);
}
void BubleSort(char C[][3], int N)
{
int flag = 1;
for (int i = 0; i < N, flag == 1; i++) {
flag = 0;
for (int j = N-1; j > i; j--) {
if (C[j - 1][1] >... | a.cc: In function 'void swapEx(char*, char*)':
a.cc:8:9: error: 'strcpy' was not declared in this scope
8 | strcpy(temp, b);
| ^~~~~~
a.cc:2:1: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include<iostream>
+++ |+#include <... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.