Submission #45138470


Source Code Expand

/*
  2023/9/2
  ABC318 B
*/


//#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int  INF = 2147483647;
const ll  INF2 = 9223372036854775807;
const ll  MOD = 998244353;
const int  MOD2 = 1000000007;
const double PI = 3.14159263589793;
const long double EPS = 1e-14;

int main(){
  int n;
  cin >> n;

  vector<pair<int,int>> x,y;

  for(int i = 0; i < n; i++){
    int a,b,c,d;
    cin >> a >> b >> c >> d;
    x.push_back({a,b});
    y.push_back({c,d});
  }

  vector<vector<bool>> ans(110,vector<bool> (110,false));

  for(int i = 0; i < n; i++){
    for(int j = x[i].first; j < x[i].second; j++){
      for(int k = y[i].first; k < y[i].second; k++){
        ans[j][k] = true;
      }
    }
  }

  int count = 0;

  for(int i = 0; i < 100; i++){
    for(int j = 0; j < 100; j++){
      if(ans[i][j]){
        count++;
      }
    }
  }

  cout << count << endl;

}

Submission Info

Submission Time
Task B - Overlapping sheets
User tharuto
Language C++ 23 (gcc 12.2)
Score 200
Code Size 967 Byte
Status AC
Exec Time 3 ms
Memory 3676 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 24
Set Name Test Cases
Sample example_00.txt, example_01.txt, example_02.txt
All example_00.txt, example_01.txt, example_02.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, hand_06.txt, hand_07.txt, hand_08.txt, hand_09.txt, hand_10.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt
Case Name Status Exec Time Memory
example_00.txt AC 1 ms 3440 KiB
example_01.txt AC 1 ms 3608 KiB
example_02.txt AC 1 ms 3448 KiB
hand_00.txt AC 3 ms 3412 KiB
hand_01.txt AC 1 ms 3412 KiB
hand_02.txt AC 1 ms 3536 KiB
hand_03.txt AC 1 ms 3600 KiB
hand_04.txt AC 1 ms 3676 KiB
hand_05.txt AC 1 ms 3484 KiB
hand_06.txt AC 1 ms 3536 KiB
hand_07.txt AC 1 ms 3448 KiB
hand_08.txt AC 1 ms 3536 KiB
hand_09.txt AC 1 ms 3468 KiB
hand_10.txt AC 1 ms 3464 KiB
random_00.txt AC 1 ms 3524 KiB
random_01.txt AC 1 ms 3528 KiB
random_02.txt AC 1 ms 3476 KiB
random_03.txt AC 1 ms 3476 KiB
random_04.txt AC 1 ms 3608 KiB
random_05.txt AC 1 ms 3444 KiB
random_06.txt AC 1 ms 3540 KiB
random_07.txt AC 2 ms 3604 KiB
random_08.txt AC 2 ms 3448 KiB
random_09.txt AC 2 ms 3540 KiB