No Idea!

Sort by

recency

|

1522 Discussions

|

  • + 0 comments
    n, m = list(map(int, input().split()))
    
    ints = [int(i) for i in input().split()]
    A = set([int(i) for i in input().split()])
    B = set([int(i) for i in input().split()])
        
    happines = 0
    
    for i in ints:
        if i in A:
            happines += 1
        elif i in B:
            happines -= 1
    
    print(happines)
    
  • + 0 comments
    n, m = map(int, input().split(" "))
    lst = list(map(int,input().split(' ')))
    A = set(map(int,(input().split(' '))))
    B = set(map(int,(input().split(' '))))
    
    happiness = 0
    for l in lst:
        if l in A:
            happiness +=1
        elif l in B:
            happiness -=1
    print(happiness)
    
  • + 0 comments

    from collections import Counter

    n,m=input().split() array=tuple(input().split()) s=set(array) t_set_1=set(input().split()) t_set_2=set(input().split()) happiness=0 fre=Counter(array) for i in t_set_1.intersection(array): happiness+=fre[i] for i in t_set_2.intersection(array): happiness-=fre[i]

    print(happiness)

  • + 1 comment

    For Python3 Platform

    n, m = map(int, input().split())
    arr = list(map(int, input().split()))
    A = set(map(int, input().split()))
    B = set(map(int, input().split()))
    happiness = 0
    
    for i in arr:
        if(i in A):
            happiness += 1
        elif(i in B):
            happiness -= 1
    
    print(happiness)
    
  • + 0 comments

    n, m = map(int, input().split()) arr1 = list(map(int, input().split())) A = set(map(int, input().split())) B = set(map(int, input().split())) happiness = 0 for i in arr1: if i in A: happiness+=1 elif i in B: happiness-=1 print(happinesss)