• + 22 comments

    Python 2

    n = int(raw_input().strip())
    scores = map(int,raw_input().strip().split(' '))
    m = int(raw_input().strip())
    alice = map(int,raw_input().strip().split(' '))
    
    leaderboard = sorted(set(scores), reverse = True)
    l = len(leaderboard)
    
    for a in alice:
        while (l > 0) and (a >= leaderboard[l-1]):
            l -= 1
        print l+1