Submission #9636

# Submission time Handle Problem Language Result Execution time Memory
9636 2014-09-28T07:46:45 Z effserv N-orthotope (kriii2_N) C++
0 / 4
0 ms 1208 KB
/* 문제


*/


// 2014.

#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <functional>
#include <cstring>
#include <string>
#include <map>

using namespace std;

int det[12];
vector <int> s[2], e[2];

int main()
{
	int n,ans = 0;
	scanf("%d", &n);

	for (int i = 0; i < n; i++)
	{
		int x, y;
		scanf("%d%d", &x, &y);
		s[0].push_back(x);
		e[0].push_back(y);
	}

	for (int i = 0; i < n; i++)
	{
		int x, y;
		scanf("%d%d", &x, &y);

		if (s[0][i] > x)
		{
			if (e[0][i] > y)
			{
				det[i] = y - s[0][i];
			}
			else
			{
				det[i] = e[0][i] - s[0][i];
			}
		}
		else
		{
			if (e[0][i] > y)
			{
				det[i] = y - x;
			}
			else
			{
				det[i] = e[0][i] - x;
			}
		}

		if (det[i] > 0)
			ans++;
	}

	if (ans == 0)
	{
		for (int i = 0; i > n; i++)
		{
			if (det[i] < 0)
			{
				ans = -1;
				break;
			}
		}
		printf("%d\n", ans);
	}
	else
		printf("%d\n", ans);



	return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 1208 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Halted 0 ms 0 KB -