You are viewing a single comment's thread. Return to all comments →
from collections import defaultdict d,f=defaultdict(int),defaultdict(int) cnt=0 for _ in range(int(input())): n,k=map(int, input().split()) if(n==1): f[d[k]]-=1 d[k]+=1 f[d[k]]+=1 if(n==2): f[d[k]]-=1 d[k]-=1 f[d[k]]+=1 if(n==3): if(f[k]>0): print(1) else: print(0)
from collections import defaultdict
d,f=defaultdict(int),defaultdict(int) cnt=0 for _ in range(int(input())): n,k=map(int, input().split()) if(n==1): f[d[k]]-=1 d[k]+=1 f[d[k]]+=1 if(n==2): f[d[k]]-=1 d[k]-=1 f[d[k]]+=1 if(n==3): if(f[k]>0): print(1) else: print(0)
Seems like cookies are disabled on this browser, please enable them to open this website
Frequency Queries
You are viewing a single comment's thread. Return to all comments →