Submission #3253273


Source Code Expand

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

typedef long long ll;
typedef pair<int, int> P;

#define For(i, a, b) for(int i = (a); i < (b); i++)
#define Rep(i, n) For(i, 0, (n))
#define Rrep(i, n) for(int i = (n - 1); i >= 0; i--)
#define Itr(i, c) for(typeof(c.begin()) i = c.begin(); i != c.end(); i++)
#define pb push_back

const int inf = 999999999;
const int mod = 1000000007;
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};

int main(){
	int n, m, x, y; cin >> n >> m >> x >> y;
	int _min = inf, _max = -inf;
	Rep(i, n){
		int t; cin >> t;
		_max = max(_max, t);
	}
	Rep(i, m){
		int t; cin >> t;
		_min = min(_min, t);
	}
	bool flag = true;
	if(_max < _min){
		For(z, _max + 1, _min + 1){
			if(z > x && z <= y){
				continue;
			}else{
				flag = false;
			}
		}
	}else{
		flag = false;
	}
	if(flag){
		cout << "No War" << endl;
	}else{
		cout << "War" << endl;
	}
	return 0;
}

Submission Info

Submission Time
Task B - 1 Dimensional World's Tale
User niimi
Language C++14 (GCC 5.4.1)
Score 200
Code Size 943 Byte
Status
Exec Time 1 ms
Memory 256 KB

Test Cases

Set Name Score / Max Score Test Cases
All 200 / 200 hand1, hand2, max1, max2, max3, max4, max5, max6, max7, max8, normal1, normal2, normal3, normal4, normal5, sample_01, sample_02, sample_03
Sample 0 / 0 sample_01, sample_02, sample_03
Case Name Status Exec Time Memory
hand1 1 ms 256 KB
hand2 1 ms 256 KB
max1 1 ms 256 KB
max2 1 ms 256 KB
max3 1 ms 256 KB
max4 1 ms 256 KB
max5 1 ms 256 KB
max6 1 ms 256 KB
max7 1 ms 256 KB
max8 1 ms 256 KB
normal1 1 ms 256 KB
normal2 1 ms 256 KB
normal3 1 ms 256 KB
normal4 1 ms 256 KB
normal5 1 ms 256 KB
sample_01 1 ms 256 KB
sample_02 1 ms 256 KB
sample_03 1 ms 256 KB