No Idea!

Sort by

recency

|

1484 Discussions

|

  • + 0 comments
    1. n = map(int,input().split())
    2. n_int = list(map(int,input().split()))
    3. m_a = set(map(int,input().split()))
    4. m_b = set(map(int,input().split()))
    5. happiness = 0
    6. for i in n_int:
    7. if(i in m_a):
    8. happiness+=1
    9. elif(i in m_b):
    10. happiness -=1
    11. print(happiness)
  • + 0 comments
    input()
    
    nums = {}
    for num in input().split():
        nums[num] = nums.get(num, 0) + 1
    
    current_mood = 0
    
    for n in input().split():
        current_mood += nums.get(n, 0)
    
    for n in input().split():
        current_mood -= nums.get(n, 0)
    
    print(current_mood)
    
  • + 0 comments

    n,m=list(map(int,input().split())) array=list(map(int,input().split())) A=set(map(int,input().split())) B=set(map(int,input().split()))

    happiness=0 for num in array: if num in A: happiness+=1 elif num in B: happiness-=1 print(happiness)

  • [deleted]
    + 0 comments

    For Python3

    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 i in lst:
        if(i in A):
            happiness += 1
        elif(i in B):
            happiness -= 1
    
    print(happiness)
    
  • + 0 comments

    n,m=tuple(map(int,input().split())) n_nums = list(map(int,(input().split()))) A=set(map(int,input().split())) B=set(map(int,input().split())) happiness=0 for i in n_nums: if i in A: happiness+=1 else: happiness+=0 if i in B: happiness-=1 else:

         happiness+=0
    

    print(happiness)