submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s366191943 | p00011 | C | #include<stdio.h>
int main(){
int w, n, a, b, i, store, s[30];
for(i = 0; i < 30; i++) s[i] = i + 1;
scanf("%d", &w);
scanf("%d", &n);
for(i = 0; i < n; i++){
scanf("%d,%d" &a, &b);
store = s[a - 1];
s[a - 1] = s[b - 1];
s[b - 1] = store;
}
for(i = 0; i < w; i++) printf("%d\n", s[i]);
return 0;
} | main.c: In function 'main':
main.c:9:31: error: invalid operands to binary & (have 'char *' and 'int')
9 | scanf("%d,%d" &a, &b);
| ~~~~~~~ ^
| |
| char *
|
s631795526 | p00011 | C | #include<stdio.h>
#include<stdlib.h>
int main(){
int w,n,h,i;
scanf("%d\n",&w);
scanf("%d\n",&n);
int a[],b[];
int c[];
for(i=0;n>i;++1){
scanf("%d,%d\n",&a[i],&b[i]);
}
for(i=1;w>=i;++i){
i=c[i];
}
for(i=0;n>i;++i){
h=c[b[i]];
c[b[i]]=c[a[i]];
c[a[i]]=h;
}
for(i=0... | main.c: In function 'main':
main.c:11:7: error: array size missing in 'a'
11 | int a[],b[];
| ^
main.c:11:11: error: array size missing in 'b'
11 | int a[],b[];
| ^
main.c:12:7: error: array size missing in 'c'
12 | int c[];
| ^
main.c:14:15: error: lvalue required... |
s493433888 | p00011 | C | #include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main(){
int w,n;
cin>>w>>n;
vector<int>a(w);
for(int i=0;i<w;i++)a[i]=i+1;
for(int i=0;i<n;i++){
int b,c;
char d;
cin>>b>>d>>c;
swap(a[b-1],a[c-1]);
}
for(int i=0;i<w;i++)cout<<a[i]<<endl;
} | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s671066916 | p00011 | C | #include<stdio.h>
int main(){
int w,n,a[31];
scanf("%d",&w);
for(i=0;i<w;i++){
a[i]=i+1;
}
scanf("%d",&n);
for(i=0,i<n;i++){
scanf("%d,%d",&c1,&c2);
t=a[c1];
a[c1]=a[c2];
a[c2]=t;
}
for(i=0;i<w;i++){
printf("%d\n",a[i];);
}
return 0;
} | main.c: In function 'main':
main.c:7:13: error: 'i' undeclared (first use in this function)
7 | for(i=0;i<w;i++){
| ^
main.c:7:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:24: error: expected ';' before ')' token
11 | for(i... |
s716346963 | p00011 | C | #include<stdio.h>
int main(){
int w,n,a[31];
scanf("%d",&w);
for(i=0;i<w;i++){
a[i]=i+1;
}
scanf("%d",&n);
for(i=0,i<n;i++){
scanf("%d,%d",&c1,&c2);
t=a[c1];
a[c1]=a[c2];
a[c2]=t;
}
for(i=0;i<w;i++){
printf("%d\n",a[i]);
}
return 0;
} | main.c: In function 'main':
main.c:7:13: error: 'i' undeclared (first use in this function)
7 | for(i=0;i<w;i++){
| ^
main.c:7:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:24: error: expected ';' before ')' token
11 | for(i... |
s576729867 | p00011 | C | #include<stdio.h>
int main(){
int w,n,a[31];
int i,c1,c2,t;
scanf("%d",&w);
for(i=0;i<w;i++){
a[i]=i+1;
}
scanf("%d",&n);
for(i=0,i<n;i++){
scanf("%d,%d",&c1,&c2);
t=a[c1];
a[c1]=a[c2];
a[c2]=t;
}
for(i=0;i<w;i++){
printf("%d\n",a[i]);
}
return 0;
} | main.c: In function 'main':
main.c:11:24: error: expected ';' before ')' token
11 | for(i=0,i<n;i++){
| ^
| ;
|
s155951867 | p00011 | C++ | #include<iostream>
using namespace std;
int n;
int a[1000000];
int sum[1000000];
int main(int argc, char const *argv[])
{
int tc[30];
cin>>tc[30];
int w,v;
for (int i = 0; i < 30; ++i) tc[i] = i+1;
for (int i = 0; i < v; ++i)
{
int a,b;
cin>>a>>b;
int c=tc[a-1];
tc[a-1]=tc[b-1];
tc[b-1];
}
... | a.cc: In function 'int main(int, const char**)':
a.cc:22:35: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
22 | for (int i = 0; i < a; ++i)
| ~~^~~
a.cc:24:31: error: 't' was not declared in this scope
24 | ... |
s262369391 | p00011 | C++ | #include<iostream>
using namespace std;
int n;
int a[1000000];
int sum[1000000];
int main(int argc, char const *argv[])
{
int tc[30];
cin>>tc[30];
int w,v;
for (int i = 0; i < 30; ++i) tc[i] = i+1;
for (int i = 0; i < v; ++i)
{
int a,b;
cin>>a>>b;
int c=tc[a-1];
tc[a-1]=tc[b-1];
tc[b-1];
}
... | a.cc: In function 'int main(int, const char**)':
a.cc:22:35: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
22 | for (int i = 0; i < a; ++i)
| ~~^~~
a.cc:24:31: error: 't' was not declared in this scope
24 | ... |
s927590529 | p00011 | C++ | #include<iostream>
using namespace std;
int n;
int a[1000000];
int sum[1000000];
int main(int argc, char const *argv[])
{
int tc[30];
cin>>tc[30];
int w,v;
for (int i = 0; i < 30; ++i) tc[i] = i+1;
for (int i = 0; i < v; ++i)
{
int a,b;
cin>>a>>b;
int c=tc[a-1];
tc[a-1]=tc[b-1];
tc[b-1];
}
... | a.cc: In function 'int main(int, const char**)':
a.cc:22:37: error: 'strlen' was not declared in this scope
22 | for (int i = 0; i < strlen(a); ++i)
| ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#inclu... |
s650291812 | p00011 | C++ | import java.io.*;
import java.util.*;
public class Main{
public static void main(String[] args)throws IOException{
BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));
//Scanner reader=new Scanner(System.in);
String s=reader.readLine();
int in=Integer.parseInt(s);
//int in=reader.nextI... | a.cc:1:1: error: 'import' does not name a type
1 | import java.io.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import java.util.*;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: ... |
s117043496 | p00011 | C++ | import java.io.*;
import java.util.*;
public class Main{
public static void main(String[] args)throws IOException{
BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));
//Scanner reader=new Scanner(System.in);
String s=reader.readLine();
int in=Integer.parseInt(s);
//int in=reader.nextI... | a.cc:1:1: error: 'import' does not name a type
1 | import java.io.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import java.util.*;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: ... |
s558835632 | p00011 | C++ | #include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define it ::iterator
#define all(in) in.begin(),in.end... | a.cc: In function 'int main()':
a.cc:28:15: error: 'x' was not declared in this scope
28 | cin>>a>>d>x>b;
| ^
|
s792137211 | p00011 | C++ | #include<iostream>
using namespace std;
int main()
{
int x[30];
int w, n;
cin >> w >> n;
for(int i=0; i<w; i++) x[i] = i+1;
int a, b;
for(int i=0; i<n; i++){
cin >> a >> b;
int tmp = x[a];
x[a] = x[b];
x[b] = tmp;
}
for(int i=0; i<w; i++){
cout << x[i];
if(i == w-1) break;;
cout << '\n';
} | a.cc: In function 'int main()':
a.cc:24:2: error: expected '}' at end of input
24 | }
| ^
a.cc:5:1: note: to match this '{'
5 | {
| ^
|
s546131159 | p00011 | C++ | #include<iostream>
using namespace std;
int main()
{
int x[30];
int w, n;
cin >> w >> n;
for(int i=0; i<w; i++) x[i] = i+1;
int a, b;
for(int i=0; i<n; i++){
cin >> a >> b;
int tmp = x[a];
x[a] = x[b];
x[b] = tmp;
}
for(int i=0; i<w; i++){
cout << x[i];
if(i == w-1) break;
cout << '\n';
} | a.cc: In function 'int main()':
a.cc:24:2: error: expected '}' at end of input
24 | }
| ^
a.cc:5:1: note: to match this '{'
5 | {
| ^
|
s262842434 | p00011 | C++ | #include <iostream>
#include <iomanip>
#include <sstream>
#include <stdio.h>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <math.h>
#include <utility>
#include <string>
#include <ctype.h>
#include <cstring>
#include <cstdio>
#include <sstream>
using namespace std;
#define FOR(i,k,n)... | a.cc: In function 'int main()':
a.cc:22:15: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
22 | #define scanf scanf_s
| ^~~~~~~
a.cc:33:17: note: in expansion of macro 'scanf'
33 | scanf("%d,%d", &a, &b);
| ^~~~~
|
s910088318 | p00011 | C++ | #include <iostream>
#include <string>
#include <utility>
#include <algorithm>
#include <queue>
#include <map>
#include <fstream>
#include <array>
#include <utility>
#include <functional>
using namespace std;
typedef long long Int;
#define REP(i , x) for(int i = 0 ; i < x ; ++i)
typedef pair<int, int> P;
int dp[60];
... | a.cc: In function 'int main()':
a.cc:29:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
29 | scanf_s("%d,%d", &a,&b);
| ^~~~~~~
| scanf
|
s594163047 | p00011 | C++ | #include <iostream>
using namespace std;
int main(){
int verticals,horizontals,a,b;
char commma; //commaを抜くための変数
cin >> verticals;
cin >> horizontals;
int res[verticals];
for(int i=0;i<verticals;i++) res[i] = i+1;
for(int i=0;i<horizontals;i++){
cin >> a >> comma >> b;
int tmp = res[a-1];
... | a.cc: In function 'int main()':
a.cc:14:17: error: 'comma' was not declared in this scope; did you mean 'commma'?
14 | cin >> a >> comma >> b;
| ^~~~~
| commma
|
s299804095 | p00011 | C++ | #include <iostream>
#include <string>
#include <stdlib.h>
using namespace std;
void getValues(string& s, int& a, int & b)
{
string::size_type p = s.find(',');
string sa = s.substr(0, p);
string sb = s.substr(p + 1);
a = atoi(sa.c_str());
b = atoi(sb.c_str());
}
int main()
{
int w, n, a, b;
cin >> w >> n;
int W... | a.cc: In function 'int main()':
a.cc:19:13: error: 'i' was not declared in this scope
19 | FOR(i, 1, w + 1) W[i] = i;
| ^
a.cc:19:9: error: 'FOR' was not declared in this scope
19 | FOR(i, 1, w + 1) W[i] = i;
| ^~~
|
s012732102 | p00011 | C++ | #include <iostream>
#include <utility>
using namespace System;
using namespace std;
const int MAX_W = 30;
int main()
{
int w,n;
int num[MAX_W+1]={};
char c;
cin>>w>>n;
for(int i=0;i<w;i++){
num[i]=i+1;
}
int a,b;
for(int i=0;i<n;i++){
cin>>a>>c>>b;
swap(num[a-1],num[b-1]);
}
for(int i=0;i<w;i++){
c... | a.cc:3:17: error: 'System' is not a namespace-name
3 | using namespace System;
| ^~~~~~
|
s953167007 | p00011 | C++ | #include<iostream>
int main(){
int w,n,a[30][2],b[30];
std::cin>>w
>>n;
for(int i=0;i<n;++i){
std::cin>>a[i][0]>>','>>a[i][1];
}
for(int i=1;i<=w;++i){
b[i]=i;
}
for(int i=0;i<n;++i){
int x=b[a[i][0]];
b[a[i][0]]=b[a[i][1]];
b[a[i][1]]=x;
}
for(int i=1;i<=w;++i){
std::cout<<b[i]<<std::endl;
... | a.cc: In function 'int main()':
a.cc:7:42: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'char')
7 | std::cin>>a[i][0]>>','>>a[i][1];
| ~~~~~~~~~~~~~~~~~^~~~~
| ... |
s734344578 | p00011 | C++ | #include<stdio.h>
int main(){
int x[32][2]={};
int w,n;
scanf("%d",&w);
scanf("%d",%n);
for(int i=0;i<=w;i++)
x[i][0]=i;
for(int i=0;i<n;i++)
{
int a1,a2;
scanf("%d,%d",&a1,&a2);
int t=x[a1][0];x[a1][0]=x[a2][0];x[a2][0]=t;
}
for(int i=1;i<=w;i++)
printf("%d\n",x[i][0]);
return 0;
} | a.cc: In function 'int main()':
a.cc:9:12: error: expected primary-expression before '%' token
9 | scanf("%d",%n);
| ^
|
s888061010 | p00011 | C++ | #include<iostream>
using namespace std;
int main(){
int w = 0;
cin >> w ;
int n = 0;
cin >> n;
int i = 1;
int a[w];
loop(i = 0,i < w,i++){
a[i] = i + 1;
}
loop(i = 1,i <= n,i++){
int aa = 0;int bb = 0;
char split;
cin >> aa >> split >> bb ;
int c = 0;
c = a[aa - 1];
a[aa - 1] = a[bb - 1];
a[bb - 1] = c;
}
loop(i = 0,i... | a.cc: In function 'int main()':
a.cc:11:1: error: 'loop' was not declared in this scope
11 | loop(i = 0,i < w,i++){
| ^~~~
|
s405849340 | p00011 | C++ | #include<iostream>
using namespace std;
int main(){
int w = 0;
cin >> w ;
int n = 0;
cin >> n;
int i = 1;
int a[w];
for(i = 0,i < w,i++){
a[i] = i + 1;
}
for(i = 1,i <= n,i++){
int aa = 0;int bb = 0;
char split;
cin >> aa >> split >> bb ;
int c = 0;
c = a[aa - 1];
a[aa - 1] = a[bb - 1];
a[bb - 1] = c;
}
for(i = 0,i < ... | a.cc: In function 'int main()':
a.cc:11:20: error: expected ';' before ')' token
11 | for(i = 0,i < w,i++){
| ^
| ;
a.cc:14:1: error: expected primary-expression before 'for'
14 | for(i = 1,i <= n,i++){
| ^~~
a.cc:13:2: error: expected ';' before 'for'
13... |
s693436265 | p00011 | C++ |
#include <iostream>
#include <string>
#include <algorithm>
#include <math.h>
#include <stdio.h>
using namespace std;
const int MAX_HORIZONTAL = 30;
const int MAX_VERTICAL = 30;
int main(){
int VerticalLines;
int HorizontalLines;
int HorizonA[MAX_HORIZONTAL];
int HorizonB[MAX_HORIZONTAL];
int Results[MAX_VERT... | a.cc: In function 'int main()':
a.cc:26:65: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
26 | for (int i = 0; i < HorizontalLines; ++i){ char c[32]; scanf_s("%d,%d", &HorizonA[i], &HorizonB[i]); }
| ^~~~~~~
... |
s761980057 | p00011 | C++ |
w = input()
n = input()
k = []
for i in range(w+1):
k.append(i)
for i in range(n):
l = raw_input()
a = int(l[0])
b = int(l[2])
temp = k[a]
k[a] = k[b]
k[b] = temp
for i in range(w):
print k[i+1] | a.cc:2:1: error: 'w' does not name a type
2 | w = input()
| ^
|
s083226688 | p00011 | C++ | int main(){
int w, n;
int num[30] = { 0 };
int a, b;
cin >> w;
cin >> n;
for (int i = 0; i<w; i++)
num[i] = i + 1;
for (int i = 0; i<n; i++){
cin >> a >> b;
int tmp = num[a-1];
num[a-1] = num[b-1];
num[b-1] = tmp;
}
for (int i = 0; i<w; i++)
cout << num[i] << "\n";
return 0;
} | a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope
7 | cin >> w;
| ^~~
a.cc:26:17: error: 'cout' was not declared in this scope
26 | cout << num[i] << "\n";
| ^~~~
|
s105580968 | p00011 | C++ | #include <iostream>
using namespace std;
int main(){
int w, n;
int num[30] = { 0 };
int a, b;
char c
cin >> w;
cin >> n;
for (int i = 0; i<w; i++)
num[i] = i + 1;
for (int i = 0; i<n; i++){
cin >> a >> c >> b;
int tmp = num[a-1];
num[a-1] = num[b-1];
num[b-1] = tmp;
}
for (int i = 0; i<w... | a.cc: In function 'int main()':
a.cc:11:9: error: expected initializer before 'cin'
11 | cin >> w;
| ^~~
a.cc:19:29: error: 'c' was not declared in this scope
19 | cin >> a >> c >> b;
| ^
|
s191001600 | p00011 | C++ | #define _CRT_SECURE_NO_WARNINGS 1
#include <cstdio>
using namespace std;
int main()
{
int W, N, A[31], B[31], C[31];
cin >> W >> N;
for (int i = 1; i <= N; i++)
{
scanf("%d,%d", &(A[i]), &(B[i]));
}
for (int i = 1; i <= W; i++)
{
int t = i;
for (int j = 1; j <= N; j++)
{
if (A[j] == t)
{
... | a.cc: In function 'int main()':
a.cc:11:9: error: 'cin' was not declared in this scope
11 | cin >> W >> N;
| ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
3 | #include <cstdio>
+++ |+#include <iostream>
4 |
|
s059951718 | p00011 | C++ | include<iostream>
#include<cstdio>
using namespace std;
void change(int *, int *);
int main(void){
int w,n;
int p[31];
int a, b;
cin >> w;
cin >> n;
for(int i = 1; i <= w; i++){
p[i] = i;
}
for(int j = 0; j < n; j++){
scanf("%d,%d", &a, &b);
change(&p[a], &p[b]);
}
for(int i = 1; i <= w; i++){... | a.cc:1:1: error: 'include' does not name a type
1 | include<iostream>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:12:9: error: 'cin' was not declared in this scope
12 | cin >> w;
| ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding ... |
s237805126 | p00011 | C++ | #include <iostream>
#include <string>
#include <stack>
#include <math.h>
#include <algorithm>
#include <cstdlib>
#include <ctime>
#include <vector>
using namespace std;
int main()
{
int n, w;
int a[30], b[30],c[30];
cin >> w;
cin >> n;
for (int i = 0; i < n; i++) {
scanf_s("%d,%d", &a[i], &b[i]);
}
f... | a.cc: In function 'int main()':
a.cc:24:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
24 | scanf_s("%d,%d", &a[i], &b[i]);
| ^~~~~~~
| scanf
|
s985436049 | p00011 | C++ | ude <iostream>
const int W_MAX = 30;
const int N_MAX = 30;
int w;
int n;
int a[N_MAX + 1];
int b[N_MAX + 1];
int out[W_MAX + 1];
void chenge(int *farst, int *second){
int tmp;
tmp = *farst;
*farst = *second;
*second = tmp;
}
int main(void){
std::ios_sync_with(false);
std::cin.tie(0);
std::cin >> w;
std::ci... | a.cc:39:22: warning: multi-character character constant [-Wmultichar]
39 | std::cout << '/n';
| ^~~~
a.cc:1:1: error: 'ude' does not name a type
1 | ude <iostream>
| ^~~
a.cc:10:9: error: 'W_MAX' was not declared in this scope; did you mean 'N_MAX'?
10 | int out[W_MAX ... |
s778190296 | p00011 | C++ | #include <iostream>
const int W_MAX = 30;
const int N_MAX = 30;
int w;
int n;
int a[N_MAX + 1];
int b[N_MAX + 1];
int out[W_MAX + 1];
void chenge(int *farst, int *second){
int tmp;
tmp = *farst;
*farst = *second;
*second = tmp;
}
int main(void){
std::ios_sync_with(false);
std::cin.tie(0);
std::cin >> w;
st... | a.cc:39:22: warning: multi-character character constant [-Wmultichar]
39 | std::cout << '/n';
| ^~~~
a.cc: In function 'int main()':
a.cc:20:14: error: 'ios_sync_with' is not a member of 'std'
20 | std::ios_sync_with(false);
| ^~~~~~~~~~~~~
|
s896704810 | p00011 | C++ | #include <iostream>
const int W_MAX = 30;
const int N_MAX = 30;
int w;
int n;
int a[N_MAX + 1];
int b[N_MAX + 1];
int out[W_MAX + 1];
void chenge(int *farst, int *second){
int tmp;
tmp = *farst;
*farst = *second;
*second = tmp;
}
int main(void){
ios::sync_with_stdio(false);
std::cin.tie(0);
std::cin >> w;
... | a.cc:39:22: warning: multi-character character constant [-Wmultichar]
39 | std::cout << '/n';
| ^~~~
a.cc: In function 'int main()':
a.cc:20:9: error: 'ios' has not been declared
20 | ios::sync_with_stdio(false);
| ^~~
|
s832443227 | p00011 | C++ | w=gets.to_i
n=gets.to_i
a=[*0..w]
n.times{b,c=gets.chomp.split(',').map(&:to_i);a[b],a[c]=a[c],a[b]}
puts a[1..w] | a.cc:3:5: error: too many decimal points in number
3 | a=[*0..w]
| ^~~~
a.cc:5:8: error: too many decimal points in number
5 | puts a[1..w]
| ^~~~
a.cc:1:1: error: 'w' does not name a type
1 | w=gets.to_i
| ^
a.cc:5:1: error: 'puts' does not name a type
5 | puts a[1..w]
... |
s158933250 | p00011 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <cassert>
#include <iomanip>
#include <cmath>
int main(void)
{
int w, n;
std::cin >> w >> n;
std::vector<int> base;
for (int i = 0; i < w; i++) {
base.push_back(i + 1);
}
for (int i = 0; i < n; i++) {
int a... | a.cc: In function 'int main()':
a.cc:22:5: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
22 | scanf_s("%d,%d", &a, &b);
| ^~~~~~~
| scanf
|
s951933184 | p00011 | C++ | w=eval s='gets.to_i';n=eval s;a=[*0..w];n.times{b,c=gets.chop.split(?,).map &:to_i;a[b],a[c]=a[c],a[b]};puts a[1..w] | a.cc:1:10: warning: multi-character literal with 9 characters exceeds 'int' size of 4 bytes
1 | w=eval s='gets.to_i';n=eval s;a=[*0..w];n.times{b,c=gets.chop.split(?,).map &:to_i;a[b],a[c]=a[c],a[b]};puts a[1..w]
| ^~~~~~~~~~~
a.cc:1:35: error: too many decimal points in number
1 | w=eval s='gets... |
s902350685 | p00011 | C++ | #include<iostream>
#include<iomanip>
#include<algorithm>
#include<cctype>
#include<cmath>
#include<string>
#include<set>
#include<map>
#include<queue>
#include<vector>
using namespace std;
int main() {
int w,n;
cin>>w>>n;
int c[31];
for(int i=1;i<=w;i++)c[i]=i;
for(int i=1;i<=n;i++){
int a,b;
scanf_s("%d,%d",... | a.cc: In function 'int main()':
a.cc:20:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
20 | scanf_s("%d,%d",&a,&b);
| ^~~~~~~
| scanf
|
s209643365 | p00011 | C++ | #include<iostream>
#include<iomanip>
#include<algorithm>
#include<cctype>
#include<cmath>
#include<cstdio>
#include<string>
#include<set>
#include<map>
#include<queue>
#include<vector>
using namespace std;
int main() {
int w,n;
cin>>w>>n;
int c[31];
for(int i=1;i<=w;i++)c[i]=i;
for(int i=1;i<=n;i++){
int a,b;
... | a.cc: In function 'int main()':
a.cc:21:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
21 | scanf_s("%d,%d",&a,&b);
| ^~~~~~~
| scanf
|
s298727378 | p00011 | C++ | #include <iostream>
#include <vector>
#include <sstream>
using namespace std;
int main() {
int w;
while (cin >> w) {
vector<int> vec;
vec.resize(w);
// default
for (int i = 0; i < vec.size(); ++i) {
vec[i] = i + 1;
}
int n;
cin >> n;
cin.ignore(INT_MAX, '\n');
for (int i = ... | a.cc: In function 'int main()':
a.cc:16:16: error: 'INT_MAX' was not declared in this scope
16 | cin.ignore(INT_MAX, '\n');
| ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
3 | #include <sstream>
+++ |+#includ... |
s193917574 | p00011 | C++ | #include <iostream>
#include <vector>
#include <sstream>
using namespace std;
int main() {
int w;
while (cin >> w) {
vector<int> vec;
vec.resize(w);
// default
for (int i = 0; i < vec.size(); ++i) {
vec[i] = i + 1;
}
int n;
cin >> n;
cin.ignore(INT_MAX, '\n');
for (int i = ... | a.cc: In function 'int main()':
a.cc:16:16: error: 'INT_MAX' was not declared in this scope
16 | cin.ignore(INT_MAX, '\n');
| ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
3 | #include <sstream>
+++ |+#includ... |
s130945930 | p00011 | C++ | #include <iostream>
#include <vector>
#include <sstream>
using namespace std;
int main() {
int w;
while (cin >> w) {
vector<int> vec;
vec.resize(w);
// default
for (int i = 0; i < vec.size(); ++i) {
vec[i] = i + 1;
}
int n;
cin >> n;
cin.ignore(INT_MAX, '\n');
for (int i = ... | a.cc: In function 'int main()':
a.cc:16:16: error: 'INT_MAX' was not declared in this scope
16 | cin.ignore(INT_MAX, '\n');
| ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
3 | #include <sstream>
+++ |+#includ... |
s135770402 | p00011 | C++ | #include <iostream>
#include <vector>
#include <sstream>
using namespace std;
int main() {
int w;
while (cin >> w) {
vector<int> vec;
vec.resize(w);
for (int i = 0; i < vec.size(); ++i) {
vec[i] = i + 1;
}
int n;
cin >> n;
cin.ignore(INT_MAX, '\n');
for (int i = 0; i < n; ++i) ... | a.cc: In function 'int main()':
a.cc:15:16: error: 'INT_MAX' was not declared in this scope
15 | cin.ignore(INT_MAX, '\n');
| ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
3 | #include <sstream>
+++ |+#includ... |
s461683257 | p00011 | C++ | #include <iostream>
#include <vector>
#include <sstream>
using namespace std;
int main() {
int w;
while (cin >> w) {
vector<int> vec;
vec.resize(w);
// default
for (int i = 0; i < vec.size(); ++i) {
vec[i] = i + 1;
}
int n;
cin >> n;
cin.ignore(INT_MAX, '\n');
for (int i = ... | a.cc: In function 'int main()':
a.cc:16:16: error: 'INT_MAX' was not declared in this scope
16 | cin.ignore(INT_MAX, '\n');
| ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
3 | #include <sstream>
+++ |+#includ... |
s228983235 | p00011 | C++ | #include<iostream>
#include<stdio.h>
#define N 30
using namespace std;
int main(){
????int w,n,tmp;
????int lod[N]; int lis[N][3];
????while(cin >> n >> w){
????for(int i = 0;i<n;i++){
????????lod[i] = i+1;
????}
??
????for(int i=0;i<w;i++){
????????scanf("%d,%d",&lis[i][0],&lis[i][2]);
????}
????for(int i=0;i<w;i++){
... | a.cc: In function 'int main()':
a.cc:6:1: error: expected primary-expression before '?' token
6 | ????int w,n,tmp;
| ^
a.cc:6:2: error: expected primary-expression before '?' token
6 | ????int w,n,tmp;
| ^
a.cc:6:3: error: expected primary-expression before '?' token
6 | ????int w,n,tmp;
... |
s266652493 | p00011 | C++ | #include<iostream>
#include<stdio.h>
#define N 30
using namespace std;
int main(){
????int w,n,tmp;
????int lod[N]; int lis[N][3];
????while(cin >> n >> w){
????for(int i = 0;i<n;i++){
????lod[i] = i+1;
????}
????for(int i=0;i<w;i++){
????scanf("%d,%d",&lis[i][0],&lis[i][2]);
????}
????for(int i=0;i<w;i++){
????tmp = l... | a.cc: In function 'int main()':
a.cc:6:1: error: expected primary-expression before '?' token
6 | ????int w,n,tmp;
| ^
a.cc:6:2: error: expected primary-expression before '?' token
6 | ????int w,n,tmp;
| ^
a.cc:6:3: error: expected primary-expression before '?' token
6 | ????int w,n,tmp;
... |
s269390896 | p00011 | C++ | #include<iostream>
#include<stdio.h>
#define N 30
using namespace std;
int main(){
????int w,n,tmp;
????int lod[N]; int lis[N][3];
????while(cin >> n >> w){
????for(int i = 0;i<n;i++){
????lod[i] = i+1;
????}
????for(int i=0;i<w;i++){
????scanf("%d,%d",&lis[i][0],&lis[i][2]);
????}
????for(int i=0;i<w;i++){
????tmp = l... | a.cc: In function 'int main()':
a.cc:6:1: error: expected primary-expression before '?' token
6 | ????int w,n,tmp;
| ^
a.cc:6:2: error: expected primary-expression before '?' token
6 | ????int w,n,tmp;
| ^
a.cc:6:3: error: expected primary-expression before '?' token
6 | ????int w,n,tmp;
... |
s350793845 | p00011 | C++ | #include<iostream>
#include<string>
#include<vector>
using namespace std;
int main() {
int w, n, i, x, y, z;
char str[10], *a, *b;
cin >> w >> n;
vector<int> A(w);
for (i = 0; i < w; i++) A[i] = i + 1;
for (i = 0; i < n; i++) {
cin >> str;
a = strtok(str, ",");
x = atoi(a);
b = strtok(NULL, ",");
y =... | a.cc: In function 'int main()':
a.cc:14:21: error: 'strtok' was not declared in this scope; did you mean 'strtoq'?
14 | a = strtok(str, ",");
| ^~~~~~
| strtoq
|
s586569234 | p00011 | C++ | #include<iostream>
#include<string>
#include<vector>
using namespace std;
int main() {
int w, n, i, x, y, z;
char str[10], *a, *b;
cin >> w >> n;
vector<int> A(w);
for (i = 0; i < w; i++) A[i] = i + 1;
for (i = 0; i < n; i++) {
cin >> str;
a = strtok_s(str, ",");
x = atoi(a);
b = strtok_s(NULL, ",");
... | a.cc: In function 'int main()':
a.cc:14:21: error: 'strtok_s' was not declared in this scope; did you mean 'strtol_l'?
14 | a = strtok_s(str, ",");
| ^~~~~~~~
| strtol_l
|
s006555884 | p00011 | C++ | #include <iostream>
using namespace std;
int main(){
int w, n;
cin >> w >> n;
int s[w];
for(int i=0; i<w; i++){
s[i] = i+1;
while(n--){
int a, b, c;
cin >> a >> b;
int tmp = s[a-1];
s[a-1] = s[b-1];
s[b-1] = tmp;
}
for(int i=0; i<w; i++){
cout << s[i];
}
cout << endl;
} | a.cc: In function 'int main()':
a.cc:25:2: error: expected '}' at end of input
25 | }
| ^
a.cc:5:11: note: to match this '{'
5 | int main(){
| ^
|
s244437250 | p00011 | C++ | a = (1..gets.to_i).to_a
gets.to_i.times{
x,y = gets.split(",").map(&:to_i)
a[x-1], a[y-1] = a[y-1], a[x-1]
}
puts a | a.cc:1:6: error: too many decimal points in number
1 | a = (1..gets.to_i).to_a
| ^~~~~~~~~~~~
a.cc:1:1: error: 'a' does not name a type
1 | a = (1..gets.to_i).to_a
| ^
a.cc:6:1: error: 'puts' does not name a type
6 | puts a
| ^~~~
|
s273018888 | p00011 | C++ | #include<iostream>
#include<stdio.h>
using namespace std;
int main(void) {
//0011
int Line[31], w=0, n=0, a, b, tmp;
cin >> w;
cin >> n;
for (int i=0; i < 30; i++) {
Line[i] = i;
}
for (int j = 0; j < n; j++) {
scanf_s("%d,%d", &a, &b);
tmp = Line[a];
Line[a] = Line[b];
Line[b] = tmp;
}
for (int ... | a.cc: In function 'int main()':
a.cc:17:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
17 | scanf_s("%d,%d", &a, &b);
| ^~~~~~~
| scanf
|
s250247383 | p00011 | C++ | #include<iostream>
#include<stdio.h>
#include<stdlib.h>
using namespace std;
int main(void) {
//0011
int Line[31], w=0, n=0, a, b, tmp;
cin >> w;
cin >> n;
for (int i=0; i < 30; i++) {
Line[i] = i;
}
for (int j = 0; j < n; j++) {
scanf_s("%d,%d", &a, &b);
tmp = Line[a];
Line[a] = Line[b];
Line[b] =... | a.cc: In function 'int main()':
a.cc:18:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
18 | scanf_s("%d,%d", &a, &b);
| ^~~~~~~
| scanf
|
s922942605 | p00011 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int w,n; cin >> w >> n;
int a[31];
rep(i,0,w) a[i] = i+1;
rep(i,0,n) {
int x,y;
scanf("%d,%d",x,y);
swap(a[x-1],a[y-1]);
}
rep(i,0,n) cout << a[i] << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:5: error: 'i' was not declared in this scope
7 | rep(i,0,w) a[i] = i+1;
| ^
a.cc:7:1: error: 'rep' was not declared in this scope
7 | rep(i,0,w) a[i] = i+1;
| ^~~
|
s232538143 | p00011 | C++ | #include <bits/stdc++.h>
#define rep(i,a,n) for(inti =a; i<n; i++)
using namespace std;
int main() {
int w,n; cin >> w >> n;
int a[31];
rep(i,0,w) a[i] = i+1;
rep(i,0,n) {
int x,y;
scanf("%d,%d",&x,&y);
swap(a[x-1],a[y-1]);
}
rep(i,0,n) cout << a[i] << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:2:24: error: 'inti' was not declared in this scope; did you mean 'int'?
2 | #define rep(i,a,n) for(inti =a; i<n; i++)
| ^~~~
a.cc:8:1: note: in expansion of macro 'rep'
8 | rep(i,0,w) a[i] = i+1;
| ^~~
a.cc:8:5: error: 'i' was not declared ... |
s205393339 | p00011 | C++ | //#define scanf_s scanf
#include <stdio.h>
#include <string>
#include <iostream>
#include <math.h>
using namespace std;
#define MAX 30
int main(void)
{
int w, n, a, b, x;
int list[MAX] = { 0 };
scanf_s("%d", &w);
scanf_s("%d", &n);
for (int i = 0; i < w;++i) {
list[i] = i + 1;
}
for (int i = 0; i < n; ++i) {
... | a.cc: In function 'int main()':
a.cc:12:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
12 | scanf_s("%d", &w);
| ^~~~~~~
| scanf
|
s724644765 | p00011 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int main(){
int x[30],w;
cin >> w;
for(int i = 1; i <= w; i++){
x[i] = i;
}
int n, a, b;
cin >> n;
for(int i = 0; i < n; i++){
cin >> a >> "," >> b;
swap(x[a],x[b]);
}
for(int i = 1; i <= w; i++){
cout << x[i] << endl;
}
} | a.cc: In function 'int main()':
a.cc:15:26: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'const char [2]')
15 | cin >> a >> "," >> b;
| ~~~~~~~~ ^~ ~~~
| | |
... |
s576732509 | p00011 | C++ |
#include <iostream>
#include<STRING>
using namespace std;
int main() {
int line;
int side;
int sidenum1,sidenum2;
int linenum[line];
char waste;
cin>>line>>side;
for(int i=0; i<line; i++){
linenum[i]=i+1;
}
for(int i=0; i<side; i++){
cin>>sidenum1>>waste>>sidenum2;
... | a.cc:3:9: fatal error: STRING: No such file or directory
3 | #include<STRING>
| ^~~~~~~~
compilation terminated.
|
s990356756 | p00011 | 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>
using namespace std;
int v[35];
int main()
{
int w,n;
cin>>w>>n;
for(int i=1;i<=w... | a.cc: In function 'int main()':
a.cc:27:6: error: expected initializer before 'cin'
27 | cin>>l>>temp>>r;
| ^~~
|
s187719415 | p00011 | C++ | using namespace std;
pair<int, int> p;
int a[31];
int main()
{
int w, n, r;
cin >> w >> n;
for (int i = 1; i < w + 1; i++)
a[i] = i;
for (int i = 0; i < n; i++)
{
scanf("%d,%d", p.first, p.second);
r = a[p.first];
a[p.first] = a[p.second];
a[p.second] = r;
}
for (int i = 1; i < w + 1; i++)
{
cout ... | a.cc:3:1: error: 'pair' does not name a type
3 | pair<int, int> p;
| ^~~~
a.cc: In function 'int main()':
a.cc:9:9: error: 'cin' was not declared in this scope
9 | cin >> w >> n;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#... |
s533535916 | p00011 | C++ | #include <iomanip>
#include <utility>
#include <vector>
#include <math.h>
#include <algorithm>
#include <string>
#include <iostream>
using namespace std;
pair<int, int> p;
int a[31];
int main()
{
int w, n, r;
cin >> w >> n;
for (int i = 1; i < w + 1; i++)
a[i] = i;
for (int i = 0; i < n; i++)
{
scanf_s("%d,%... | a.cc: In function 'int main()':
a.cc:21:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
21 | scanf_s("%d,%d", &p.first, &p.second);
| ^~~~~~~
| scanf
|
s411882936 | p00011 | C++ | #include <iomanip>
#include <utility>
#include <vector>
#include <math.h>
#include <algorithm>
#include <string>
#include <iostream>
using namespace std;
pair<int, int> p;
int a[31];
int main()
{
int w, n, r;
cin >> w >> n;
for (int i = 1; i < w + 1; i++)
a[i] = i;
for (int i = 0; i < n; i++)
{
scanf_s("%d,%... | a.cc: In function 'int main()':
a.cc:21:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
21 | scanf_s("%d,%d", &p.first, &p.second);
| ^~~~~~~
| scanf
|
s351757467 | p00011 | C++ | #include <iomanip>
#include <utility>
#include <vector>
#include <math.h>
#include <algorithm>
#include <string>
#include <iostream>
using namespace std;
pair<int, int> p;
int a[31];
int main()
{
int w, n, r;
cin >> w >> n;
for (int i = 1; i < w + 1; i++)
a[i] = i;
for (int i = 0; i < n; i++)
{
scanf_s("%d,%... | a.cc: In function 'int main()':
a.cc:21:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
21 | scanf_s("%d,%d", &p.first, &p.second);
| ^~~~~~~
| scanf
|
s797230018 | p00011 | C++ | #include<iostream>
void swap(int a,int b){
int t=a;
a=b;
b=t;
return ;
}
int main(){
int w;
int n;
int c[30];
int a[30];
int b[30];
scanf("%d",&w);
scanf("%d",&n);
for(int i=0;i<w;i++){
c[i]=i;
}
for(int i=0;i<n;i++){
scanf("%d%d",&a[i],&b[i]);
swap(c[a[i]],c[b[i]]);
}
for(int i=... | a.cc: In function 'int main()':
a.cc:24:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
24 | cout<<c[i]<<endl;
| ^~~~
| std::cout
In file included from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream c... |
s870320781 | p00011 | C++ | include <bits/stdc++.h>
using namespace std;
int main() {
int w,n;
scanf("%d %d",&w,&n);
int a[n];
int b[n];
for(int i=0;i<n;i++){
scanf("%d,%d",&a[i],&b[i]);
}
int ans[w+1];
for(int i=1;i<=w;i++)ans[i]=i;
int temp;
for(int i=0;i<n;i++){
temp=ans[a[i]];
ans[a[i]]=ans[b[i]];
ans[b[i]]=temp;
}
for(in... | a.cc:1:1: error: 'include' does not name a type
1 | include <bits/stdc++.h>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:9: error: 'scanf' was not declared in this scope
6 | scanf("%d %d",&w,&n);
| ^~~~~
a.cc:21:17: error: 'cout' was not declared in this scope
21 | ... |
s109127783 | p00011 | C++ | /*
C++ ???????????????????????????????????¬??????
??????AOJ-ITP1??????????????????
*/
#define _USE_MATH_DEFINES
#include <iostream> // ?¨??????\??????
#include <fstream> // ??????????????\??????
#include <string> // ???????????¢???
#include <vector> // ???????????????
#include <cmath> // ??°??????
#include <io... | a.cc:61:52: warning: trigraph ??- ignored, use -trigraphs to enable [-Wtrigraphs]
61 | cout << "----i = " << i << "?????¨???----" << endl;
a.cc: In function 'int main()':
a.cc:44:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
44 | scanf_s("%d,%d", &begin... |
s757829167 | p00011 | C++ | /*
C++ ???????????????????????????????????¬??????
??????AOJ-ITP1??????????????????
*/
#define _USE_MATH_DEFINES
#include <iostream> // ?¨??????\??????
#include <fstream> // ??????????????\??????
#include <string> // ???????????¢???
#include <vector> // ???????????????
#include <cmath> // ??°??????
#include <io... | a.cc:61:52: warning: trigraph ??- ignored, use -trigraphs to enable [-Wtrigraphs]
61 | cout << "----i = " << i << "?????¨???----" << endl;
a.cc: In function 'int main()':
a.cc:44:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
44 | scanf_s("%d,%d", &begin... |
s859005672 | p00011 | C++ | #include <iostream>
#include <cstring>
#include <vector>
#include <algorithm>
#include <fstream>
#include <sstream>
#include <string>
#include <iomanip>
#include <math.h>
#include <limits>
#include <chrono>
using namespace std;
class amida
{
int w;
vector<int> va;
public:
amida(int _w) : w(_w){
for(int i = 0; i ... | a.cc: In function 'int main()':
a.cc:54:27: error: 'strtok_s' was not declared in this scope; did you mean 'strtok_r'?
54 | a1 = atoi(strtok_s((char*)chtemp, ",", &ct));
| ^~~~~~~~
| strtok_r
|
s861200724 | p00011 | C++ | #include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
int main(){
int a[100]={},w,n,a,b,i;
cin >> w;
for(i=1;i<=w;i++){
a[i] = i;
}
cin >> n;
for(i=1;i<=n;i++){
scanf("%d,%d",&a,&b);
swap(a[a],a[b]);
}
for(int i=1;i<=w;i++){
cout... | a.cc: In function 'int main()':
a.cc:7:23: error: conflicting declaration 'int a'
7 | int a[100]={},w,n,a,b,i;
| ^
a.cc:7:9: note: previous declaration as 'int a [100]'
7 | int a[100]={},w,n,a,b,i;
| ^
a.cc:15:15: error: invalid types 'int [100][int [100]]' for ... |
s910194716 | p00011 | C++ | #include<stdio.h>
using namespace std;
const int MAX = 100;
int main() {
int W, N;
int t[MAX];
cin >> W >> N;
for (int i = 0; i < W; i++) {
t[i] = i;
}
for (int i = 0; i < N; i++) {
int a, b;
scanf("%d,%d", &a, &b); a--; b--;
swap(t[a], t[b]);
}
for (int i = 0; i < W; i++) {
printf("%d\n", t[i] + 1);... | a.cc: In function 'int main()':
a.cc:8:9: error: 'cin' was not declared in this scope
8 | cin >> W >> N;
| ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
1 | #include<stdio.h>
+++ |+#include <iostream>
2 | us... |
s994464540 | p00011 | C++ | #include <cmath>
#include <cstdio>
using namespace std;
void lots(int len,int a,int b,int array[]){
int buffer[5];
for(int i = 0;i < len; i++){
if(i == a-1){
buffer[i] = array[b-1];
}
else if(i == b-1){
buffer[i] = array[a-1];
}
else{
... | a.cc: In function 'int main()':
a.cc:26:5: error: 'cin' was not declared in this scope
26 | cin >> len;
| ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
2 | #include <cstdio>
+++ |+#include <iostream>
3 |
a.cc:37:9: ... |
s173946329 | p00011 | C++ | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <utility>
using namespace std;
int main() {
int w, n;
int change[30][2];
int line[30];
cin >> w >> n;
for (int i = 0; i < n; ++i) {
scanf_s("%d,%d", &change[i][0], &change[i][1]);
}
for (int i = 0; i < w; ++i) {
line[i] = i + 1;
}
for ... | a.cc: In function 'int main()':
a.cc:14:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
14 | scanf_s("%d,%d", &change[i][0], &change[i][1]);
| ^~~~~~~
| scanf
|
s340610651 | p00011 | C++ | #include<stdio.h>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#inc... | a.cc: In function 'int main()':
a.cc:42:27: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long uns... |
s882186591 | p00011 | C++ | // 0011.cpp : コンソール アプリケーションのエントリ ポイントを定義します。
//
#include "stdafx.h"
#include<stdio.h>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <iterator>
#inclu... | a.cc:4:10: fatal error: stdafx.h: No such file or directory
4 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s360869760 | p00011 | C++ | // 0011.cpp : コンソール アプリケーションのエントリ ポイントを定義します。
//
#include<stdio.h>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <iterator>
#include <list>
#include <... | a.cc: In function 'int main()':
a.cc:46:27: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long uns... |
s104958260 | p00011 | C++ | // 0011.cpp : コンソール アプリケーションのエントリ ポイントを定義します。
//
#include<stdio.h>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <iterator>
#include <list>
#include <m... | a.cc: In function 'int main()':
a.cc:44:27: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long uns... |
s433338428 | p00011 | C++ | // 0011.cpp : コンソール アプリケーションのエントリ ポイントを定義します。
//#include<stdio.h>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <... | a.cc: In function 'int main()':
a.cc:42:39: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long uns... |
s782315795 | p00011 | C++ | // 0011.cpp : コンソール アプリケーションのエントリ ポイントを定義します。
//
#include "stdafx.h"
#include<stdio.h>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <iterator>
#inclu... | a.cc:4:10: fatal error: stdafx.h: No such file or directory
4 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s436513103 | p00011 | C++ | // 0011.cpp : コンソール アプリケーションのエントリ ポイントを定義します。
//
#include "stdafx.h"
#include<stdio.h>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <iterator>
#inclu... | a.cc:4:10: fatal error: stdafx.h: No such file or directory
4 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s663528780 | p00011 | C++ | include<iostream>
using namespace std;
int main(){
int w,n,tmp;
cin>>w>>n;
int a[w];
string s;
for(int i=0;i<w;i++) a[i]=i+1;
for(int i=0;i<n;i++){
cin>>s;
int x=s[0]-(int)'1',y=s[2]-(int)'1';
tmp=a[x];
a[x]=a[y];
a[y]=tmp;
}
for(int i=0;i<w;i++) c... | a.cc:1:1: error: 'include' does not name a type
1 | include<iostream>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:5:5: error: 'cin' was not declared in this scope
5 | cin>>w>>n;
| ^~~
a.cc:7:5: error: 'string' was not declared in this scope
7 | string s;
| ^~~~~~
a.cc:10... |
s705482067 | p00011 | C++ | #include<iostream>
#include<vector>
#include<utility>
#include<cstdio>
int main(void){
int w,n;
std::cin>>w;
std::vector<int> state(w+1);
for(int i=1;i<=w;i++) state[i]=i;
std::cin>>n;
int a,b;
for(int i=0;i<n;i++){
scanf("%d,%d",&a,&b);
std::swap(state[a[i]],state[b[i]]);
... | a.cc: In function 'int main()':
a.cc:15:26: error: invalid types 'int[int]' for array subscript
15 | std::swap(state[a[i]],state[b[i]]);
| ^
a.cc:15:38: error: invalid types 'int[int]' for array subscript
15 | std::swap(state[a[i]],state[b[i]]);
| ... |
s938353930 | p00011 | C++ | #include<iostream>
#include<vector>
#include<utility>
#include<cstdio>
int main(void){
int w,n;
std::cin>>w;
std::vector<int> state(w+1);
for(int i=1;i<=w;i++) state[i]=i;
std::cin>>n;
int a,b;
for(int i=0;i<n;i++){
scanf("%d,%d",&a,&b);
std::swap(state[a],state[b]);
}
... | a.cc: In function 'int main()':
a.cc:17:39: error: invalid types 'int[int]' for array subscript
17 | for(int i=1;i<=w;i++) std::cout<<w[i]<<std::endl;
| ^
|
s103559840 | p00011 | C++ | #include <iostream>
#include <string>
#include <sstring>
using namespace std;
int main(){
int w, n;
int d[31];
while(cin >> w >> n){
for(int i=1;i<=w;i++) d[i] = i;
for(int i=0;i<n;i++){
string s; cin >> s;
istringstream iss >> s;
for(int j=0;j<s.size();... | a.cc:3:10: fatal error: sstring: No such file or directory
3 | #include <sstring>
| ^~~~~~~~~
compilation terminated.
|
s589962919 | p00011 | C++ | #include <iostream>
#include <string>
#include <sstream>
using namespace std;
int main(){
int w, n;
int d[31];
while(cin >> w >> n){
for(int i=1;i<=w;i++) d[i] = i;
for(int i=0;i<n;i++){
string s; cin >> s;
istringstream iss >> s;
for(int j=0;j<s.size();... | a.cc: In function 'int main()':
a.cc:14:31: error: expected initializer before '>>' token
14 | istringstream iss >> s;
| ^~
a.cc:17:23: error: 'iss' was not declared in this scope
17 | int a, b; iss >> a >> b;
| ^~~
|
s305231453 | p00011 | C++ | #include <stdio.h>
using namespace std;
int main(){
int w, n;
int d[31];
char s[30];
while(~scanf("%d %d", &w, &n)){
for(int i=1;i<=w;i++) d[i] = i;
for(int i=0;i<n;i++){
scanf("%s", s);
int a, b;
sscanf(s, "%d,%d", &a, &b);
swap(d[a], d[... | a.cc: In function 'int main()':
a.cc:15:13: error: 'swap' was not declared in this scope
15 | swap(d[a], d[b]);
| ^~~~
a.cc:17:31: error: 'cout' was not declared in this scope
17 | for(int i=1;i<=w;i++) cout << d[i] << endl;
| ^~~~
a.cc:2:1... |
s109532951 | p00011 | C++ | /*
Let's play Amidakuji.
In the following example, there are five vertical lines and four horizontal lines. The horizontal lines can intersect (jump across) the vertical lines.
[picture]
In the starting points (top of the figure), numbers are assigned to vertical lines in ascending order from left to right.... | a.cc: In function 'int main()':
a.cc:28:42: error: expected ';' before 'swap'
28 | scanf("%d, %d\n", &a, &b)
| ^
| ;
29 | swap(ans[a-1], ans[b-1]);
| ~~~~ ... |
s762059591 | p00011 | C++ | #include <cstdio>
#include <algorithm>
int main(){
int array[50];
int w,n,a,b;
for(int i=0 ; i<50 ; i++){
array[i] = i;
}
scanf("%d", &w);
scanf("%d", &n);
for(int i=0 ; i<n ; i++){
scanf("%d,%d", &a, &b);
swap( array[a] , array[b] );
}
for(int i=1 ; i<=w ; i++){
printf("%d\n", ar... | a.cc: In function 'int main()':
a.cc:16:17: error: 'swap' was not declared in this scope
16 | swap( array[a] , array[b] );
| ^~~~
a.cc:16:17: note: suggested alternatives:
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14... |
s503053248 | p00011 | C++ | #include <stdio.h>
void swap(int *a, int *b){
int c=*a;
*a=*b;
*b=c;
return;
}
int main(void)
{
int w,n;
scanf("%d",&w);
int list[w];
scanf("%d",&n);
for(int i=0;i<n;i++){
int a,b;
scanf("%d,%d",&a,&b);
swap(list[a],list[b]);
}
for(int i=0;i<w;i++){
printf("%d\n",list[i]);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:19:12: error: invalid conversion from 'int' to 'int*' [-fpermissive]
19 | swap(list[a],list[b]);
| ~~~~~~^
| |
| int
a.cc:3:16: note: initializing argument 1 of 'void swap(int*, int*)'
3 | void swap(int *a, int *b){
| ... |
s022614154 | p00011 | C++ | #include<stdio.h>
int main(void){
int w,n,x,y,temp;
int a[31];
char str[7];
for(int i = 0; i < 31; i++){
a[i] = i;
}
scanf("%d %d",&w,&n);
for(int i = 0; i < n; i++){
getline(str);
if(str[3] == ',')
str[3] = ' ';
else
str[2] = ' ';
sscanf(str,"%d %d",&x,&y);
temp = a[x];
a[x] = a[y];
a[y] =... | a.cc: In function 'int main()':
a.cc:11:25: error: cannot convert 'char*' to 'char**'
11 | getline(str);
| ^~~
| |
| char*
In file included from a.cc:1:
/usr/include/stdio.h:697:45: note: initializing argument... |
s442835127 | p00011 | C++ | #include<stdio.h>
int main(void){
int w,n,x,y,temp;
int a[31];
char str[7];
for(int i = 0; i < 31; i++){
a[i] = i;
}
scanf("%d %d",&w,&n);
for(int i = 0; i < n; i++){
getline(str,6);
if(str[3] == ',')
str[3] = ' ';
else
str[2] = ' ';
sscanf(str,"%d %d",&x,&y);
temp = a[x];
a[x] = a[y];
a[y]... | a.cc: In function 'int main()':
a.cc:11:25: error: cannot convert 'char*' to 'char**'
11 | getline(str,6);
| ^~~
| |
| char*
In file included from a.cc:1:
/usr/include/stdio.h:697:45: note: initializing argume... |
s127787270 | p00011 | C++ | #include<stdio.h>
int main(void){
int w,n,x,y,temp;
int a[31];
char str[7];
for(int i = 0; i < 31; i++){
a[i] = i;
}
scanf("%d %d",&w,&n);
for(int i = 0; i < n; i++){
gets(str,6);
if(str[3] == ',')
str[3] = ' ';
else
str[2] = ' ';
sscanf(str,"%d %d",&x,&y);
temp = a[x];
a[x] = a[y];
a[y] = ... | a.cc: In function 'int main()':
a.cc:11:17: error: 'gets' was not declared in this scope; did you mean 'getw'?
11 | gets(str,6);
| ^~~~
| getw
|
s857700564 | p00011 | C++ | #include<iostream>
int main(void){
int w,n,x,y,temp;
int a[31];
char c;
string str;
istringstream is(str);
for(int i = 0; i < 31; i++){
a[i] = i;
}
scanf("%d %d",&w,&n);
for(int i = 0; i < n; i++){
getline(str,7);
is >> x >> c >> y;
temp = a[x];
a[x] = a[y];
a[y] = temp;
}
for(int i = 0; i < w; ... | a.cc: In function 'int main()':
a.cc:6:9: error: 'string' was not declared in this scope
6 | string str;
| ^~~~~~
a.cc:6:9: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
from /usr/include/c++/14/ios:40,
from /usr/include/c+... |
s561498878 | p00011 | C++ | #include<iostream>
using namespace std;
int main(void){
int w,n,x,y,temp;
int a[31];
char c;
string str;
istringstream is(str);
for(int i = 0; i < 31; i++){
a[i] = i;
}
scanf("%d %d",&w,&n);
for(int i = 0; i < n; i++){
getline(str,7);
is >> x >> c >> y;
temp = a[x];
a[x] = a[y];
a[y] = temp;
}
... | a.cc: In function 'int main()':
a.cc:9:29: error: variable 'std::istringstream is' has initializer but incomplete type
9 | istringstream is(str);
| ^
a.cc:15:24: error: no matching function for call to 'getline(std::string&, int)'
15 | getline(str,7);
... |
s964745502 | p00011 | C++ | #include<iostream>
#include<vector>
int main()
{
int w,n;
char c;
cin >> w >> n;
vector<int> a(n);
vector<int> b(n);
vector<int> x(w);
for(int i=0;i<n;i++)
{
std::cin >> a[i] >> c >> b[i];
}
for(int i=0;i<w;i++)
{
x[i]=i+1;
}
for(int i=0;i... | a.cc: In function 'int main()':
a.cc:10:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
10 | cin >> w >> n;
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked ... |
s568306642 | p00011 | C++ | #include<iostream>
#include<vector>
int main()
{
int w,n;
char c;
cin >> w >> n;
vector<int> a(n);
vector<int> b(n);
vector<int> x(w);
for(int i=0;i<n;++i)
{
std::cin >> a[i] >> c >> b[i];
}
for(int i=0;i<w;++i)
{
x[i]=i+1;
}
for(int i=0;i... | a.cc: In function 'int main()':
a.cc:10:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
10 | cin >> w >> n;
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked ... |
s760122656 | p00011 | C++ | #include <cstdio>
#include <iostream>
#include <algorhythm>
using namespace std;
int main()
{
int w,n;
int c[]={0};
int a,b;
// int temp;
scanf("%d",&w);
scanf("%d",&n);
for(int i=0; i<=n; i++){
c[i]=i;
}
for(int i=0; i<n; i++){
scanf("%d,%d", &a,&b);
swap(c[a], c[b]);
}
for(int ... | a.cc:3:10: fatal error: algorhythm: No such file or directory
3 | #include <algorhythm>
| ^~~~~~~~~~~~
compilation terminated.
|
s380805779 | p00011 | C++ | #include <cstdio>
#include <iostream>
#include <algorhythm.h>
using namespace std;
int main()
{
int w,n;
int c[]={0};
int a,b;
// int temp;
scanf("%d",&w);
scanf("%d",&n);
for(int i=0; i<=n; i++){
c[i]=i;
}
for(int i=0; i<n; i++){
scanf("%d,%d", &a,&b);
swap(c[a], c[b]);
}
for(in... | a.cc:3:10: fatal error: algorhythm.h: No such file or directory
3 | #include <algorhythm.h>
| ^~~~~~~~~~~~~~
compilation terminated.
|
s697349353 | p00011 | C++ | #include <iostream>
#include <cmath>
#include <vector>
using namespace std;
double dist(double x1, double y1, double x2, double y2){
return sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
}
int main(){
int w, n;
char bar[10];
vector<int> a(31);
const char delim = ',';
int left, right;
for(int i = 1; i <= 30; i++){
... | a.cc: In function 'int main()':
a.cc:27:29: error: 'strtok' was not declared in this scope; did you mean 'strtoq'?
27 | left = atoi(strtok(bar, &delim));
| ^~~~~~
| strtoq
|
s258644497 | p00011 | C++ | #include <iostream>
#include <list>
#include <vector>
#include <map>
#include <string>
#include <algorithm>
using namespace std;
int main(){
int widthCount = 0, heightCount = 0;
string tmp;
cin >> widthCount >> heightCount;
vector<int> width(widthCount);
for(int i = 0; i < widthCount; i++){
width[i] = i + 1;... | a.cc: In function 'int main()':
a.cc:31:17: error: 'strcpy' was not declared in this scope
31 | strcpy(a,tmp.c_str());
| ^~~~~~
a.cc:7:1: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
6 | #include <algorithm>
+++ |... |
s603499163 | p00011 | C++ | #include <iostream>
#include <list>
#include <vector>
#include <map>
#include <string>
#include <algorithm>
#include <cstdlib>
using namespace std;
int main(){
int widthCount = 0, heightCount = 0;
string tmp;
cin >> widthCount >> heightCount;
vector<int> width(widthCount);
for(int i = 0; i < widthCount; i++){
... | a.cc: In function 'int main()':
a.cc:32:17: error: 'strcpy' was not declared in this scope
32 | strcpy(a,tmp.c_str());
| ^~~~~~
a.cc:8:1: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
7 | #include <cstdlib>
+++ |+#... |
s937625935 | p00011 | C++ | #include <iostream>
#include <cstdio>
#include <stdio.h>
using namespace std;
int main(){
int w,n;
int a,b,c;
cin>>w;
cin>>n;
int num[30] = {0};
for(int i=-0;i<w;i++){
num[i] = i+1;
}
for(int j=0;j<n;j++){
scanf_s("%d,%d",&a,&b);
c = num[a-1];
num[a-1] = num[b-1];
num[b-1] = c;
}
for(int k=0;k<w;k++... | a.cc: In function 'int main()':
a.cc:15:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
15 | scanf_s("%d,%d",&a,&b);
| ^~~~~~~
| scanf
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.