# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
9646 |
2014-09-28T07:48:31 Z |
effserv |
N-orthotope (kriii2_N) |
C++ |
|
0 ms |
1212 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)
{
printf("-1\n");
return 0;
}
}
for (int i = 0; i > n; i++)
{
if (det[i] > 0)
{
ans++;
}
}
printf("%d\n", ans);
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
1212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
1212 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Halted |
0 ms |
0 KB |
- |