Submission #23119287


Source Code Expand

import sys

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]

    ans = [0 for _ in range(n + 1)]
    for i in imos:
        for j in i:
            ans[j] += 1

    print(*ans[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 680 Byte
Status AC
Exec Time 507 ms
Memory 52076 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 4 / 4
Status
AC × 3
AC × 22
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 347 ms 17804 KiB
hand_02.txt AC 493 ms 52076 KiB
hand_03.txt AC 478 ms 20236 KiB
hand_04.txt AC 344 ms 17872 KiB
hand_05.txt AC 507 ms 51988 KiB
random_01.txt AC 413 ms 50452 KiB
random_02.txt AC 449 ms 51292 KiB
random_03.txt AC 377 ms 47288 KiB
random_04.txt AC 428 ms 50480 KiB
random_05.txt AC 419 ms 50340 KiB
random_06.txt AC 466 ms 51276 KiB
random_07.txt AC 477 ms 51604 KiB
random_08.txt AC 448 ms 51184 KiB
random_09.txt AC 474 ms 51620 KiB
random_10.txt AC 470 ms 51524 KiB
random_11.txt AC 505 ms 51868 KiB
random_12.txt AC 468 ms 51416 KiB
random_13.txt AC 390 ms 50096 KiB
random_14.txt AC 442 ms 50940 KiB
sample_01.txt AC 342 ms 17700 KiB
sample_02.txt AC 345 ms 17808 KiB
sample_03.txt AC 345 ms 17700 KiB