Submission #3252785


Source Code Expand

Copy
#include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <set>
#include <map>
#include <unordered_map>

using namespace std;
const int maxn = 102;

int n, m, X, Y, x, y;

int main()
{
	cin >> n >> m >> X >> Y;

	int maxx = -101;

	for (int i = 1; i <= n; ++i) {
		cin >> x;
		if (x > maxx)
			maxx = x;
	}

	// if (maxx >= Y) {
	// 	cout << "War" << endl;
	// 	return 0;
	// }

	int miny = 101;
	for (int i = 1; i <= m; ++i) {
		cin >> y;
		if (y < miny)
			miny = y;
	}

	for (int i = X+1; i <= Y; ++i)
	{
		if (i > maxx && i <= miny) {
			cout << "No War" << endl;
			return 0;
		}
	}

	// if (miny <= X || maxx >= miny)
	// 	cout << "War" << endl;
	// else 
	// 	cout << "No War" << endl;
	
	cout << "War" << endl;
	return 0;
}

Submission Info

Submission Time
Task B - 1 Dimensional World's Tale
User suzyz
Language C++14 (GCC 5.4.1)
Score 200
Code Size 809 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