Submission #50792959


Source Code Expand

from collections import defaultdict, deque
import bisect
import math
import heapq
import numpy as np
import itertools
import sys
sys.setrecursionlimit(10**8)
INF = 10**18

N, T = map(int, input().split())
d = defaultdict(int)
d[0] = N
P = [0]*(N+1)
for _ in range(T):
    a, b = map(int,input().split())
    before = P[a]
    d[before] -= 1
    if d[before] == 0:
        del d[before]
    after = before+b
    d[after] += 1
    P[a] = after
    print(len(d))

Submission Info

Submission Time
Task D - Diversity of Scores
User flourpoke
Language Python (PyPy 3.10-v7.3.12)
Score 400
Code Size 459 Byte
Status AC
Exec Time 963 ms
Memory 149292 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 400 / 400
Status
AC × 3
AC × 22
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt, 01_random_12.txt, 01_random_13.txt, 01_random_14.txt, 01_random_15.txt, 02_max_00.txt, 02_max_01.txt, 03_killer_00.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 518 ms 126184 KiB
00_sample_01.txt AC 512 ms 125464 KiB
00_sample_02.txt AC 507 ms 125408 KiB
01_random_00.txt AC 839 ms 127568 KiB
01_random_01.txt AC 854 ms 126396 KiB
01_random_02.txt AC 889 ms 130252 KiB
01_random_03.txt AC 894 ms 130664 KiB
01_random_04.txt AC 922 ms 134512 KiB
01_random_05.txt AC 917 ms 135540 KiB
01_random_06.txt AC 952 ms 137300 KiB
01_random_07.txt AC 931 ms 138648 KiB
01_random_08.txt AC 931 ms 141648 KiB
01_random_09.txt AC 932 ms 141592 KiB
01_random_10.txt AC 951 ms 142204 KiB
01_random_11.txt AC 943 ms 142632 KiB
01_random_12.txt AC 963 ms 144772 KiB
01_random_13.txt AC 918 ms 128416 KiB
01_random_14.txt AC 956 ms 149292 KiB
01_random_15.txt AC 948 ms 138980 KiB
02_max_00.txt AC 838 ms 128712 KiB
02_max_01.txt AC 842 ms 128076 KiB
03_killer_00.txt AC 832 ms 127532 KiB