이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <cstdio>
#include <vector>
const int kModulo = 1000000007;
int main() {
  int N;
  scanf("%d", &N);
  if (N == 1) {
    int a, b;
    int ap, bp;
    scanf("%d%d", &a, &b);
    scanf("%d%d", &ap, &bp);
    if (a > bp || b < ap) {
      printf("-1");
    } else if (b == ap || bp == a) {
      printf("0");
    } else {
      printf("1");
    }
  } else if (N == 2) {
    int a, b, c, d;
    int ap, bp, cp, dp;
    scanf("%d%d%d%d", &a, &c, &b, &d);
    scanf("%d%d%d%d", &ap, &cp, &bp, &dp);
    if (a > cp || c < ap || b > dp || d < bp) {
      printf("-1");
    } else if (a >= cp || c <= ap || b >= dp || d <= bp) {
      if ((a == cp && b == dp) || (c == ap && d == bp) ||
          (c == ap && b == dp) || (a == cp && d == bp)) {
        printf("0");
      } else {
        printf("1");
      }
    } else {
      printf("2");
    }
  }
  //for (int i = 0; i < 2; ++i) {
  //  for (int j = 0; j < N; ++j) {
  //  }
  //}
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... |