Submission #3434152


Source Code Expand

#include <iostream>

using namespace std;

int main()
{
    int n, m;
    int x, y;
    int x[101], y[101];
    cin >> n >> m >> x >> y;

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

    int max = x[0], min = y[0];

    for(int i=1; i<n; i++){
        if(x[i] > max){
            max = x[i];
        }
    }
    for(int i=1; i<m; i++){
        if(y[i] < min){
            min = y[i];
        }
    }

    int z;
    if(x < z && z < y && z > max && z <= min){
        cout << "War";
    }else{
        cout << "No War"
    }
}

Submission Info

Submission Time
Task B - 1 Dimensional World's Tale
User Kazu05
Language C++14 (GCC 5.4.1)
Score 0
Code Size 630 Byte
Status CE

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:9:14: error: conflicting declaration ‘int x [101]’
     int x[101], y[101];
              ^
./Main.cpp:8:9: note: previous declaration as ‘int x’
     int x, y;
         ^
./Main.cpp:9:22: error: conflicting declaration ‘int y [101]’
     int x[101], y[101];
                      ^
./Main.cpp:8:12: note: previous declaration as ‘int y’
     int x, y;
            ^
./Main.cpp:13:19: error: invalid types ‘int[int]’ for array subscript
         cin >> x[i];
                   ^
./Main.cpp:16:19: error: invalid types ‘int[int]’ for array subscript
         cin >> x[i];
                   ^
./Main.cpp:19:18: error: invalid types ‘int[int]’ for array subscript
     int max = x[0], min = y[0];
                  ^
./Main.cpp:22:15: error: invalid types ‘int[int]’ for array subscript
         if(x[i] > max){
               ^
./Main.cpp:23:22: error: invalid types ‘int[int]’ for array subscript
             max = x[i];
                      ^
./Main.cpp:27:15: e...