criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
  int n, m, x, y;
  cin >> n >> m >> x >> y;
  int x[n], y[m];
  for(int i = 0; i < n; i++) cin >> x[i];
  for(int i = 0; i < m; i++) cin >> y[i];
  for(int z = x + 1; z <= y; z++){
    bool flag = true;
    for(int i = 0; i < n; i++) if(x[i] >= z) flag = false;
    for(int i = 0; i < m; i++) if(y[i] < z) flag = false;
    if(flag){
      cout << "No War" << endl;
      return 0;
    }
  }
  cout << "War" << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: conflicting declaration 'int x [n]'
    7 |   int x[n], y[m];
      |       ^
a.cc:5:13: note: previous declaration as 'int x'
    5 |   int n, m, x, y;
      |             ^
a.cc:7:13: error: conflicting declaration 'int y [m]'
    7 |   int x[n], y[m];
      |             ^
a.cc:5:16: note: previous declaration as 'int y'
    5 |   int n, m, x, y;
      |                ^
a.cc:8:38: error: invalid types 'int[int]' for array subscript
    8 |   for(int i = 0; i < n; i++) cin >> x[i];
      |                                      ^
a.cc:9:38: error: invalid types 'int[int]' for array subscript
    9 |   for(int i = 0; i < m; i++) cin >> y[i];
      |                                      ^
a.cc:12:36: error: invalid types 'int[int]' for array subscript
   12 |     for(int i = 0; i < n; i++) if(x[i] >= z) flag = false;
      |                                    ^
a.cc:13:36: error: invalid types 'int[int]' for array subscript
   13 |     for(int i = 0; i < m; i++) if(y[i] < z) flag = false;
      |                                    ^
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main(void){
    //使用する変数の定義
    int N, M;
    int X, Y;

    //N, M, X, Y を受け取る
    cin >> N >> M;
    cin >> X >> Y;

    //vector x を受け取り，昇順にソート
    vector<int> x(N);
    for(int i = 0; i < N; i++){
        cin >> x.at(i);
    }
    sort(x.begin(), x.end());

    //vector y を受け取り，昇順にソート
    vector<int> y(M);
    for(int i = 0; i < M; i++){
        cin >> y.at(i);
    }
    sort(y.begin(), y.end());

    //戦争が勃発するか否かのフラグ
    //初めは戦争が勃発する世界線
    bool isWarHappenFlag = true;

    for(int z = X+1; z <= Y; z++){
        if(z <= x.back()){
            continue;
        } else if(z > y.front()){
            continue;
        } else {
            isWarHappenFlag = false;
            break;
        }
    }
    if(isWarHappenFlag){
        cout << "War" << endl;
    } else {
        cout << "No War" << endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   20 |     sort(x.begin(), x.end());
      |     ^~~~
      |     short
Language: C++


#include<stdio.h> main() {  int n, m, x, y, a, b, p, q;  scanf("%d%d%d%d", &n, &m, &x, &y);  p=-300;  while (n--)  {   scanf("%d", &a);   if (a>p)   {    p=a;   }  }  q=300;  while (m--)  {   scanf("%d", &b);   if (b<q)   {    q=b;   }  }  if (q>p && p>x && q<=y)  {   printf("No War\n");  }  else  {   printf("War\n");  }  return 0; }

Compiler output:
a.cc:2:19: warning: extra tokens at end of #include directive
    2 | #include<stdio.h> main() {  int n, m, x, y, a, b, p, q;  scanf("%d%d%d%d", &n, &m, &x, &y);  p=-300;  while (n--)  {   scanf("%d", &a);   if (a>p)   {    p=a;   }  }  q=300;  while (m--)  {   scanf("%d", &b);   if (b<q)   {    q=b;   }  }  if (q>p && p>x && q<=y)  {   printf("No War\n");  }  else  {   printf("War\n");  }  return 0; }
      |                   ^~~~
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>

using namespace std;

int main() {
    int n, m >> x >> y;
    cin >> n >> m;
    
    for (int i = 0; i < n; i++) {
        int x1;
        cin >> x1;
        if (x1 > x) {
            x = x1;
        }
    }
    for (int i = 0; i < m; i++) {
        int y1;
        cin >> y1;
        if (y1 < y) {
            y = y1;
        }
    }
    
    if (x < y) {
        cout << "No War" << endl;
    } else {
        cout << "War" << endl;
    }
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:14: error: expected initializer before '>>' token
    6 |     int n, m >> x >> y;
      |              ^~
a.cc:7:17: error: 'm' was not declared in this scope
    7 |     cin >> n >> m;
      |                 ^
a.cc:12:18: error: 'x' was not declared in this scope; did you mean 'x1'?
   12 |         if (x1 > x) {
      |                  ^
      |                  x1
a.cc:19:18: error: 'y' was not declared in this scope; did you mean 'y1'?
   19 |         if (y1 < y) {
      |                  ^
      |                  y1
a.cc:24:9: error: 'x' was not declared in this scope
   24 |     if (x < y) {
      |         ^
a.cc:24:13: error: 'y' was not declared in this scope
   24 |     if (x < y) {
      |             ^
Language: C++

#include <iostream>
using namespace std;
int main(){
	int ans=0;
	int N=0;
	int M=0;
	int X=0;l
	int Y=0;
	int x[101];
	int y[101];
	int i=0;
	int max=0;
	int min=0;
	
	cin>>N>>M>>X>>Y;
	max=-100;
if(max<X)max=X;
	for(i=0;i<N;i++){
		cin>>x[i];
		if(max<x[i])max=x[i];
	}
	min=100;
if(min>Y)min=Y;
	for(i=0;i<M;i++){
		cin>>y[i];
		if(min>y[i])min=y[i];
}

	if(max<min && X<Y){
	cout<<"No War"<<endl;
	}else{
		cout<<"War"<<endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: 'l' was not declared in this scope
    7 |         int X=0;l
      |                 ^
a.cc:15:23: error: 'Y' was not declared in this scope
   15 |         cin>>N>>M>>X>>Y;
      |                       ^
Language: C++

#include<iostream>
using namespace std;


int main()
{
    int N,M,X,Y;
    cin>>n>>M>>X>>Y;
    int min_x=101,max_x=-101,min_y=101,max_y=-101,n,i;
    for(i=0; i<N; i++){
        cin>>n;
        if(max_x<=n){
            max_x=n;
        }
    }
    for(i=0; i<M; i++){
        cin>>n;
        if(min_y>=n){
            min_y=n;
        }
    }
    if(max_x+1<min_y){cout<<"No war"<<endl;}
    else { cout<<"War"<<endl;}

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:10: error: 'n' was not declared in this scope
    8 |     cin>>n>>M>>X>>Y;
      |          ^
Language: C

#include<stdio.h>
int main(void){
  int N,M,X,Y;
  int axisX[101];
  int axisY[101];
  int i;
  int j;
  int ch;
  scanf("%d,%d,%d,%d",&N,&M,&X,&Y);
  for(i = 0; (i < 100) && ((ch = getchar()) != EOF) && (ch != '\0'); i++){
    axisX[i] = ch;
  }
  for(j = 0; (j < 100) && ((ch = getchar()) != EOF) && (ch != '\0'); j++){
    axisY[j] = ch;
  }
  
  for(int a=0; a < i; a++){
    for(int b=0; b<j; b++){
      if(axisX[b] < axisY[a]){
        printf("War\n");
        break;
      }
            if(axisX[b] < axisY[a]){
        printf("War\n");
        break;
    }
  }
  
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:30:1: error: expected declaration or statement at end of input
   30 | }
      | ^
Language: C++

#include<stdio.h>

int main(){
  int N,M,i,j,temp,len;
  signed int X,Y;
  scanf("%d %d %d %d",&N,&M,&X,&Y);
  signed int x[N],y[M],num,safezone1[];
  for(i=0;i<N;i++){
    scanf("%d",&x[i]);
  }
  for(i=0;i<M;i++){
    scanf("%d",&y[i]);
  }
  

    for(j=0;j<N;j++){
      for(i=0;i<N;i++){
        if(x[i]<x[i+1]){
          temp = x[i];
          x[i] = x[i+1];
          x[i+1] = temp;
        }
      } 
    }
    
    for(j=0;j<M;j++){
      for(i=0;i<M;i++){
        if(y[i]<y[i+1]){
          temp = y[i];
          y[i] = y[i+1];
          y[i+1] = temp;
        }
      } 
    }
  len = sizeof(y)/sizeof(int);

  if(x[0]<y[len-1]){
    num = y[len-1] - x[0];
    signed int safezone1[num];
    for(i=0;i<num;i++){
      safezone1[i] = x[0]+i+1;
    }
    for(i=0;i<num;i++){
      if(X<safezone1[i]<=Y){
        j++;
      }
    }
    if(j>0){
        printf("No War");
        return 0;
    }else{
      printf("War");
      return 0;
    }
    //printf("%d %d",x[0],y[len-1]);
  }else{
    printf("War");
    return 0;
  }

  /*
  printf("%d",len);
  printf("%d%d%d%d\n",N,M,X,Y);
  for(i=0;i<N;i++){
    printf("%d",x[i]);
  }
  printf("\n");
  for(i=0;i<M;i++){
    printf("%d",y[i]);
  }
  */
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:28: error: storage size of 'safezone1' isn't known
    7 |   signed int x[N],y[M],num,safezone1[];
      |                            ^~~~~~~~~
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
using namespace std;

int a[205];
int b[205];

int main() {
    int x, y, n, m;
    cin >> n >> m >> x >> y;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    for (int i = 0; i < m; i++) {
        cin >> b[i];
    }
    int w = b[0];
    int i =0 ;
   
    
    int z = 0;
    for (int i = 0; i < n; i++) {

        if (z <= a[i]&&y>a[i]>x) {
            z = a[i];
        }
    }
    for (int i = 0; i < m; i++) {

        if (w >= b[i]&&b[i]<=y) {
            w = b[i];
        }
    }
 if (w>y&&z=0) {
        cout << "No War" << endl;
    }
  else if(z<x&&y>w){
    cout << "No War" << endl;
  }
    else if (w>z&&w - z !=0) {
        if (x<z&&y>=w) {
            cout << "No War" << endl;
        }
        else cout << "War" << endl;
    }
  
    else cout << "War" << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:9: error: lvalue required as left operand of assignment
   35 |  if (w>y&&z=0) {
      |      ~~~^~~
Language: C++

#include<iostream>
#include<vector>
using namespace std;
int main(){
    int N,M,X,Y;
    cin>>N>>M>>X>>Y;
    int XY=0;
    XY=(X+Y)/2 + 1;
    bool flag1=false,flag2=false,flag3=false;
    if(X>Y)continue;
    if(X<XY&&XY<=Y) flag3=true;
    vector<int> NN;
    for(int i=0;i<=N;i++){
        int o;
        cin>>o;
        NN.push_back(o);
        if(NN[i]<XY) flag1=true;
        else break;
    }
        vector<int> MM;
    for(int i=0;i<=M;i++){
        int p;
        cin>>p;
        MM.push_back(p);
        if(MM[i]>=XY) flag2=true;
        else break;
    }
    if(flag1&&flag2&&flag3)cout<<"No War"<<endl;
    else  cout<<"War"<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:12: error: continue statement not within a loop
   10 |     if(X>Y)continue;
      |            ^~~~~~~~
Language: C++

#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int main(){
  int n,m,x,y,xpos[105],ypos[105];
  bool xflg,yflg;
  scanf("%d %d %d %d",&n,&m,&x,&y);
  for(int i=0;i<n;i++){
    scanf("%d",&xpos[i]);
  }
  for(int i=0;i<m;i++){
    scanf("%d",&ypos[i]);
  }
  for(int z=x+1;z<=y;z++){
    xflg=false;
    yflg=false;
    for(int i=0;i<n;i++){
      if(z<=xpos[i]) break;
      if(i==n-1) xflg=true;
    }
    for(int i=0;i<m;i++){
      if(z>ypos

Compiler output:
a.cc: In function 'int main()':
a.cc:23:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   23 |       if(z>ypos
      |          ~^~~~~
a.cc:23:16: error: expected ')' at end of input
   23 |       if(z>ypos
      |         ~      ^
      |                )
a.cc:23:16: error: expected statement at end of input
a.cc:23:16: error: expected '}' at end of input
a.cc:22:25: note: to match this '{'
   22 |     for(int i=0;i<m;i++){
      |                         ^
a.cc:23:16: error: expected '}' at end of input
   23 |       if(z>ypos
      |                ^
a.cc:15:26: note: to match this '{'
   15 |   for(int z=x+1;z<=y;z++){
      |                          ^
a.cc:23:16: error: expected '}' at end of input
   23 |       if(z>ypos
      |                ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C

#include<stdio.h>
int main(void){
 
int N,M,Xsyuto,Ysyuto,x[200],y[200],i,j,xmax,ymin;
int icchi=0; 
scanf("%d",&N);
scanf("%d",&M);
scanf("%d",&Xsyuto);
scanf("%d",&Ysyuto);
 
for(i=0;i<N;i++){
scanf("%d",&x[i]);
}
for(i=0;i<M;i++){
scanf("%d",&y[i]);
}
 
xmax=x[0];
for(i=0;i<N;i++){
if(xmax<x[i]){
xmax=x[i];
}
}
ymin=y[0];
for(i=0;i<M;i++){
if(ymin>=y[i]){
ymin=y[i];
}
}
 
if (Xsyuto >= Ysyuto){
printf("War");
} else {
if (xmax >= ymin){
printf("War");
} else {
for(j=0;j<M;j++){
for(i=0;i<N;i++){
if(x[i] == y[j]){
icchi = 1;
}
}
if (icchi == 1){
printf("War");
}
} else {
printf("No War");
}
 
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:46:3: error: 'else' without a previous 'if'
   46 | } else {
      |   ^~~~
main.c:51:1: error: expected declaration or statement at end of input
   51 | }
      | ^
main.c:51:1: error: expected declaration or statement at end of input
Language: C

#include<stdio.h>
int main(void){
 
int N,M,Xsyuto,Ysyuto,x[200],y[200],i,j,xmax,ymin;
int icchi=0; 
scanf("%d",&N);
scanf("%d",&M);
scanf("%d",&Xsyuto);
scanf("%d",&Ysyuto);
 
for(i=0;i<N;i++){
scanf("%d",&x[i]);
}
for(i=0;i<M;i++){
scanf("%d",&y[i]);
}
 
xmax=x[0];
for(i=0;i<N;i++){
if(xmax<x[i]){
xmax=x[i];
}
}
ymin=y[0];
for(i=0;i<M;i++){
if(ymin>=y[i]){
ymin=y[i];
}
}
 
if (Xsyuto >= Ysyuto){
printf("War");
} else {
if (xmax >= ymin){
printf("War");
} else {
for(j=0;j<M;j++){
for(i=0;i<N;i++){
if(x[i] == y[j]){
icchi = 1;
}
}
}
if (icchi == 1){
printf("War");
}
} else {
printf("No War");
}
 
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:47:3: error: 'else' without a previous 'if'
   47 | } else {
      |   ^~~~
main.c:52:1: error: expected declaration or statement at end of input
   52 | }
      | ^
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
using namespace std;

int a[205];
int b[205];

int main() {
    int x, y, n, m;
    cin >> n >> m >> x >> y;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    for (int i = 0; i < m; i++) {
        cin >> b[i];
    }
    int w = b[0];
    int i =0 ;
   
    
    int z = a[0];
    for (int i = 0; i < n; i++) {

        if (z <= a[i]&&a[i]>x) {
            z = a[i];
        }
    }
    for (int i = 0; i < m; i++) {

        if (w >= b[i]&&b[i]<=y) {
            w = b[i];
        }
    }
 
  else if(z<x&&y>w){
    cout << "No War" << endl;
  }
    else if (w>z&&w - z !=0) {
        if (x<z&&y>=w) {
            cout << "No War" << endl;
        }
        else cout << "War" << endl;
    }
  
    else cout << "War" << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:3: error: 'else' without a previous 'if'
   36 |   else if(z<x&&y>w){
      |   ^~~~
Language: C

#include<stdio.h>
int main(void){
 
int N,M,Xsyuto,Ysyuto,x[200],y[200],i,j,xmax,ymin;
int icchi=0; 
scanf("%d",&N);
scanf("%d",&M);
scanf("%d",&Xsyuto);
scanf("%d",&Ysyuto);
 
for(i=0;i<N;i++){
scanf("%d",&x[i]);
}
for(i=0;i<M;i++){
scanf("%d",&y[i]);
}
 
xmax=x[0];
for(i=0;i<N;i++){
if(xmax<x[i]){
xmax=x[i];
}
}
ymin=y[0];
for(i=0;i<M;i++){
if(ymin>=y[i]){
ymin=y[i];
}
}
 
if (Xsyuto >= Ysyuto){
printf("War");
} else {
if (xmax >= ymin){
printf("War");
} else {
for(j=0;j<M;j++){
for(i=0;i<N;i++){
if(x[i] == y[j]){
icchi = 1;
}
}
}
if (icchi == 1){
printf("War");
}
} else {
printf("No War");
}
}
}
 
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:47:3: error: 'else' without a previous 'if'
   47 | } else {
      |   ^~~~
main.c: At top level:
main.c:53:1: error: expected identifier or '(' before 'return'
   53 | return 0;
      | ^~~~~~
main.c:54:1: error: expected identifier or '(' before '}' token
   54 | }
      | ^
Language: C

#include<stdio.h>
int main(void){
 
int N,M,Xsyuto,Ysyuto,x[200],y[200],i,j,xmax,ymin;
int icchi=0; 
scanf("%d",&N);
scanf("%d",&M);
scanf("%d",&Xsyuto);
scanf("%d",&Ysyuto);
 
for(i=0;i<N;i++){
scanf("%d",&x[i]);
}
for(i=0;i<M;i++){
scanf("%d",&y[i]);
}
 
xmax=x[0];
for(i=0;i<N;i++){
if(xmax<x[i]){
xmax=x[i];
}
}
ymin=y[0];
for(i=0;i<M;i++){
if(ymin>=y[i]){
ymin=y[i];
}
}
 
if (Xsyuto >= Ysyuto){
printf("War");
} else {
if (xmax >= ymin){
printf("War");
} else {
for(j=0;j<M;j++){
for(i=0;i<N;i++){
if(x[i] == y[j]){
icchi = 1;
}
}
}
if (icchi == 1){
printf("War");
} else {
printf("No War");
}
}
 
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:52:1: error: expected declaration or statement at end of input
   52 | }
      | ^
Language: C

#include<stdio.h>
int main(void){
 
int N,M,Xsyuto,Ysyuto,x[200],y[200],i,j,xmax,ymin;
int icchi=0; 
scanf("%d",&N);
scanf("%d",&M);
scanf("%d",&Xsyuto);
scanf("%d",&Ysyuto);
 
for(i=0;i<N;i++){
scanf("%d",&x[i]);
}
for(i=0;i<M;i++){
scanf("%d",&y[i]);
}
 
xmax=x[0];
for(i=0;i<N;i++){
if(xmax<x[i]){
xmax=x[i];
}
}
ymin=y[0];
for(i=0;i<M;i++){
if(ymin>=y[i]){
ymin=y[i];
}
}
 
if (Xsyuto >= Ysyuto){
printf("War");
} else {
if (xmax >= ymin){
printf("War");
} else {
for(j=0;j<M;j++){
for(i=0;i<N;i++){
if(x[i] == y[j]){
icchi = 1;
}
}
}
if (icchi == 1){
printf("War");
}
} else {
printf("No War");
}
}
 
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:47:3: error: 'else' without a previous 'if'
   47 | } else {
      |   ^~~~
Language: C

#include<stdio.h>
int cmp(const void *a,const void *b)
{
    return *(int*)a - *(int*)b;
}
int main(void)
{
    int n,m,i,x[100],y[100],ans;
    scanf("%d %d %d %d",&n,&m,&x[0],&,y[0]);
    for(i=1;i<=n;i++){
        scanf("%d",&x[i]);
    }
    for(i=1;i<=m;i++){
        scanf("%d",&y[i]);
    }
    qsort(x,n+1,sizeof(int),cmp);
    qsort(y,m+1,sizeof(int),cmp);
    printf(x[n]>y[0]?'War':'No War');
    return 0;
  }

Compiler output:
main.c: In function 'main':
main.c:9:38: error: expected expression before ',' token
    9 |     scanf("%d %d %d %d",&n,&m,&x[0],&,y[0]);
      |                                      ^
main.c:16:5: error: implicit declaration of function 'qsort' [-Wimplicit-function-declaration]
   16 |     qsort(x,n+1,sizeof(int),cmp);
      |     ^~~~~
main.c:18:22: warning: multi-character character constant [-Wmultichar]
   18 |     printf(x[n]>y[0]?'War':'No War');
      |                      ^~~~~
main.c:18:28: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes
   18 |     printf(x[n]>y[0]?'War':'No War');
      |                            ^~~~~~~~
main.c:18:27: error: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion]
   18 |     printf(x[n]>y[0]?'War':'No War');
      |            ~~~~~~~~~~~~~~~^~~~~~~~~
      |                           |
      |                           int
In file included from main.c:1:
/usr/include/stdio.h:363:43: note: expected 'const char * restrict' but argument is of type 'int'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
Language: C++

#include <string>
#include<vector>
#include <algorithm>
using namespace std;
int a[114];
int b[514];
int iwa[11451430];
int main()
{
int n,m,x,y;
cin>>n>>m>>x>>y;
for(int i=0;i<n;i++){
    cin>>a[i];
}
for(int i=0;i<m;i++){
    cin>>b[i];
}
sort(a,a+n);
sort(b,b+m);
for(int i=0;i<11451419;i++){
    if((x<iwa[i])&&(y>=iwa[i])){
        iwa[i]=i; 
    }
    else{iwa[i]=114514;}
}
for(int i=0;i<11451419;i++){
    if(iwa[i]>a[n-1]){
        iwa[i]=i; 
    }
    else{iwa[i]=114514;}
}
for(int i=0;i<11451419;i++){
    if(iwa[i]<=b[0]){
        cout<<"No War"<<endl;return 0;
    }
}
cout<<"War"<<endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:1: error: 'cin' was not declared in this scope
   11 | cin>>n>>m>>x>>y;
      | ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #include <algorithm>
  +++ |+#include <iostream>
    4 | using namespace std;
a.cc:34:9: error: 'cout' was not declared in this scope
   34 |         cout<<"No War"<<endl;return 0;
      |         ^~~~
a.cc:34:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:34:25: error: 'endl' was not declared in this scope
   34 |         cout<<"No War"<<endl;return 0;
      |                         ^~~~
a.cc:4:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    3 | #include <algorithm>
  +++ |+#include <ostream>
    4 | using namespace std;
a.cc:37:1: error: 'cout' was not declared in this scope
   37 | cout<<"War"<<endl;
      | ^~~~
a.cc:37:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:37:14: error: 'endl' was not declared in this scope
   37 | cout<<"War"<<endl;
      |              ^~~~
a.cc:37:14: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

#include<iostream>
int main()
{
std::cout<<"War"<<endl;
return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:4:19: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    4 | std::cout<<"War"<<endl;
      |                   ^~~~
      |                   std::endl
In file included from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:5:10: error: expected '}' at end of input
    5 | return 0;
      |          ^
a.cc:3:1: note: to match this '{'
    3 | {
      | ^
Language: C

#include<stdio.h>

int main()
{
  int Nx=0,My=0,N=0,M=0,X=0,Y=0,ans=0;
  int Nmax=0,Mmin=0;
  scanf("%d%d%d%d",&N,&M,&X,&Y);
  
  scanf("%d",&Nmax);
  for(int i=1;i<N;i++)
  {
    scanf("%d",&Nx);
    if(Nmax < Nx)
    {
      Nmax = Nx;
    }
  }
  
  scanf("%d",&Mmin);
  for(int i=1;i<M;i++)
  {
    scanf("%d",&My);
    if(Mmin > My)
    {
      Mmin = My;
    }
  }
  
  for(int Z=X+1;Z<=Y;Z++)
  {
    if(Nmax < Z)
    {
      if(Mmax >= Z)
      {
        ans = 1;
      }
    }
  }
  
  if(ans = 1)
  {
    printf("No war\n");
  }else{
    printf("War\n");
  }
  
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:33:10: error: 'Mmax' undeclared (first use in this function); did you mean 'Nmax'?
   33 |       if(Mmax >= Z)
      |          ^~~~
      |          Nmax
main.c:33:10: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

int main()
{
  int Nx=0,My=0,N=0,M=0,X=0,Y=0,ans=0;
  int Nmax=0,Mmin=0;
  scanf("%d%d%d%d",&N,&M,&X,&Y);
  
  scanf("%d",&Nmax);
  for(int i=1;i<N;i++)
  {
    scanf("%d",&Nx);
    if(Nmax < Nx)
    {
      Nmax = Nx;
    }
  }
  
  scanf("%d",&Mmin);
  for(int i=1;i<M;i++)
  {
    scanf("%d",&My);
    if(Mmin > My)
    {
      Mmin = My;
    }
  }
  
  for(Z=X+1;Z<=Y;Z++)
  {
    if(Nmax < Z)
    {
      if(Mmax >= Z)
      {
        ans = 1;
      }
    }
  }
  
  if(ans = 1)
  {
    printf("No war\n");
  }else{
    printf("War\n");
  }
  
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:29:7: error: 'Z' undeclared (first use in this function)
   29 |   for(Z=X+1;Z<=Y;Z++)
      |       ^
main.c:29:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:33:10: error: 'Mmax' undeclared (first use in this function); did you mean 'Nmax'?
   33 |       if(Mmax >= Z)
      |          ^~~~
      |          Nmax
Language: C

#include<stdio.h>
#include<string.h>
#include<ctype.h>
#include<math.h>

void bubblesort(int a[],int N){
    for(int i=0; i<N-1; i++){
        for(int j=0; j<N-1; j++){
            if(a[j+1]>a[j]){
                int swap = a[j];
                a[j] = a[j+1];
                a[j+1] = swap;
            }
        }
    }
}

int main(void){
    int N,M,X,Y;
    scanf("%d%d%d%d",&N,&M,&X,&Y);

    int x[N], y[N];
    for(int i=0; i<N; i++){
    scanf("%d",&x[i]);
    }
    for(int i=0; i<M; i++){
    scanf("%d",&y[i]);
    }

    if((Y-X) <= 0){
        printf("War\n");
        return 0;
    }

    bubblesort(x,N);
    bubblesort(y,M);

    else if((y[M-1]-x[0]) <= 0){
            printf("War\n");
            return 0;
    }

    else if((Y-x[0]) <= 0 || (y[M-1]-X) <= 0){
        printf("War\n");
        return 0;
    }

    else {
        printf("No War\n");
        return 0;
    }
}

Compiler output:
main.c: In function 'main':
main.c:38:5: error: 'else' without a previous 'if'
   38 |     else if((y[M-1]-x[0]) <= 0){
      |     ^~~~
Language: C

#include<stdio.h>
int cmp(const void *a,const void *b)
{
    return *(int*)a - *(int*)b;
}
int main(void)
{
    int n,m,x,y,i,x[100],y[100],ans;
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%d",&x[i]);
    }
    for(i=0;i<n;i++){
        scanf("%d",&y[i]);
    }
    qsort(x,n,sizeof(int),cmp);
    qsort(y,n,sizeof(int),cmp);
    printf(x[n]<y[n]?'Yes':'No');
    return 0;
  }

Compiler output:
main.c: In function 'main':
main.c:8:19: error: conflicting types for 'x'; have 'int[100]'
    8 |     int n,m,x,y,i,x[100],y[100],ans;
      |                   ^
main.c:8:13: note: previous declaration of 'x' with type 'int'
    8 |     int n,m,x,y,i,x[100],y[100],ans;
      |             ^
main.c:8:26: error: conflicting types for 'y'; have 'int[100]'
    8 |     int n,m,x,y,i,x[100],y[100],ans;
      |                          ^
main.c:8:15: note: previous declaration of 'y' with type 'int'
    8 |     int n,m,x,y,i,x[100],y[100],ans;
      |               ^
main.c:16:5: error: implicit declaration of function 'qsort' [-Wimplicit-function-declaration]
   16 |     qsort(x,n,sizeof(int),cmp);
      |     ^~~~~
main.c:18:22: warning: multi-character character constant [-Wmultichar]
   18 |     printf(x[n]<y[n]?'Yes':'No');
      |                      ^~~~~
main.c:18:28: warning: multi-character character constant [-Wmultichar]
   18 |     printf(x[n]<y[n]?'Yes':'No');
      |                            ^~~~
Language: C

#include<stdio.h>
 
int main()
{
  int Nx[100],My[100],N=0,M=0,X=0,Y=0,ans=0;
  int Nmax=0,Mmin=0;
  scanf("%d%d%d%d",&N,&M,&X,&Y);
  
  scanf("%d",&Nx[0]);
  Nmax = Nx[0];
  for(int i=1;i<N;i++)
  {
    scanf("%d",&Nx[i]);
    if(Nmax < Nx[i])
    {
      Nmax = Nx[i];
    }
  }
  
  scanf("%d",&My[0]);
  Mmin = Mx[0];
  for(int i=1;i<M;i++)
  {
    scanf("%d",&My[i]);
    if(Mmin > Mx[i])
    {
      Mmin = Mx[i];
    }
  }
  
  for(Z=X+1;Z<=Y;Z++)
  {
    if(Nmax < Z)
    {
      if(Mmax >= Z)
      {
        ans = 1;
      }
    }
  }
  
  if(ans = 1)
  {
    printf("No war\n");
  }else{
    printf("War\n");
  }
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:21:10: error: 'Mx' undeclared (first use in this function); did you mean 'M'?
   21 |   Mmin = Mx[0];
      |          ^~
      |          M
main.c:21:10: note: each undeclared identifier is reported only once for each function it appears in
main.c:31:7: error: 'Z' undeclared (first use in this function)
   31 |   for(Z=X+1;Z<=Y;Z++)
      |       ^
main.c:35:10: error: 'Mmax' undeclared (first use in this function); did you mean 'Nmax'?
   35 |       if(Mmax >= Z)
      |          ^~~~
      |          Nmax
Language: C++

#include<iostream>
#include<stdio.h>
#include<string>
#include<vector>
#include<utility>
#include<algorithm>

#define loop while(1)
#define SZ(x) ((int)(x).size())
#define tep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define pushb push_back
#define popb pop_back

#define i64 long long int
#define veci vector<int> 
#define vveci vector<VI>
#define veci64 vector<i64>

#include<Windows.h>
using namespace std;

int main()
{
	int n, m, x, y;
	cin >> n >> m >> x >> y;
	veci xv, yv;
	int tm;
	int maxx = 0;
	tep(i, n) {
		cin >> tm;
		if (maxx < tm)maxx = tm;
		xv.pushb(tm);
	}
	int miny = 10000;
	tep(i, m) {
		cin >> tm;
		if (miny > tm)miny= tm;
		yv.pushb(tm);
	}

	for (int z = x+1; z <= y; z++) {
		if (maxx < z && miny >= z) {
			cout <<"No War" << endl;
			return 0;
		}
	}
	cout << "War" << endl;
	return 0;
}


Compiler output:
a.cc:19:9: fatal error: Windows.h: No such file or directory
   19 | #include<Windows.h>
      |         ^~~~~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>
 
int main()
{
  int Nx[100],My[100],N=0,M=0,X=0,Y=0,ans=0;
  int Nmax=0;Mmin=0;
  scanf("%d%d%d%d",&N,&M,&X,&Y);
  
  scanf("%d",&Nx[0]);
  Nmax = Nx[0];
  for(int i=1;i<N;i++)
  {
    scanf("%d",&Nx[i]);
    if(Nmax < Nx[i])
    {
      Nmax = Nx[i];
    }
  }
  
  scanf("%d",&My[0]);
  Mmin = Mx[0];
  for(int i=1;i<M;i++)
  {
    scanf("%d",&My[i]);
    if(Mmin > Mx[i])
    {
      Mmin = Mx[i];
    }
  }
  
  for(Z=X+1;Z<=Y;Z++)
  {
    if(Nmax < Z)
    {
      if(Mmax >= Z)
      {
        ans = 1;
      }
    }
  }
  
  if(ans = 1)
  {
    printf("No war\n");
  }else{
    printf("War\n");
  }
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:14: error: 'Mmin' undeclared (first use in this function)
    6 |   int Nmax=0;Mmin=0;
      |              ^~~~
main.c:6:14: note: each undeclared identifier is reported only once for each function it appears in
main.c:21:10: error: 'Mx' undeclared (first use in this function); did you mean 'M'?
   21 |   Mmin = Mx[0];
      |          ^~
      |          M
main.c:31:7: error: 'Z' undeclared (first use in this function)
   31 |   for(Z=X+1;Z<=Y;Z++)
      |       ^
main.c:35:10: error: 'Mmax' undeclared (first use in this function); did you mean 'Nmax'?
   35 |       if(Mmax >= Z)
      |          ^~~~
      |          Nmax
Language: C++

#include <iostream>
using namespace std;
 
int main() {
    int a, b, c, d;
  cin >> a >> b >> c >> d;
    int x1,x2, x3, x4;
  cin >> x1 >> x2 >> x3 >> x4;
  int y1, y2, y3;
  cin >> y1 >> y2 >> y3;
  
  if( c < d && c < x1 && c < x2 && c < x3 && c < x4 && y1 <= d && y2 <= d && y3 <= d &&){
  cout << "No War" <<endl;
  }else{
    cout << "War" << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:88: error: expected primary-expression before ')' token
   12 |   if( c < d && c < x1 && c < x2 && c < x3 && c < x4 && y1 <= d && y2 <= d && y3 <= d &&){
      |                                                                                        ^
Language: C

#include<stdio.h>
int main(void){

int N,M,Xsyuto,Ysyuto,x[200],y[200],i,j,xmax,ymin,kekka;

scanf("%d",&N);
scanf("%d",&M);
scanf("%d",&Xsyuto);
scanf("%d",&Ysyuto);

for(i=0;i<N;i++){
scanf("%d",&x[i]);
}
for(i=0;i<M;i++){
scanf("%d",&y[i]);
}

xmax=x[0];
for(i=0;i<N;i++){
if(xmax<x[i]){
xmax=x[i];
}
}
ymin=y[0];
for(i=0;i<M;i++){
if(ymin>=y[i]){
ymin=y[i];
}
}

if (Xsyuto >= Ysyuto){
printf("War");
} else {
if (xmax >= ymin){
printf("War");
} else {
printf("No War");
}

return 0;
}

Compiler output:
main.c: In function 'main':
main.c:41:1: error: expected declaration or statement at end of input
   41 | }
      | ^
Language: C++

#include <iostream>
using namespace std;
 
int main() {
    int a, b, c, d;
  cin >> a >> b >> c >> d;
    int x1,x2, x3, x4;
  cin >> x1 >> x2 >> x3 >> x4;
  int y1, y2, y3;
  cin >> y1 >> y2 >> y3;
  
  if( c < d && e < x1 && c < x2 && c < x3 && c < x4 && y1 <= d && y2 <= d && y3 <= d &&){
  cout << "No War" <<endl;
  }else{
    cout << "War" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:16: error: 'e' was not declared in this scope
   12 |   if( c < d && e < x1 && c < x2 && c < x3 && c < x4 && y1 <= d && y2 <= d && y3 <= d &&){
      |                ^
a.cc:12:88: error: expected primary-expression before ')' token
   12 |   if( c < d && e < x1 && c < x2 && c < x3 && c < x4 && y1 <= d && y2 <= d && y3 <= d &&){
      |                                                                                        ^
a.cc:16:2: error: expected '}' at end of input
   16 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include <iostream>
using namespace std;
 
int main() {
    int a, b, c, d;
  cin >> a >> b >> c >> d;
    int x1,x2, x3, x4;
  cin >> x1 >> x2 >> x3 >> x4;
  int y1, y2, y3;
  cin >> y1 >> y2 >> y3;
  
  if( e < d && e < x1 && e < x2 && e < x3 && e < x4 && y1 <= d && y2 <= d && y3 <= d &&){
  cout << No War <<endl;
  }else{
    cout << War << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:7: error: 'e' was not declared in this scope
   12 |   if( e < d && e < x1 && e < x2 && e < x3 && e < x4 && y1 <= d && y2 <= d && y3 <= d &&){
      |       ^
a.cc:12:88: error: expected primary-expression before ')' token
   12 |   if( e < d && e < x1 && e < x2 && e < x3 && e < x4 && y1 <= d && y2 <= d && y3 <= d &&){
      |                                                                                        ^
a.cc:13:11: error: 'No' was not declared in this scope
   13 |   cout << No War <<endl;
      |           ^~
a.cc:15:13: error: 'War' was not declared in this scope
   15 |     cout << War << endl;
      |             ^~~
a.cc:16:2: error: expected '}' at end of input
   16 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include <iostream>
using namespace std;

int main() {
    int a, b, c, d;
  cin >> a >> b >> c >> d;
    int x1,x2, x3, x4;
  cin >> x1 >> x2 >> x3 >> x4;
  int y1, y2, y3;
  cin y1 >> y2 >> y3;
  
  if( e < d && e < x1 && e < x2 && e < x3 && e < x4 && y1 <= d && y2 <= d && y3 <= d &&){
  cout << No War <<endl;
  }else{
    cout << War << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:6: error: expected ';' before 'y1'
   10 |   cin y1 >> y2 >> y3;
      |      ^~~
      |      ;
a.cc:12:7: error: 'e' was not declared in this scope
   12 |   if( e < d && e < x1 && e < x2 && e < x3 && e < x4 && y1 <= d && y2 <= d && y3 <= d &&){
      |       ^
a.cc:12:88: error: expected primary-expression before ')' token
   12 |   if( e < d && e < x1 && e < x2 && e < x3 && e < x4 && y1 <= d && y2 <= d && y3 <= d &&){
      |                                                                                        ^
a.cc:13:11: error: 'No' was not declared in this scope
   13 |   cout << No War <<endl;
      |           ^~
a.cc:15:13: error: 'War' was not declared in this scope
   15 |     cout << War << endl;
      |             ^~~
a.cc:16:2: error: expected '}' at end of input
   16 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n, m, x, y;
  cin >> n >> m >> x >> y;
  vector<int> X(n), Y(m);
  for(int &u : X) cin >> u;
  for(int &u : Y) cin >> u;
  sort(X.begin(), X.end());
  sort(Y.begin(), Y.end());
  reverse(X.begin(), X.end());
  for(int z = x + 1; z <= y; z++){
    if(x[0] < z && z <= y[0]){
      cout << "No ";
      break;
    }
  }
  cout << "War\n";
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: invalid types 'int[int]' for array subscript
   13 |     if(x[0] < z && z <= y[0]){
      |         ^
a.cc:13:26: error: invalid types 'int[int]' for array subscript
   13 |     if(x[0] < z && z <= y[0]){
      |                          ^
Language: C++

#include<bits/sdc++.h>
using namespace std;
int main(){
  int n, m, x, y;
  cin >> n >> m >> x >> y;
  vector<int> X(n), Y(m);
  for(int &u : X) cin >> u;
  for(int &u : Y) cin >> u;
  sort(X.begin(), X.end());
  sort(Y.begin(), Y.end());
  reverse(X.begin(), X.end());
  for(int z = x + 1; z <= y; z++){
    if(x[0] < z && z <= y[0]){
      cout << "No ";
      break;
    }
  }
  cout << "War\n";
  return 0;
}

Compiler output:
a.cc:1:9: fatal error: bits/sdc++.h: No such file or directory
    1 | #include<bits/sdc++.h>
      |         ^~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <string>
#include<vector>
#include <algorithm>
using namespace std;
int a[114];
int b[514];
int iwa[11451419];
int main()
{
int n,m,x,y;
cin>>n>>m>>x>>y;
for(int i=0;i<n;i++){
    cin>>a[n];
}
for(int i=0;i<m;i++){
    cin>>b[m];
}
sort(a,a+n);
sort(b,b+m);
for(int i=0;i<11451419;i++){
    if((x<iwa[i])&&(y>=iwa[i])&&(a[n]<iwa)){
        iwa[i]=i; 
    }
}
for(int i=0;i<11451419;i++){
    if(iwa[i]<=b[m]){
        cout<<"No War"<<endl;return 0;
    }
}
cout<<"War"<<endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:38: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   22 |     if((x<iwa[i])&&(y>=iwa[i])&&(a[n]<iwa)){
      |                                  ~~~~^~~~
Language: C++

#include <iostream>
#include <algorithm>

using namespace std;
int main() {
    //侵略したい年の数
    int nx = 0;
    int my = 0;
    int ans = 0;
    cin >> nx >> my;
    //首都及び侵略する座標の配列設定(個数は侵略とし＋首都)
    int x[nx + 1];
    int y[my + 1];
    //首都の座標入力
    cin >> x[0] >> y[0];

    if (nx != 1) {
        //侵略する座標入力
        for (int i = 1; i < nx + 1; ++i) {
            cin >> x[i];
        }
    }
    if (my != 1) {
        for (int j = 1; j < my + 1; ++j) {
            cin >> y[j];
        }
    }


    if (nx > my) {
        //x[i]が最大、y[i]が最小なので、x[i] < y[i]ならおｋ、x[i] >= y[i]だと重なる
        for (int k = 0; k < nx +1; ++k) {
            for (int i = 0; i < my +1; ++i) {
                if (x[k] >= y[i]) {
                    cout << "War";
                    ans = 1;
                    break;
                }
            }
        }
    } else {
        for (int k = 0; k < my +1; ++k) {
            for (int i = 0; i < nx +!; ++i) {
                if (x[k] >= y[i]) {
                    cout << "War";
                    ans = 1;
                    break;
                }
            }
        }
    }
    if (ans == 0){
        cout << "No War";
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:38: error: expected primary-expression before ';' token
   43 |             for (int i = 0; i < nx +!; ++i) {
      |                                      ^
Language: C++

#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
using namespace std;
typedef long long ll;
int main(void){
	int n,m,X,Y,i,ma=,mi=;
	cin>>n>>m>>X>>Y;
	int x,y;
	for(i=0;i<n;i++){
		cin>>x;
		if(i==0)ma=x;
		ma=max(ma,x);
	}
	for(i=0;i<m;i++){
		cin>>y;
		if(i==0)mi=y;
		mi=min(mi,y);
	}
	for(i=X+1;i<=Y;i++){
		if(ma<i&&mi>=i)cout<<"No ";
	}
	cout<<"War\n";
}
/*reveres begin end
cout<<"\n";
  m.insert(std::make_pair('c', 30));
*/


Compiler output:
a.cc: In function 'int main()':
a.cc:11:26: error: expected primary-expression before ',' token
   11 |         int n,m,X,Y,i,ma=,mi=;
      |                          ^
a.cc:21:25: error: 'mi' was not declared in this scope; did you mean 'ma'?
   21 |                 if(i==0)mi=y;
      |                         ^~
      |                         ma
a.cc:22:17: error: 'mi' was not declared in this scope; did you mean 'ma'?
   22 |                 mi=min(mi,y);
      |                 ^~
      |                 ma
a.cc:25:26: error: 'mi' was not declared in this scope; did you mean 'ma'?
   25 |                 if(ma<i&&mi>=i)cout<<"No ";
      |                          ^~
      |                          ma
Language: C++

#include <iostream>
using namespace std;

int main()
{
  int i,n,m,x,y;
  int x_max,y_min;
  
  cin>>n>>m>>x>>y;

  x_max=x;
  y_min=y;
  
  for(i=0;i<n;i++){
      cin>>kari;
      if(kari>x_max) x_max=kari;
    }

    for(i=0;i<m;i++){
      cin>>kari;
      if(kari<y_min) y_min=kari;

    }

    if(x_max<y_min) cout<<"No War"<<endl;
    else cout<<"War"<<endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:12: error: 'kari' was not declared in this scope
   15 |       cin>>kari;
      |            ^~~~
a.cc:20:12: error: 'kari' was not declared in this scope
   20 |       cin>>kari;
      |            ^~~~
Language: C++

//2018.09.23

#include <iostream>
#include <vector>
using namespace std;

int main() {

    int n,m,x,y;
    cin >> n >> m >> x >> y;

    vector<int> xi;
    vector<int> yi;
    int i,tmp;
    for(i=0;i<n;i++){
        cin >> tmp;
        xi.push_back(tmp);
    }
    for(i=0;i<m;i++){
        cin >> tmp;
        yi.push_back(tmp);
    }

    int maxv= *max_element(xi.begin(),xi.end());
    int minv= *min_element(yi.begin(),yi.end());

    maxv = max(maxv,x);
    minv = min(minv,x);

    if(maxv<minv) cout << "No War" << endl;
    else cout << "War" << endl;


    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:16: error: 'max_element' was not declared in this scope
   24 |     int maxv= *max_element(xi.begin(),xi.end());
      |                ^~~~~~~~~~~
a.cc:25:16: error: 'min_element' was not declared in this scope
   25 |     int minv= *min_element(yi.begin(),yi.end());
      |                ^~~~~~~~~~~
Language: C

#include <stdio.h>

int main(void)
{
	int n,m,x,y,X[101],Y[101],i,j,k,y,z=0,a=0,b=0;
	scanf("%d %d %d %d",&n,&m,&x,&y);
	for(i=0;i<n;i++){
		scanf("%d",&X[i]);
	}
	for(i=0;i<m;i++){
		scanf("%d",&Y[i]);
	}
	for(i=x+1;i<y+1;i++){
		for(j=0;j<n;j++){
			if(i<=X[j]){
				a=1;
			}
		}
		if(a==0){
			for(j=0;j<m;j++){
				if(i>Y[j]){
					z=1;
				}
			}
		}else{
			z=1;
		}
		if(z==0){
			b=1;
		}
		a=0;
		z=0;
	}
	if(b==1){
		printf("No War\n");
	}else{
		printf("War\n");
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:41: error: redeclaration of 'y' with no linkage
    5 |         int n,m,x,y,X[101],Y[101],i,j,k,y,z=0,a=0,b=0;
      |                                         ^
main.c:5:19: note: previous declaration of 'y' with type 'int'
    5 |         int n,m,x,y,X[101],Y[101],i,j,k,y,z=0,a=0,b=0;
      |                   ^
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;

int main()
{
	int n, m, x, y, b,count=0;
	vector<int> xx, yy;
	cin >> n >> m >> x >> y;
	for (int i = 0; i < n; i++)
	{
		cin >> b;
		xx.push_back(b);
	}
	for (int i = 0; i < m; i++)
	{
		cin >> b;
		yy.push_back(b);
	}
	sort(xx.rbegin(), xx.rend());
	sort(yy.begin(), yy.end());
	if (xx[0] < yy[0] && x < y)
	{
		for (int i = (xx[0] + 1); i < yy[0] + 1; i++)
		{
			if (x < i&&i <= y)
			{
				count=1
			}
		}
		if(count==1)
			cout << "No War";
		else
			cout << "War";
	}
	else
	{
		cout << "War";
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:40: error: expected ';' before '}' token
   29 |                                 count=1
      |                                        ^
      |                                        ;
   30 |                         }
      |                         ~
Language: C++

#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string>
#include<algorithm>
#include<vector> 
#include<limits>
#include<numeric>
#include<type_traits>
#include<math.h>
using namespace std;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define in(x) cin >> x
#define out(str) cout << str << endl

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }



int main(){
    int N,M,X,Y;
    cin>>N>>M>>X>>Y;
int x[N],y[M];
    rep(i,N){
   cin>>x[i];
   if(x[i]>=Y){
     out("War");
   return 0;
}
}
    rep(i,M){
   cin>>y[i];
   if(y[i]>=X){
     out("War");
   return 0;
}
out("No War");
}


Compiler output:
a.cc: In function 'int main()':
a.cc:40:2: error: expected '}' at end of input
   40 | }
      |  ^
a.cc:22:11: note: to match this '{'
   22 | int main(){
      |           ^
Language: C++

#include <algorithm>
#include <iostream>
#include <vector>

int main() {
  int N, M, X, Y;
  std::cin >> N >> M >> X >> Y;
  std::vector<int> x(N);
  std::vector<int> y(M);
  for (int i = 0; i < N; ++i) std::cin >> x[i];
  for (int i = 0; i < M; ++i) std::cin >> y[i];

  int xmax = *std::max_element(x.begin(), x.end());
  int ymin = *std::min_element(y.begin(), y.end());

  for (int i = xmax+1; i <= ymax; ++i) {
    if ( X < i && i <= Y ) {
      std::cout << "No War" << std::endl;
      return 0;
    }
  }
  std::cout << "War" << std::endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:29: error: 'ymax' was not declared in this scope; did you mean 'xmax'?
   16 |   for (int i = xmax+1; i <= ymax; ++i) {
      |                             ^~~~
      |                             xmax
Language: C++

#include <bits/stdc++.h>
using namespace std;

bool isNoWar(vector<int> &vecN, vector<int> &vecM, int i) {
  for(int j = 0; j < vecN.size(); j++) {
    if(vecN[j] > i) return false;
  }
  for(int j = 0; j < vecN.size(); j++) {
    if(vecM[j] =< i) return false;
  }
  return true;
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);

  int n, m, x, y;
  cin >> n >> m >> x >> y;

  vector<int> vecN(n);
  for(int i = 0; i < n; i++) {
    cin >> vecN[i];
  }
  vector<int> vecM(m);
  for(int i = 0; i < m; i++) {
    cin >> vecM[i];
  }

  for(int i = x+1; i <= y; i++) {
    if(isNoWar(vecN, vecM, i)) {
      cout << "No War" << endl;
      return 0;
    }
  }

  cout << "War" << endl;
  return 0;
}


Compiler output:
a.cc: In function 'bool isNoWar(std::vector<int>&, std::vector<int>&, int)':
a.cc:9:17: error: expected primary-expression before '<' token
    9 |     if(vecM[j] =< i) return false;
      |                 ^
Language: C

#include <stdio.h>
#include <stdlib.h>

int main(void){
    int n, m, x, y, i, xx, yy;
    scanf("%d %d %d %d", &n, &m, &x, &y);
    int xmax = x, ymin = y
    for(i=0; i<n; i++){
        scanf("%d", &xx);
        if(xx > xmax) xmax = xx;
    }
    for(i=0; i<m; i++){
        scanf("%d", &yy);
        if(yy < ymin) ymin = yy;
    }
    printf("%d %d\n", xmax, ymin);
    if(ymin-xmax > 0) printf("No War");
    else printf("War");
}


Compiler output:
main.c: In function 'main':
main.c:8:5: error: expected ',' or ';' before 'for'
    8 |     for(i=0; i<n; i++){
      |     ^~~
main.c:8:22: error: expected ';' before ')' token
    8 |     for(i=0; i<n; i++){
      |                      ^
      |                      ;
main.c:8:22: error: expected statement before ')' token
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {

  int N,M,X,Y;
  cin >> N >> M >> X >> Y;

  vector<int>x(N);
  vector<int>y(M);
  
  for(int i=0;i<N;i++){
  cin >> x.at(i);
  }
  for(int i=0;i<M;i++){
  cin >> y.at(i);
  }
  
  sort(x.begin(),x.end());
  sort(y.begin(),y.end());
  
  if(X<Y&&x.at(N-1)<Y&&x.at(N-1)<y.at(0)&&X<y.at(0)){
    cout << "No War" << endl;
  }else{
    cout << "War" << endl;
  }


Compiler output:
a.cc: In function 'int main()':
a.cc:26:4: error: expected '}' at end of input
   26 |   }
      |    ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include <algorithm>
#include <iostream>
#include <vector>

int main() {
  int N, M, X, Y;
  std::cin >> N >> M >> X >> Y;
  std::vector<int> x(N);
  std::vector<int> y(M);
  for (int i = 0; i < N; ++i) std::cin >> x[i];
  for (int i = 0; i < M; ++i) std::cin >> y[i];

  int xmax = *std::max_element(x.begin(), x.end());
  int ymin = *std::min_element(y.begin(), y.end());

  for (int i = xmax+1; i <= ymax; ++i) {
    std::cout << "No War" << std::endl;
    return 0;
  }
  std::cout << "War" << std::endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:29: error: 'ymax' was not declared in this scope; did you mean 'xmax'?
   16 |   for (int i = xmax+1; i <= ymax; ++i) {
      |                             ^~~~
      |                             xmax
Language: C++

#include<bits/stdc++.h>

using namespace std;

int main(){
  int x1,y1,tmp;
  int n,m;
  cin >> n >> m;
  cin >> x1 >> y1;
  if(x1>=y1){
    cout << "War" << endl;
    return 0;
  }
  int x[100];
  int y[100];
  for(int i=0; i<n; ++i){
    cin >> x[i];
  }
  for(int i=0; i<m; ++i){
    cin >> y[i];
  }
  for (int i=0; i<n; ++i) {
    for (int j=i+1; j<n; ++j) {
      if (x[i] < x[j]) {
        tmp =  x[i];
        x[i] = x[j];
        x[j] = tmp;
      }
    }
  }
  for (int i=0; i<m; ++i) {
    for (int j=i+1; j<m; ++j) {
      if (y[i] < y[j]) {
        tmp =  y[i];
        y[i] = y[j];
        y[j] = tmp;
      }
    }
  }
  if(x[0]=<x1){
    if(y[m-1]>=y1){
      cout << "No War" << endl;
    }
    else{
      cout << "War" << endl;
    }
  }
  else{
    cout << "War" << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:40:11: error: expected primary-expression before '<' token
   40 |   if(x[0]=<x1){
      |           ^