Submission #23119737
Source Code Expand
import sys
from collections import Counter
input = sys.stdin.readline
def main():
n = int(input())
m = 1010
imos = [[0 for j in range(m)] for i in range(m)]
for _ in range(n):
lx, ly, rx, ry = map(int, input().split())
imos[lx][ly] += 1
imos[lx][ry] -= 1
imos[rx][ly] -= 1
imos[rx][ry] += 1
for i in range(m):
for j in range(m - 1):
imos[i][j + 1] += imos[i][j]
for i in range(m - 1):
for j in range(m):
imos[i + 1][j] += imos[i][j]
counter = Counter((j for i in imos for j in i))
print(*(counter.get(i, 0) for i in range(1, n + 1)), sep='\n')
if __name__ == "__main__":
main()
Submission Info
| Submission Time | |
|---|---|
| Task | 028 - Cluttered Paper(★4) |
| User | riantkb |
| Language | Python (3.8.2) |
| Score | 4 |
| Code Size | 701 Byte |
| Status | AC |
| Exec Time | 616 ms |
| Memory | 57656 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 4 / 4 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | sample_01.txt, sample_02.txt, sample_03.txt |
| All | hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.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, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, sample_01.txt, sample_02.txt, sample_03.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| hand_01.txt | AC | 376 ms | 18140 KiB |
| hand_02.txt | AC | 559 ms | 51912 KiB |
| hand_03.txt | AC | 526 ms | 19840 KiB |
| hand_04.txt | AC | 373 ms | 18084 KiB |
| hand_05.txt | AC | 612 ms | 54288 KiB |
| random_01.txt | AC | 488 ms | 51148 KiB |
| random_02.txt | AC | 535 ms | 52372 KiB |
| random_03.txt | AC | 429 ms | 47716 KiB |
| random_04.txt | AC | 509 ms | 52056 KiB |
| random_05.txt | AC | 491 ms | 50848 KiB |
| random_06.txt | AC | 554 ms | 52508 KiB |
| random_07.txt | AC | 572 ms | 52520 KiB |
| random_08.txt | AC | 526 ms | 52360 KiB |
| random_09.txt | AC | 567 ms | 52636 KiB |
| random_10.txt | AC | 572 ms | 53772 KiB |
| random_11.txt | AC | 616 ms | 57656 KiB |
| random_12.txt | AC | 570 ms | 53608 KiB |
| random_13.txt | AC | 455 ms | 50612 KiB |
| random_14.txt | AC | 537 ms | 53592 KiB |
| sample_01.txt | AC | 375 ms | 18340 KiB |
| sample_02.txt | AC | 370 ms | 18212 KiB |
| sample_03.txt | AC | 376 ms | 18204 KiB |