submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s416823093
p03673
C++
#include <iostream> #include <cmath> #include <string> #include <set> #include <vector> #include <map> #include <list> using namespace std; typedef pair<int, int> point; int main(void) { int n, r=1; cin >> n; list<int> b; for(int i=1; i<=n; i++) { int a; cin >> a; if(r) ...
a.cc: In function 'int main()': a.cc:29:9: error: 'reverse' was not declared in this scope 29 | reverse(b.begin(), b.end()); | ^~~~~~~
s452359200
p03673
C++
#include <iostream> #include <cmath> #include <string> #include <set> #include <vector> #include <map> #include <list> using namespace std; typedef pair<int, int> point; int main(void) { int n, r=1; cin >> n; list<int> b; for(int i=1; i<=n; i++) { int a; cin >> a; if(r) ...
a.cc: In function 'int main()': a.cc:29:14: error: 'reverse' is not a member of 'std' 29 | std::reverse(b.begin(), b.end()); | ^~~~~~~
s182081154
p03673
C++
#include<deque> #include<iostream> using namespace std; int main() { int n; cin >> n; deque<int> dq; for(int i = 1; i <= n; i++) { int a; cin >> a; if(i % 2 == 0) dq.push_front(a); else dq.push_back(a); } if(n % 2 != 0) reverse(dq.begin(), dq.end()); for(au...
a.cc: In function 'int main()': a.cc:16:20: error: 'reverse' was not declared in this scope 16 | if(n % 2 != 0) reverse(dq.begin(), dq.end()); | ^~~~~~~
s934697730
p03673
C++
#include<iostream> #include<algorithm> using namespace std; int main(){ int n; cin >> n; int a[200000]; for(int i=0;i<n;i++)[ if(i%2==0)cin>>a[(n+i)/2]; else cin>>a[(n-i)/2]; ] for(int i=0;i<n;i++)cout<<a[i]; }
a.cc: In function 'int main()': a.cc:10:9: error: expected identifier before 'if' 10 | if(i%2==0)cin>>a[(n+i)/2]; | ^~ a.cc:10:34: error: expected ']' before ';' token 10 | if(i%2==0)cin>>a[(n+i)/2]; | ^ | ...
s277373461
p03673
C++
#include <iostream> #include <vector> #include <deque> #include <utility> #include <limits> #include <boost/range/irange.hpp> #include <boost/range/adaptors.hpp> using namespace std; using namespace boost; using uint = unsigned int; using ll = long long int; using ull = unsigned long long int; int main() { bool d...
a.cc:6:10: fatal error: boost/range/irange.hpp: No such file or directory 6 | #include <boost/range/irange.hpp> | ^~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated.
s987464240
p03673
C++
#include <iostream> #include <vector> #include <string> using namespace std; int main(void){ int n; cin >> n; vector<int> a(n); for (int i = 0; i < n; i++) cin >> a[i]; for (int i = n-1; i >= 0; i -= 2){ cout << a[i] << " "; } int k; if (i % 2 == 0) k = 0; else k = 1; for (int i = k; i < n; ...
a.cc: In function 'int main()': a.cc:24:13: error: 'i' was not declared in this scope 24 | if (i % 2 == 0) | ^
s299739543
p03673
C++
#include <iostream> #include <vector> #include <string> using namespace std; int main(void){ int n; cin >> n; vector<int> a(n); for (int i = 0; i < n; i++) cin >> a[i]; for (int i = n-1; i >= 0; i -= 2){ cout << a[i] << " "; } if (i % 2 == 0) k = 0; else k = 1; for (int i = k; i < n; i += 2){...
a.cc: In function 'int main()': a.cc:23:13: error: 'i' was not declared in this scope 23 | if (i % 2 == 0) | ^ a.cc:24:17: error: 'k' was not declared in this scope 24 | k = 0; | ^ a.cc:26:17: error: 'k' was not declared in this scope 26 | ...
s423550055
p03673
C
#include <stdio.h> int main(){ int n,i,j,k,m,w,now; int *pn,*pi,*pj,*pk,*pm,*pw,*pnow; pn=&n;pi=&i;pj=&j;pk=&k;pm=&m;pw=&w;pnow=&now; scanf("%d",pn); int a[n],b[n],b2[n]; int *pa,*pb,*pb2; pa=a;pb=b;pb2=b2; for(pi=0;pi<pn;pi++){ scanf("%d",pa[pi]); } for(pj=0;pj<pn;...
main.c: In function 'main': main.c:16:22: error: array subscript is not an integer 16 | scanf("%d",pa[pi]); | ^ main.c:20:18: error: array subscript is not an integer 20 | pnow = pa[pj]; | ^ main.c:21:11: error: array subscript is not an integer ...
s683124713
p03673
C
#include <stdio.h> int main(){ int n,i,j,k,m,w,now; int *pn,*pi,*pj,*pk,*pm,*pw,*pnow; pn=&n;pi=&i;pj=&j;pk=&k;pm=&m;pw=&w;pnow=&now; scanf("%d",&pn); int a[n],b[n],b2[n]; int *pa,*pb,*pb2; pa=a;pb=b;pb2=b2; for(pi=0;pi<pn;pi++){ scanf("%d",&pa[pi]); } for(pj=0;pj<p...
main.c: In function 'main': main.c:16:23: error: array subscript is not an integer 16 | scanf("%d",&pa[pi]); | ^ main.c:20:14: error: assignment to 'int *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 20 | pnow = pa[j]; | ^ ...
s890426359
p03673
C
#include <stdio.h> int main(){ int n,i,j,k,m,w,now; int *pn,*pi,*pj,*pk,*pm,*pw,*pnow; pn=n;pi=i;pj=j;pk=k;pm=m;pw=w;pnow=now; scanf("%d",&pn); int a[n],b[n],b2[n]; int *pa,*pb,*pb2; pa=a;pb=b;pb2=b2; for(pi=0;pi<pn;pi++){ scanf("%d",&pa[pi]); } for(pj=0;pj<pn;pj++)...
main.c: In function 'main': main.c:6:7: error: assignment to 'int *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 6 | pn=n;pi=i;pj=j;pk=k;pm=m;pw=w;pnow=now; | ^ main.c:6:12: error: assignment to 'int *' from 'int' makes pointer from integer without a cast [-Wint-conversio...
s385954829
p03673
C
#include <stdio.h> int main(){ int n,i,j,k,m,w,now; scanf("%d",&n); int a[n],b[n],b2[n]; int *pa,*pb,*pb2; pa=a;pb=b;pc=b2; for(i=0;i<n;i++){ scanf("%d",&a[i]); } for(j=0;j<n;j++){ now = pa[j]; pb[j] = now; pb2[j] = now; /*逆向きに並べ替える必要あり。*/ ...
main.c: In function 'main': main.c:11:15: error: 'pc' undeclared (first use in this function); did you mean 'pb'? 11 | pa=a;pb=b;pc=b2; | ^~ | pb main.c:11:15: note: each undeclared identifier is reported only once for each function it appears in
s225387408
p03673
C
#include <stdio.h> int main(){ int n,i,j,k,m,w,now; scanf("%d",&n); int a[n],b[n],b2[n]; int *pa,*pb,*pb2; pa=a;pb=b;pc=c; for(i=0;i<n;i++){ scanf("%d",&a[i]); } for(j=0;j<n;j++){ now = pa[j]; pb[j] = now; pb2[j] = now; /*逆向きに並べ替える必要あり。*/ ...
main.c: In function 'main': main.c:11:15: error: 'pc' undeclared (first use in this function); did you mean 'pb'? 11 | pa=a;pb=b;pc=c; | ^~ | pb main.c:11:15: note: each undeclared identifier is reported only once for each function it appears in main.c:11:18: error: 'c' un...
s467653303
p03673
C
#include <stdio.h> int main(){ int n,i,j,k,m,w,now; scanf("%d",&n); int a[n],b[n],b2[n]; for(i=0;i<n;i++){ scanf("%d",&a[i]); } for(j=0;j<n;j++){ now = a[j]; b[j] = now; b2[j] = now; /*逆向きに並べ替える必要あり。*/ k = 0; m = j; while(k<j){...
main.c: In function 'main': main.c:22:25: error: expected ';' before 'k' 22 | b[k] = b2[m] | ^ | ; 23 | k++; | ~
s682694981
p03673
C++
#include <iostream> #include <vector> #include <string> #include <algorithm> #include <utility> #include <stack> #include <functional> #include <queue> #include <cmath> #include <set> #define rep(i,j,k) for(int i=j;i<k;i++) #define all(v) (v).begin(),(v).end() #define Sort(x) sort((x).begin(),(x).end()) #define fi fir...
a.cc: In function 'int main()': a.cc:39:8: error: 'i' was not declared in this scope 39 | if(i%2==0)reverse(all(ans)); | ^
s107130665
p03673
C++
#include<iostream> using namespace std; const int size=999; int main() { int m,list1[size],list2[size]; cin>>m; for(int j=0;;j++) { cin>>list1[j]; if(getchar()=='\n') break; } for (int q=0;q<j+1;q++) list2[q]=list1[q]; for (int a=1;a<m+1;a++) { for (int w=0;w<a;w++) list1[w]=list2[a-1-w]; for(i...
a.cc: In function 'int main()': a.cc:7:21: error: reference to 'size' is ambiguous 7 | int m,list1[size],list2[size]; | ^~~~ In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c...
s758600648
p03673
C++
#include<iostream> using namespace std; const int size=999; int main() { int m,list1[size],list2[size]; cin>>m; for(int j=0;;j++) { cin>>list1[j]; if(getchar()=='\n') break; } for (int q=0;q<j+1;q++) list2[q]=list1[q]; for (int a=1;a<m+1;a++) { for (int w=0;w<a;w++) list1[w]=list2[a-1-w]; for(i...
a.cc: In function 'int main()': a.cc:7:21: error: reference to 'size' is ambiguous 7 | int m,list1[size],list2[size]; | ^~~~ In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c...
s975850313
p03673
C++
#include<iostream> using namespace std; const int size=999; void swop(const int list[],int n); int main() { int m,list[size]; cin>>m; for(int j=0;;j++) { cin>>list[j]; if(getchar()=='\n') break; } for (int a=1;a<m+1;a++) swop(list,a); for (int k=0;k<j+1;k++) cout<<list[k]<<" "; cout<<endl; system(...
a.cc: In function 'int main()': a.cc:9:20: error: reference to 'size' is ambiguous 9 | int m,list[size]; | ^~~~ In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios...
s866717313
p03673
C++
#include <iostream> using namespace std ; int reverse(int t[] , int m[],int e) {for (int i=0,j=e-1;j<e;i++,j--) m[j]=t[i]; } int main() { int N,i,t; cin>>N; int*a= new int [N]; int*b= new int [N]; for(i=0;i<N;i++) cin>>a[i]; for(i=0;i<N;i++) { b[i]=a[i]; reverse(a,b,i+1); for(t=0;t<i+1;t++) b[t]=a[t]; for(i=0;i<N;i+...
a.cc: In function 'int reverse(int*, int*, int)': a.cc:6:1: warning: no return statement in function returning non-void [-Wreturn-type] 6 | } | ^ a.cc: In function 'int main()': a.cc:27:2: error: expected '}' at end of input 27 | } | ^ a.cc:8:1: note: to match this '{' 8 | { | ^
s579848899
p03673
C++
#include <iostream> using namespace std ; int reverse(int t[] , int m[],int e) {for (int i=0,j=e-1;j<e;i++,j--) m[j]=t[i]; } int main() { int N,i,t; cin>>N; int*a= new int [N]; int*b= new int [N]; for(i=0;i<N;i++) cin>>a[i]; for(i=0;i<N;i++) { b[i]=a[i]; reverse(a,b,i+1); for(t=0;t<i+1;t++) b[t]=a[t]; for(i=0;i<N;i+...
a.cc: In function 'int reverse(int*, int*, int)': a.cc:6:1: warning: no return statement in function returning non-void [-Wreturn-type] 6 | } | ^ a.cc: In function 'int main()': a.cc:27:2: error: expected '}' at end of input 27 | } | ^ a.cc:8:1: note: to match this '{' 8 | { | ^
s557823310
p03673
C++
#include <iostream> using namespace std ; int reverse(int t[] , int m[],int e) {for (int i=0,j=e-1;j<e;i++,j--) m[j]=t[i]; } int main() { int N,i,t; cin>>N; int*a= new int [N]; int*b= new int [N]; for(i=0;i<N;i++) cin>>a[i]; for(i=0;i<N;i++) { b[i]=a[i]; reverse(a,b,i+1); for(t=0;t<i+1;t++) b[t]=a[t]; for(i=0;i<N;i+...
a.cc: In function 'int reverse(int*, int*, int)': a.cc:6:1: warning: no return statement in function returning non-void [-Wreturn-type] 6 | } | ^ a.cc: In function 'int main()': a.cc:27:2: error: expected '}' at end of input 27 | } | ^ a.cc:8:1: note: to match this '{' 8 | { | ^
s341398076
p03673
C
#include"stdio.h" int main(void) { int a[10],b[10],n,i,t=1; scan("%d\n",&n); for(i=1;i<=n;i++) { scan("%d",&a[i]); } if(n%2==0) { for(i=n;i>=2;i=i-2) b[t++]=a[i]; for(i=1;i<=n-1;i=i+2) b[t++]=a[i]; } else { for(i=n;i>=1;i=i-2) b[t++]=a[i]; for(i=2;i<=n-1;i=i+2) ...
main.c: In function 'main': main.c:5:5: error: implicit declaration of function 'scan'; did you mean 'scanf'? [-Wimplicit-function-declaration] 5 | scan("%d\n",&n); | ^~~~ | scanf main.c:25:5: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declar...
s760457919
p03673
C
#include"stdio.h" int main(void) { int a[10],b[10],n,i,t=1; input(n); for(i=1;i<=n;i++) { input(a[i]); } if(n%2==0) { for(i=n;i>=2;i=i-2) b[t++]=a[i]; for(i=1;i<=n-1;i=i+2) b[t++]=a[i]; } else { for(i=n;i>=1;i=i-2) b[t++]=a[i]; for(i=2;i<=n-1;i=i+2) b[t++]...
main.c: In function 'main': main.c:5:5: error: implicit declaration of function 'input' [-Wimplicit-function-declaration] 5 | input(n); | ^~~~~ main.c:25:4: error: implicit declaration of function 'output' [-Wimplicit-function-declaration] 25 | output(b[i]); | ^~~~~~
s020413906
p03673
C
#include "stdio.h" #include "conio.h" #include "string.h" #include "stdlib.h" typedef struct _data{ int num; struct _data *next; }Data; typedef struct _List{ Data *head; Data *tail; }List; void data_input(List *plist); void linkedlist_back(List *plist,int _idx); void linkedlist_print(List *plist); int main() { ...
main.c:2:10: fatal error: conio.h: No such file or directory 2 | #include "conio.h" | ^~~~~~~~~ compilation terminated.
s601041235
p03673
C++
#include<stdio.h> #include<stdlib.h> int main() { int *a, *b, n; scanf_s("%d", &n); a = (int *)malloc(n * sizeof(int)); for (int i = 0; i < n; i++) scanf_s("%d", &a[i]); b = (int *)malloc(n * sizeof(int)); if (n % 2 == 0)//n为偶数 { for (int i = 0; i < n / 2; i++) b[i] = a[n - 1 - 2 * i]; for (int i = ...
a.cc: In function 'int main()': a.cc:7:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 7 | scanf_s("%d", &n); | ^~~~~~~ | scanf
s548126299
p03673
C++
#include<stack> #include<queue> using namespace std; int main() { stack<int> q; queue<int> p; int n; int x; int i; int j; cin>>n; for(i=0;i<n;i++) { cin>>x; q.push(x); for(j=0;j<=i;j++) { p.push(q.top()); q.pop(); ...
a.cc: In function 'int main()': a.cc:12:5: error: 'cin' was not declared in this scope 12 | cin>>n; | ^~~ a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 2 | #include<queue> +++ |+#include <iostream> 3 | using namespace st...
s230493905
p03673
C++
#include<iostream> using namespace std; int main() { int *b; b = new int[n]; int Head = 0, End = n-1,flag=1; for (int i = 0; i < n; i++) { if (flag) { b[Head] = a[i]; Head++; flag = 0; } else { b[End] = a[i]; End--; flag = 1; } } if (flag) { for (int i = 0; i < n; i++) cout <...
a.cc: In function 'int main()': a.cc:7:21: error: 'n' was not declared in this scope 7 | b = new int[n]; | ^ a.cc:11:21: error: 'flag' was not declared in this scope 11 | if (flag) | ^~~~ a.cc:13:35: error: 'a' was not declared in this s...
s797376403
p03673
C++
#include<iostream> using namespace std; int main() { //int n=6; //int *b, a[6] = {0,6,7,6,7,0}; int *b; b = new int[n]; int Head = 0, End = n-1,flag=1; for (int i = 0; i < n; i++) { if (flag) { b[Head] = a[i]; Head++; flag = 0; } else { b[End] = a[i]; End--; flag = 1; } } if (fla...
a.cc: In function 'int main()': a.cc:9:21: error: 'n' was not declared in this scope 9 | b = new int[n]; | ^ a.cc:13:21: error: 'flag' was not declared in this scope 13 | if (flag) | ^~~~ a.cc:15:35: error: 'a' was not declared in this s...
s490591010
p03673
C++
#include </bits/stdc++.h> using namespace std; vector<int> a; int main() { int n, num; cin >> n; while (n--) { scanf("%d", &num); a.push_back(num); reverse(a.begin(), a.end()); } for (int i = 0; i < a.size(); i++) { if (i == 0) cout << a.at(i); e...
a.cc:1:10: fatal error: /bits/stdc++.h: No such file or directory 1 | #include </bits/stdc++.h> | ^~~~~~~~~~~~~~~~ compilation terminated.
s474166253
p03673
C
#include<stdio.h> #include<stdlib.h> int main() { int n; scanf("%d", &n); int *a = NULL,*b=NULL; b = (int *)malloc(sizeof(int)*n); a = (int *)malloc(sizeof(int)*n); int i,x,y; x = y = n / 2; for (i = 0; i < n; i++) { scanf("%d", &a[i]); if (n % 2 == 1) (i % 2 == 0)?b[x--] = a[i]:b[++y] = a[i]; ...
main.c: In function 'main': main.c:17:59: error: lvalue required as left operand of assignment 17 | (i % 2 == 0)?b[x--] = a[i]:b[++y] = a[i]; | ^ main.c:21:60: error: lvalue required as left operand of assignment 21 | ...
s097798286
p03673
C
#include<stdio.h> int main() { long long int n,i,j; scanf("%lld",&n); long long int b[n]={0}; long long int a[n]={0}; for(i=0;i<n;i++) { scanf("%lld",&a[i]); } for(i=n-1,j=0;i>=0;i=i-2,j++) { b[j]=a[i]; if(i!=0) b[n-j-1]=a[i-1]; } for(i=0;i<n;i++) { printf("%lld ",b[i]); } return 0; ...
main.c: In function 'main': main.c:6:28: error: variable-sized object may not be initialized except with an empty initializer 6 | long long int b[n]={0}; | ^ main.c:7:28: error: variable-sized object may not be initialized except with an empty initializer 7 | lon...
s751747462
p03673
C
#include<stdio.h> int main() { int n,i,j; scanf("%d",&n); long int b[n]={0}; long int a[n]={0}; for(i=0;i<n;i++) { scanf("%ld",&a[i]); } for(i=n-1,j=0;i>=0;i=i-2,j++) { b[j]=a[i]; if(i!=0) b[n-j-1]=a[i-1]; } for(i=0;i<n;i++) { printf("%ld ",b[i]); } return 0; }
main.c: In function 'main': main.c:6:23: error: variable-sized object may not be initialized except with an empty initializer 6 | long int b[n]={0}; | ^ main.c:7:23: error: variable-sized object may not be initialized except with an empty initializer 7 | long int a[n]...
s606091496
p03673
C
#include<stdio.h> int main() { long int n,i,j; scanf("%ld",&n); long int b[n]={0}; long int a[n]={0}; for(i=0;i<n;i++) { scanf("%ld",&a[i]); } for(i=n-1,j=0;i>=0;i=i-2,j++) { b[j]=a[i]; if(i!=0) b[n-j-1]=a[i-1]; } for(i=0;i<n;i++) { printf("%ld ",b[i]); } return 0; }
main.c: In function 'main': main.c:6:23: error: variable-sized object may not be initialized except with an empty initializer 6 | long int b[n]={0}; | ^ main.c:7:23: error: variable-sized object may not be initialized except with an empty initializer 7 | long int a[n]...
s415060983
p03673
C
#include<stdio.h> int main() { int n,i,j; scanf("%d",&n); long int b[n]={0}; long int a[n]={0}; for(i=0;i<n;i++) { scanf("%ld",&a[i]); } for(i=n-1,j=0;i>=0;i=i-2,j++) { b[j]=a[i]; if(i!=0) b[n-j-1]=a[i-1]; } for(i=0;i<n;i++) { printf("%ld ",b[i]); } return 0; }
main.c: In function 'main': main.c:6:23: error: variable-sized object may not be initialized except with an empty initializer 6 | long int b[n]={0}; | ^ main.c:7:23: error: variable-sized object may not be initialized except with an empty initializer 7 | long int a[n]...
s456265596
p03673
C
#include<stdio.h> int main() { int n,i,j; scanf("%d",&n); int b[n]={0}; int a[n]={0}; for(i=0;i<n;i++) { scanf("%d",&a[i]); } for(i=n-1,j=0;i>=0;i=i-2,j++) { b[j]=a[i]; if(i!=0) b[n-j-1]=a[i-1]; } for(i=0;i<n;i++) { printf("%d ",b[i]); } return 0; }
main.c: In function 'main': main.c:6:18: error: variable-sized object may not be initialized except with an empty initializer 6 | int b[n]={0}; | ^ main.c:7:18: error: variable-sized object may not be initialized except with an empty initializer 7 | int a[n]={0}; | ...
s965002318
p03673
C
#include<stdio.h> int main() { int n,i,j; scanf("%d",&n); long int b[n]={0}; long int a[n]={0}; for(i=0;i<n;i++) { scanf("%ld",&a[i]); } for(i=n-1,j=0;i>=0;i=i-2,j++;) { b[j]=a[i]; if(i!=0) b[n-j-1]=a[i-1]; } for(i=0;i<n;i++) { printf("%ld ",b[i]); } return 0; }
main.c: In function 'main': main.c:6:23: error: variable-sized object may not be initialized except with an empty initializer 6 | long int b[n]={0}; | ^ main.c:7:23: error: variable-sized object may not be initialized except with an empty initializer 7 | long int a[n]...
s473290649
p03673
C
#include<stdio.h> int main() { int n,i,j; scanf("%d\n",&n); long int b[n]={0}; long int a[n]={0}; for(i=0;i<n;i++) { scanf("%ld",&a[i]); } for(i=n-1,j=0;i>=0;i=i-2,j++) { b[j]=a[i]; if(i!=0) b[n-j-1]=a[i-1]; } for(i=0;i<n;i++) { printf("%ld ",b[i]); } return 0; }
main.c: In function 'main': main.c:6:23: error: variable-sized object may not be initialized except with an empty initializer 6 | long int b[n]={0}; | ^ main.c:7:23: error: variable-sized object may not be initialized except with an empty initializer 7 | long int a[n]...
s544037420
p03673
C++
#include<iostream> using namespace std; long int j[200000]; long int k[200000]; void main() { int i; cin >> i; for (int z=0; z < i; z++) { cin >> j[z]; k[z] = j[z]; for (int x = 0; x <(z + 1)/2; x++) { int a; a = k[x]; k[x] = k[z-x]; k[z - x] = a; } } for (int z=0; z < i; z++) { cout << k...
a.cc:5:1: error: '::main' must return 'int' 5 | void main() | ^~~~
s550785370
p03673
C++
#include<iosream> using namespace std; int main() { long n,k; long long *a; int temp=1; cin>>n; k=n/2; a = new long long int[n]; if((n-2k)==0) { for(int i=0;i<n;i++){ if(temp==1) { cin>>a[k]; temp++; } else { if(temp%2==0) cin>>a[k-temp/2]; else cin>>a[k+temp/...
a.cc:1:9: fatal error: iosream: No such file or directory 1 | #include<iosream> | ^~~~~~~~~ compilation terminated.
s196079532
p03673
C
#include<stdio.h> int main() { int n,i,j; scanf("%d",&n); long int b[n]={0}; long int a[n]={0}; for(i=0;i<n;i++) { scanf("%ld",&a[i]); } for(i=n-1,j=0;i>=0;i=i-2,j++;) { b[j]=a[i]; if(i!=0) b[n-j-1]=a[i-1]; } for(i=0;i<n;i++) { printf("%ld ",b[i]); } return 0; }
main.c: In function 'main': main.c:6:23: error: variable-sized object may not be initialized except with an empty initializer 6 | long int b[n]={0}; | ^ main.c:7:23: error: variable-sized object may not be initialized except with an empty initializer 7 | long int a[n]...
s291361441
p03673
C++
#include <iostream> #include <cstdio> #include <cstdlib> using namespace std; const int N = 20000; int n; int a[N],b[N]; void solve() { int len = 0; for (int i = n; i>= 1; i-=2) b[++len] = a[i]; for (int i = n-1,len = n; i >= 1; i-=2) b[len--] = a[i]; for (int i = 1; i <= n; i++) printf("%d ", b[i]); pri...
a.cc:7:15: error: unable to find numeric literal operator 'operator""\U0000ff1b' 7 | const int N = 20000; | ^~~~~~~ a.cc:10:7: error: size of array 'a' is not an integral constant-expression 10 | int a[N],b[N]; | ^ a.cc:10:12: error: size of array 'b' is not an integral constant-e...
s902409942
p03673
C
#include<stdio.h> int main() { int n,i,j; scanf("%d",&n); long int b[n]={0}; long int a[n]={0}; for(i=0;i<n;i++) { scanf("%ld",&a[i]); } for(i=n-1,j=0;i>=0;i=i-2,j++) { b[j]=a[i]; if(i!=0) b[n-j-1]=a[i-1]; } for(i=0;i<n;i++) { printf("%ld ",b[i]); } return 0; }
main.c: In function 'main': main.c:6:23: error: variable-sized object may not be initialized except with an empty initializer 6 | long int b[n]={0}; | ^ main.c:7:23: error: variable-sized object may not be initialized except with an empty initializer 7 | long int a[n]...
s814087935
p03673
C
#include<stdio.h> int main() { int n,i,j; scanf("%d",&n); long int b[n]={0}; long int a[n]={0}; for(i=0;i<n;i++) { scanf("%ld",&a[i]); } for(i=n-1,j=0;i>=0;i=i-2,j++;) { b[j]=a[i]; if(i!=0) b[n-j-1]=a[i-1]; } for(i=0;i<n;i++) { printf("%ld ",b[i]); } return 0; }
main.c: In function 'main': main.c:6:23: error: variable-sized object may not be initialized except with an empty initializer 6 | long int b[n]={0}; | ^ main.c:7:23: error: variable-sized object may not be initialized except with an empty initializer 7 | long int a[n]...
s661172978
p03673
C++
#include<iostream> using namespace std; int main() { int n; cin >> n; int a[100], b[100]; for (int i = 0; i < n; i++) cin >> a[i]; int temp; int count = 0; for (int k = 0; k < n; k++) { b[count] = a[k]; for (int x = 0; x <= count/2; x++) { temp = b[x]; b[x] = b[count-x]; b[count - x] = t...
a.cc:30:2: error: stray '#' in program 30 | }#include<iostream> | ^ a.cc:30:3: error: 'include' does not name a type 30 | }#include<iostream> | ^~~~~~~ a.cc:32:5: error: redefinition of 'int main()' 32 | int main() | ^~~~ a.cc:3:5: note: 'int main()' previously defined here 3 | int...
s521203841
p03673
C
#include<stdio.h> #include<stdlib.h> int main() { int n; scanf_s("%d", &n); int *a, *b, *c; a = (int *)malloc(n*sizeof(int)); b = (int *)malloc(n*sizeof(int)); c = (int *)malloc(n*sizeof(int)); for (int i = 0; i < n; i++) { int count = 0; scanf_s("%d", &a[i]); b[i] = a[i]; for (int j = i; j >= 0;...
main.c: In function 'main': main.c:6:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration] 6 | scanf_s("%d", &n); | ^~~~~~~ | scanf
s909692649
p03673
C
#include<stdio.h> int main() { int n,i,j; scanf("%d",&n); int b[n]={0}; int a[n]={0}; for(i=0;i<n;i++) { scanf("%d",&a[i]); } for(i=n-1,j=0;i>=0;i=i-2,j++) { b[j]=a[i]; if(i!=0) b[n-j-1]=a[i-1]; } for(i=0;i<n;i++) { printf("%d ",b[i]); } return 0; }
main.c: In function 'main': main.c:6:18: error: variable-sized object may not be initialized except with an empty initializer 6 | int b[n]={0}; | ^ main.c:7:18: error: variable-sized object may not be initialized except with an empty initializer 7 | int a[n]={0}; | ...
s970626804
p03673
C++
#include<stack> #include<queue> using namespace std; int main() { stack<int> q; queue<int> p; int n; int x; int i; int j; cin>>n; for(i=0;i<n;i++) { cin>>x; q.push(x); for(j=0;j<=i;j++) { p.push(q.top()); q.pop(); ...
a.cc: In function 'int main()': a.cc:12:5: error: 'cin' was not declared in this scope 12 | cin>>n; | ^~~ a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 2 | #include<queue> +++ |+#include <iostream> 3 | using namespace st...
s321617844
p03673
C++
#include<iostream> using namespace std; int main() { int n; while (cin >> n) { for (int i = 1; i <= n; ++i) { cin >> a[i]; } if (n & 1) { cout << a[n]; for (int i = n - 2; i >= 1; i -= 2) cout << " " << a[i]; for (int i = 2; i <= n - 1; i += 2) cout << " " << a[i]; cout << endl; } ...
a.cc: In function 'int main()': a.cc:10:32: error: 'a' was not declared in this scope 10 | cin >> a[i]; | ^ a.cc:14:33: error: 'a' was not declared in this scope 14 | cout << a[n]; | ^ a.cc:2...
s550347647
p03673
C++
#include<stdio.h> int n; void reverse(int *b, int s) { int t; for (int i = 0, j = s; i < j; i++, j--) { t = b[i]; b[i] = b[j]; b[j] = t; } } int main() { int *a,*b; scanf(" %d", &n); a = b = (int*)malloc(n * sizeof(int)); for (int i = 0; i < n; i++) scanf(" %d", &a[i]); for (int i = 0; i < n; i++) { b[i...
a.cc: In function 'int main()': a.cc:15:23: error: 'malloc' was not declared in this scope 15 | a = b = (int*)malloc(n * sizeof(int)); | ^~~~~~ a.cc:2:1: note: 'malloc' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>' 1 | #include<stdio...
s478622593
p03673
C
#include<stdio.h> #include<algorithm> using namespace std; const int M=2e5+5; int main() { int n,a[M],b[M],i,j,k=0; scanf("%d",&n); for(i=0;i<=n-1;i++) scanf("%d",&a[i]); for(j=n-1;j>=0;j--) { for(i=j;i!=n;i++) b[i-1]=b[i]; b[n-1]=a[k]; k++; reverse(b+j,b+n); } for(i=0;i<n-1;i++) printf("%d ",b[i]); ...
main.c:2:9: fatal error: algorithm: No such file or directory 2 | #include<algorithm> | ^~~~~~~~~~~ compilation terminated.
s665682612
p03673
C
#include<stdio.h> #include<algorithm> using namespace std; const int M=2e5+5; int main() { int n,a[M],b[M],i,j,k=0; scanf("%d",&n); for(i=0;i<=n-1;i++) scanf("%d",&a[i]); for(j=n-1;j>=0;j--) { for(i=j;i!=n;i++) b[i-1]=b[i]; b[n-1]=a[k]; k++; reverse(b+j,b+n); } for(i=0;i<n-1;i++) printf("%d ",b[i]); ...
main.c:2:9: fatal error: algorithm: No such file or directory 2 | #include<algorithm> | ^~~~~~~~~~~ compilation terminated.
s083069031
p03673
C
#include <stdio.h> int main() { int a[200000], c,x, n, m = 0; while (1) { scanf("%d", &n); if (n >= 1 && n <= 200000) break; } int b[20000]; while (m<n) { x = 0; scanf("%d", &a[m]); if (a[m]>1000000000 || a[m]<0) { continue; } else { m++; } } } if (m / 2 == 1) { for (c...
main.c:25:1: error: expected identifier or '(' before 'if' 25 | if (m / 2 == 1) | ^~ main.c:38:25: error: expected identifier or '(' before 'else' 38 | else | ^~~~
s725970213
p03673
C
#include <stdio.h> int main() { int a[200000], c,x, n, m = 0; while (1) { scanf("%d", &n); if (n >= 1 && n <= 200000) break; } int b[20000]; while (m<n) { x = 0; scanf("%d", &a[m]); if (a[m]>1000000000 || a[m]<0) { continue; } else { m++; if (m / 2 == 1) { for (c = m - 1; c >= ...
main.c: In function 'main': main.c:55:1: error: expected declaration or statement at end of input 55 | } | ^
s999917263
p03673
C
#include <stdio.h> int main() { int a[200000], c,x, n, m = 0; while (1) { scanf("%d", &n); if (n >= 1 && n <= 200000) break; } int b[20000]; while (m<n) { x = 0; scanf("%d", &a[m]); if (a[m]>1000000000 || a[m]<0) { continue; } else { m++; if (m / 2 == 1) { for (c = m - 1; c >= ...
main.c: In function 'main': main.c:54:1: error: expected declaration or statement at end of input 54 | } | ^ main.c:54:1: error: expected declaration or statement at end of input
s120616753
p03673
C++
#include<cstdio> #include<iostream> using namespace std; int main() { int n; scanf_s("%d", &n); int *a = new int[n]; for (int i = 0; i<n; i++) { scanf_s("%d", a + i); } int nn = n / 2; if (n % 2 == 0) { for (int i = 0; i<nn; i++) { printf("%d ", a[n - 2 * i - 1]); } for (int i = 0; i<nn; i++) { ...
a.cc: In function 'int main()': a.cc:7:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 7 | scanf_s("%d", &n); | ^~~~~~~ | scanf
s015276624
p03673
Java
public class Main { public static void main(String[] args) { Scanner input = new Scanner(System.in); int count = input.nextInt(); ArrayList<Integer> list = new ArrayList<>(); boolean flag = count%2==0?false:true; for(int i = 0; i < count; i++) { if(flag) { list.add(input.nextInt()); flag = !...
Main.java:4: error: cannot find symbol Scanner input = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:4: error: cannot find symbol Scanner input = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:6: error: cannot find ...
s253842204
p03673
C
#include<stdio.h> int main() { int a[200000],c,t,n,m=0; while(1) { scanf("%d",&n); if(n>=1&&n<=200000) break; } int b[n]; while(m<n) { scanf("%d",&a[m]); if(a[m]>1000000000||a[m]<0) { continue; } else{ b[n-b-1]=a[m]; m++; ...
main.c: In function 'main': main.c:20:4: error: invalid operands to binary - (have 'int' and 'int *') 20 | b[n-b-1]=a[m]; | ^ | | | int * main.c:25:6: error: assignment to expression with array type 25 | for(b=n-1;b>=0;b--) | ^ main.c:25:17: error: lvalue required as decremen...
s988830813
p03673
C
#include<stdio.h> int main() { int a[200000],c,t,n,m=0; while(1) { scanf("%d",&n); if(n>=1&&n<=200000) break; } int b[n]; while(m<n) { scanf("%d",&a[m]); if(a[m]>1000000000||a[m]<0) { continue; } else{ b[n-b-1]=a[b]; b++; ...
main.c: In function 'main': main.c:20:4: error: invalid operands to binary - (have 'int' and 'int *') 20 | b[n-b-1]=a[b]; | ^ | | | int * main.c:20:11: error: array subscript is not an integer 20 | b[n-b-1]=a[b]; | ^ main.c:21:2: error: lvalue required as increment opera...
s907174974
p03673
C
#include<stdio.h> int main() { int a[200000],c,t,n,m=0; while(1) { scanf("%d",&n); if(n>=1&&n<=200000) break; } int b[n]; while(m<n) { scanf("%d",&a[m]); if(a[m]>1000000000||a[m]<0) { continue; } else{ b[n-b-1]=a[b]; b++; ...
main.c: In function 'main': main.c:20:4: error: invalid operands to binary - (have 'int' and 'int *') 20 | b[n-b-1]=a[b]; | ^ | | | int * main.c:20:11: error: array subscript is not an integer 20 | b[n-b-1]=a[b]; | ^ main.c:21:2: error: lvalue required as increment opera...
s104417750
p03673
C
#include<stdio.h> int main() { int a[200000],c,t,n,b=0; while(1) { scanf("%d",&n); if(n>=1&&n<=200000) break; } while(b<n) { scanf("%d",&a[b]); if(a[b]>1000000000||a[b]<0) { continue; } else{ for(c=b;c>=0;c--) { t=a[c]; a[c...
main.c: In function 'main': main.c:31:5: error: 'renturn' undeclared (first use in this function) 31 | renturn 0; | ^~~~~~~ main.c:31:5: note: each undeclared identifier is reported only once for each function it appears in main.c:31:12: error: expected ';' before numeric constant 31 | renturn 0...
s407858958
p03673
C
#include<stdio,h> int main() { int a[200000],c,t,n,b=0; while(1) { scanf("%d",&n); if(n>=1&&n<=200000) break; } while(b<n) { scanf("%d",&a[b]); if(a[b]>1000000000||a[b]<0) { continue; } else{ for(c=b;c>=0;c--) { t=a[c]; a[c...
main.c:1:9: fatal error: stdio,h: No such file or directory 1 | #include<stdio,h> | ^~~~~~~~~ compilation terminated.
s699278809
p03673
C++
#include <iostream> #include <vector> #include <queue> using namespace std; int main() { int n; cin >> n; vector<int> a(n); for(int i=0; i<n; ++i) cin >> a[i]; deque<int> b; for(int i=0; i<n; ++i){ if(i % 2 == 0) b.push_back(a[i]); else b.push...
a.cc: In function 'int main()': a.cc:21:9: error: 'reverse' was not declared in this scope 21 | reverse(b.begin(), b.end()); | ^~~~~~~
s138998959
p03673
C
#include<stdio.h> int main() { int n,i,q;long a[200001]; while(~scanf("%d",&n)) { for(i=1;i<=n;i++) { scanf("%ld",&a[i]); } for(q=n;q>=1;q-=2) printf(q==1||q==2?"%ld":"%ld ",a[q]); for(n%2==0?q=1:q=2;q<n;q+=2) printf(q==n-1?" %ld\n":" %ld",a[q]); if(n==1) printf("\n"); } }
main.c: In function 'main': main.c:14:41: error: lvalue required as left operand of assignment 14 | for(n%2==0?q=1:q=2;q<n;q+=2) | ^
s529564176
p03673
Java
class Pushpush { public static void main(String[] args) { Scanner input = new Scanner(System.in); int count = input.nextInt(); int[] num = new int[count]; for(int i = 0; i < count; i++) { num[i] = input.nextInt(); } Stack<Integer> stack = new Stack<Integer>(); int[] res = new int[count]; res[...
Main.java:4: error: cannot find symbol Scanner input = new Scanner(System.in); ^ symbol: class Scanner location: class Pushpush Main.java:4: error: cannot find symbol Scanner input = new Scanner(System.in); ^ symbol: class Scanner location: class Pushpush Main.java:11: error: can...
s555477078
p03673
Java
import java.util.Scanner; import java.util.Stack; public static void main(String[] args) { Scanner input = new Scanner(System.in); int count = input.nextInt(); int[] num = new int[count]; for(int i = 0; i < count; i++) { num[i] = input.nextInt(); } Stack<Integer> stack = new Stack<Integer>(); int[]...
Main.java:4: error: unnamed classes are a preview feature and are disabled by default. public static void main(String[] args) { ^ (use --enable-preview to enable unnamed classes) 1 error
s266411218
p03673
Java
import java.util.Scanner; import java.util.Stack; public class Pushpush { public static void main(String[] args) { Scanner input = new Scanner(System.in); int count = input.nextInt(); int[] num = new int[count]; for(int i = 0; i < count; i++) { num[i] = input.nextInt(); } Stack<Integer> stack = new ...
Main.java:4: error: class Pushpush is public, should be declared in a file named Pushpush.java public class Pushpush { ^ 1 error
s058814948
p03673
Java
import java.util.Scanner; import java.util.Stack; public class Pushpush { public static void main(String[] args) { Scanner input = new Scanner(System.in); int count = input.nextInt(); int[] num = new int[count]; for(int i = 0; i < count; i++) { num[i] = input.nextInt(); } Stack<Integer> stack = new ...
Main.java:39: error: reached end of file while parsing } ^ 1 error
s323341448
p03673
C++
#include<bits/stdc++.h> #define rep(i,a,n) for (int i = a;i < n;i++) using namespace std; int main() { int a; deque<int> some; int n; cin >> n; for (int i = 0; i < n; i++) { cin >> a; if (i % 2 == n % 2) { some.push_back(a); } else { some.push_front(a); ...
a.cc: In function 'int main()': a.cc:19:2: error: expected '}' at end of input 19 | } | ^ a.cc:5:12: note: to match this '{' 5 | int main() { | ^
s859033726
p03673
C++
6 0 6 7 6 7 0
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 6 | ^
s264280501
p03673
C++
#include <iostream> #include <vector> #include <string> using namespace std; int main(void) { int n; cin >> n; int x[200001]; vector <int> y; for (int i = 0; i < n; i++) { cin >> x[i]; } for (int i = 0; i < n; i++) { y.push_back(x[i]); reverse(y.begin(), y.end()); } for (int i = 0; i < n - 1; i++) cou...
a.cc: In function 'int main()': a.cc:16:17: error: 'reverse' was not declared in this scope 16 | reverse(y.begin(), y.end()); | ^~~~~~~
s381096551
p03673
C++
#include <iostream> #include <vector> #include <string> using namespace std; int main(void) { int n; scanf("%d", &n); int x[200001]; vector <int> y; for (int i = 0; i < n; i++) { cin >> x[i]; } for (int i = 0; i < n; i++) { y.push_back(x[i]); reverse(y.begin(), y.end()); } for (int i = 0; i < n - 1; i++...
a.cc: In function 'int main()': a.cc:16:17: error: 'reverse' was not declared in this scope 16 | reverse(y.begin(), y.end()); | ^~~~~~~ a.cc:22:18: error: expected '}' at end of input 22 | return 0; | ^ a.cc:6:16: note: to match this '{' 6 |...
s669341227
p03673
C++
#include <iostream> #include <vector> #include <string> using namespace std; int main(void) { int n; scanf("%d", &n); int x[200001]; vector <int> y; for (int i = 0; i < n; i++) { cin >> x[i]; } for (int i = 0; i < n; i++) { y.push_back(x[i]); reverse(y.begin(), y.end()); } for (int i = 0; i < n - 1; i++...
a.cc: In function 'int main()': a.cc:16:17: error: 'reverse' was not declared in this scope 16 | reverse(y.begin(), y.end()); | ^~~~~~~ a.cc:22:18: error: expected '}' at end of input 22 | return 0; | ^ a.cc:6:16: note: to match this '{' 6 |...
s961440271
p03673
C++
#define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <vector> #include <string> using namespace std; int main(void) { int n; scanf("%d", &n); int x; vector <int> y; for (int i = 0; i < n; i++) { scanf("%d", &x); y.push_back(x); reverse(y.begin(), y.end()); } for (int i = 0; i < n - 1; i++) cout ...
a.cc: In function 'int main()': a.cc:15:17: error: 'reverse' was not declared in this scope 15 | reverse(y.begin(), y.end()); | ^~~~~~~
s171966582
p03673
C++
#include <iostream> #include <vector> #include <string> using namespace std; int main() { int n; cin >> n; long long int x; vector <long long int> str; for (int i = 0; i < n; i++) { cin >> x; str.push_back(x); reverse(str.begin(), str.end()); } for (int i = 0; i < n - 1; i++) cout << str[i] << " "; cou...
a.cc: In function 'int main()': a.cc:14:17: error: 'reverse' was not declared in this scope 14 | reverse(str.begin(), str.end()); | ^~~~~~~
s507570901
p03673
C++
#include <iostream> #include <vector> using namespace std; int main() { int n; cin >> n; long long int x; vector <long long int> str; for (int i = 0; i < n; i++) { cin >> x; str.push_back(x); reverse(str.begin(), str.end()); } for (int i = 0; i < n - 1; i++) cout << str[i] << " "; cout << str[n - 1] <<...
a.cc: In function 'int main()': a.cc:13:17: error: 'reverse' was not declared in this scope 13 | reverse(str.begin(), str.end()); | ^~~~~~~
s798578024
p03673
C++
#include<iostream> #include<string> #include<vector> using namespace std; #define REP(i, n) for(int i=0; i<n; i++) int n; string s[200000]; int main(){ cin >> n; REP(i, n){ string t; cin >> t; s[i] = t; } string o = s[0]; for(int i=1; i<n; i++){ if(i%2==0){ ...
a.cc: In function 'int main()': a.cc:28:28: error: 'reverse' was not declared in this scope 28 | if(n!=1 && (n-1)%2==0) reverse(o.begin(), o.end()); | ^~~~~~~
s292233132
p03673
C++
#include <iostream> #include <deque> using namespace std; int main(){ int n, a; deque<int> dp; cin >> n; for(int i = 0; i < n; i++){ cin >> a; if(i % 2 == (n-1) % 2) dp.push_front(a); else dp.push_back(a); } for(int i = 0; i < n; i++){ cout << v[i] << ((i == n-1) ? "\n" : " "); } retu...
a.cc: In function 'int main()': a.cc:17:13: error: 'v' was not declared in this scope 17 | cout << v[i] << ((i == n-1) ? "\n" : " "); | ^
s361668648
p03673
C++
#include<stdio.h> int array [512345]; int a [212345]; int main () { int n; scanf ("%d", &n); for (int i=0; i<n; ++i) scanf ("%d", &a[i]) ; int left =212345 , right = left +1; for (int i=0; i<n; ++i){ if(i%2 == (n -1) %2) { array [left - -]=a[i]; } else { array [ right ++]= a[i]; } } for (int i= left +1; ...
a.cc: In function 'int main()': a.cc:14:17: error: expected primary-expression before ']' token 14 | array [left - -]=a[i]; | ^
s661942141
p03673
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n,a; deque<int>sort; cin >> n; for(int i = 0; i < n; i++){ cin >> a; if(i % 2 == n % 2){ sort.push_back(a); }else{ sort.push_front(a); } } cout << sort << endl; return 0; }
a.cc: In function 'int main()': a.cc:16:8: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::deque<int>') 16 | cout << sort << endl; | ~~~~ ^~ ~~~~ | | | | | std::deque<int> | std::ostream {aka std::basic_ostrea...
s517950733
p03673
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n,a; deque<int>sort; cin >> n; for(int i = 0; i < n; i++){ cin >> a; if(i % 2 == n % 2){ sort.push_back(a); }else{ sort.push_front(a); } } cout << x << endl; return 0; }
a.cc: In function 'int main()': a.cc:16:11: error: 'x' was not declared in this scope 16 | cout << x << endl; | ^
s470132720
p03673
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n,a; deque<int>sort; cin >> n; for(int i = 0; i < n; i++){ cin >> a; if(i % 2 == n % 2){ sort.push_back(a); }else{ sort.push_front(a); } } for(int x:some){ cout << x << endl; } return 0; }
a.cc: In function 'int main()': a.cc:16:13: error: 'some' was not declared in this scope 16 | for(int x:some){ | ^~~~
s629427369
p03673
C++
#include <iostream> #include <algorithm> #include <cstring> #include <cstdio> #include <vector> #include <cstdlib> #include <iomanip> #include <cmath> #include <ctime> #include <map> #include <set> #include <queue> #include <stack> using namespace std; #define lowbit(x) (x&(-x)) #define max(x,y) (x>y?x:y) #define min(x...
a.cc: In function 'int main()': a.cc:35:16: error: 'n' was not declared in this scope 35 | while(cin>>n){ | ^
s099817517
p03673
C++
#include <stdio.h> #include <iostream> #include <sstream> #include <algorithm> #define FOR(x, y, z) for(int x = (z); y; x++) #define rep(x, y) for(int x = 0; x < (y); x++) #define all(x) x.begin(), x.end() #define len(x) (sizeof(x) / sizeof(x[0])) #define split_str(str, sp_word) istringstream stream(str); string res; w...
a.cc: In function 'int main()': a.cc:21:2: error: 'vector' was not declared in this scope 21 | vector<int> ary; | ^~~~~~ a.cc:5:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 4 | #include <algorithm> +++ |+#include <vector> 5 | #define...
s610583738
p03673
Java
import java.util.ArrayDeque; import java.util.Iterator; import java.util.Scanner; // Java8 public class sample { static Scanner sc = new Scanner(System.in); public static void main(String[] args) throws Exception { new sample().run(); } void run() { int n = sc.nextInt(); ArrayDeque<Integer> deq = new Arr...
Main.java:6: error: class sample is public, should be declared in a file named sample.java public class sample ^ 1 error
s351508211
p03673
Java
import java.util.Scanner; public class Main3 { public static void main(String[] args) { Scanner s = new Scanner(System.in); int n = s.nextInt(); Scanner scan = new Scanner(System.in); String str = ""; String ans = ""; String temp = ""; for(int i = 0;i < n; i++){ str = str + scan.next(); } for(int...
Main.java:3: error: class Main3 is public, should be declared in a file named Main3.java public class Main3 { ^ 1 error
s657023472
p03673
C++
#include <stdio.h> #include<string.h> int a[200001]; int main(){ int n; scanf("%d", &n); int a[n]; for(int i=0; i < n; i++){ scanf("%d", &a[i]); } for(int i=n-1; i>=0, i-=2){ printf("%d", a[i]); } if(n%2! = 0){ for(int i=2; i <= n; i+=2){ printf("%d", a[i]); }else{ ...
a.cc: In function 'int main()': a.cc:16:28: error: expected ';' before ')' token 16 | for(int i=n-1; i>=0, i-=2){ | ^ | ; a.cc:20:9: error: expected ')' before '!' token 20 | if(n%2! = 0){ | ~ ^ | ) a.cc:23:7: error: e...
s890334047
p03673
C++
#include <iostream> #include <vector> #include <string> #include <limits.h> using namespace std; int main(void) { int N; cin >> N; vector<int> v; for (int i = 0; i < N; ++i) { cin >> v[i]; reverse(v.begin(), v.end()); } for (auto i : v) { ...
a.cc: In function 'int main()': a.cc:19:9: error: 'reverse' was not declared in this scope 19 | reverse(v.begin(), v.end()); | ^~~~~~~
s507067692
p03673
C
#include <stdio.h> int main(void) { int n,j; scanf("%d", &n); int a[n]; j =n; for (int i = 0; i < n; i++) { scanf("%d", &a[i]); j = 0; while (j =! i) { a[j] = a[i-j]; j++; } } for (int c = 0; c < n; c++) { printf("%d ",a[c]...
main.c: In function 'main': main.c:20:13: error: expected ';' before '}' token 20 | return 0 | ^ | ; ...... 23 | } | ~ main.c: At top level: main.c:29:5: error: expected identifier or '(' before '}' token 29 | } | ^
s817890047
p03673
C
#include <stdio.h> int a[200001]; int main(){ int n,i; scanf("%d",&n); for(i=0;i<n;i++)scanf("%d",&a[i]); i=0; if(n>1){ for(i=n-1;i>=0;i-=2)printf("%d ",a[i]); i=(i==-1)?0:1; for(;i<n-2;i+=2)printf("%d ",a[i]); } printf("%d\n",a[i]); r
main.c: In function 'main': main.c:14:3: error: 'r' undeclared (first use in this function) 14 | r | ^ main.c:14:3: note: each undeclared identifier is reported only once for each function it appears in main.c:14:4: error: expected ';' at end of input 14 | r | ^ | ; main.c:14:3: erro...
s310191998
p03673
C++
#include<iostream> #include<deque> using namespace std; int main(){ int a; deque<int>some; int n; for(int i=0;i<n;i++){ cin>>a; if(i%2==n%2){ some.push_back(a); } else{ some.push=back(a); } } for(int x:some){ cout<<x<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:14:30: error: 'class std::deque<int>' has no member named 'push' 14 | some.push=back(a); | ^~~~ a.cc:14:35: error: 'back' was not declared in this scope 14 | some.push=back(a); | ...
s436701292
p03673
C++
> #include<vector> #include<algorithm> #include<string> #include<deque> using namespace std; int main() { int a; deque<int> b; int n; cin >> n; for (int i = 0; i < n; i++) { cin >> a; if (i % 2 == n % 2) { b.push_back(a); } else { b.push_front(a); } } for (int i : b) { cout << i << " "; } ...
a.cc:1:1: error: expected unqualified-id before '>' token 1 | > | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/vector:62, from a.cc:2: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_nu...
s127745630
p03673
C++
#include <bits/stdc++.h> using namespace std; list<int> ans; int n; int x; int main() { scanf("%d" , &n); bool flag = 0; if(n & 1) flag = 0; else flag = 1; for(int i = 1 ; i <= n ; ++i) { scanf("%d" , &x); if(flag) { ans.push_back(x); flag = !flag; //printf("flag1:%d" , flag); } else { ...
a.cc: In function 'int main()': a.cc:36:10: error: expected '}' at end of input 36 | } | ^ a.cc:9:1: note: to match this '{' 9 | { | ^
s098720122
p03673
C++
#include <bits/stdc++.h> using namespace std; list<int> ans; int n; int x; int main() { scanf("%d" , &n); bool flag = 0; if(n & 1) flag = 0; else flag = 1; for(int i = 1 ; i <= n ; ++i) { scanf("%d" , &x); if(flag) { ans.push_back(x); flag = !flag; //printf("flag1:%d" , flag); } else { ...
a.cc: In function 'int main()': a.cc:36:10: error: expected '}' at end of input 36 | } | ^ a.cc:9:1: note: to match this '{' 9 | { | ^
s117124366
p03673
C++
#include<cstdio> #include<iostream> using namespace std; int main(){ long long int i,j,a[200000],b[200000],temp[200000],n; cin>>n; for(i=0;i<n;i++) cin>>a[i]; i=0; while(1){ if(i==n)break b[i]=a[i]; for(j=0;j<=i;j++)temp[j]=b[j]; for(j=i;j>=0;j--)b[i-j]=temp[j]; i++; } for(i=0;i<n-1;i++) cout<<b[i]<<' ...
a.cc: In function 'int main()': a.cc:10:30: error: expected ';' before 'b' 10 | if(i==n)break | ^ | ; 11 | b[i]=a[i]; | ~
s257740304
p03673
C++
//AtCoder Beginner Contest 066 C #include <iostream> #include <string> #include <deque> using namespace std; int main() { int n; cin >> n; int a[200010]; for (int i = 0; i < n; i++) { scanf_s("%d",&a[i]); } deque<int>que; int flag = 0; if (a[n-1] % 2 == 0) {//最後が偶数なら偶数はすべて前に挿入 flag = 1; } for (int ...
a.cc: In function 'int main()': a.cc:16:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 16 | scanf_s("%d",&a[i]); | ^~~~~~~ | scanf
s267182122
p03673
C++
#include <bits/stdc++.h> //#ifdef MYDEBUG #define debug(x) cout<<#x<<": "<<x<<endl #define ifcin(x) std::ifstream cin(x) #else #define debug(x) #define ifcin(x) #endif #define ll long long #define esp 1e-14 #define all(x) x.begin(),x.end() #define rep(i,from,to) for(int i=from;i<to;++i) #define REP(i,from,to) for(int i...
a.cc:5:2: error: #else without #if 5 | #else | ^~~~ a.cc:6:9: warning: "debug" redefined 6 | #define debug(x) | ^~~~~ a.cc:3:9: note: this is the location of the previous definition 3 | #define debug(x) cout<<#x<<": "<<x<<endl | ^~~~~ a.cc:7:9: warning: "ifcin" redefined ...
s619757431
p03673
C++
#include <iostream> #include <vector> using namespace std; int main() { int n; cin >> n; vector<int> a, b; for (int i = 0; i < n; i++) { int stdin; cin >> stdin; a.push_back(stdin); } for (int i = 0; i < n; i++) { b.push_back(a[i]); reverse(b.begin(), b.end()); } for (int i = 0; i <...
a.cc: In function 'int main()': a.cc:17:5: error: 'reverse' was not declared in this scope 17 | reverse(b.begin(), b.end()); | ^~~~~~~
s764536868
p03673
C++
import Data.Maybe import qualified Data.ByteString.Char8 as B main=putStrLn.unwords.map show.solve.map (fst.fromJust.B.readInt).B.words=<<B.getContents solve (n:as) |odd n=reverse a1s++a2s |otherwise=reverse a2s++a1s where (a1s,a2s)=(f odd&&&f even)as f g=map snd.filter (g.fst).zip [1..]
a.cc:8:33: error: too many decimal points in number 8 | f g=map snd.filter (g.fst).zip [1..] | ^~~ a.cc:1:1: error: 'import' does not name a type 1 | import Data.Maybe | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
s375879703
p03673
C++
#include <iostream> #include <queue> #include <stack> #include <string> #include <set> #include <map> #include <cctype> #include <deque> #define rep(i,a,b) for(int i=a; i<b; i++) #define rrep(i,a,b) for(int i=a; i>=b; i--) using namespace std; int main(){ deque<int> dq; int n,a; cin>>n; rep(i,0,n){ ...
a.cc: In function 'int main()': a.cc:26:9: error: 'reverse' was not declared in this scope 26 | reverse(dq.begin(),dq.end()); | ^~~~~~~
s202065333
p03673
C++
#include <iostream> #include <queue> #include <stack> #include <string> #include <set> #include <map> #include <cctype> #include <deque> #define rep(i,a,b) for(int i=a; i<b; i++) #define rrep(i,a,b) for(int i=a; i>=b; i--) using namespace std; int main(){ deque<int> dq={}; int n,a; cin>>n; rep(i,0,n){...
a.cc: In function 'int main()': a.cc:27:9: error: 'reverse' was not declared in this scope 27 | reverse(dq.begin(),dq.end()); | ^~~~~~~
s359826780
p03673
C++
#include <stdio.h> #include <stdlib.h> int main() { int *S,*T; int i,n,j,t; scanf("%d",&n); S=malloc(sizeof(int)*n); T=malloc(sizeof(int)*n); for(i=0;i<n;i++) scanf("%d",&S[i]); for(i=0;i<n;i++){ T[i]=S[i]; for(j=0;j<((i+1)/2);j++){ t=T[j]; T[j]=T[i-j]; T[i-j]=t; } } for(i=0;i<n;i++) printf(...
a.cc: In function 'int main()': a.cc:8:17: error: invalid conversion from 'void*' to 'int*' [-fpermissive] 8 | S=malloc(sizeof(int)*n); | ~~~~~~^~~~~~~~~~~~~~~ | | | void* a.cc:9:17: error: invalid conversion from 'void*' to 'int*' [-fpermissive] ...