爱奇艺算法岗笔试编程题(2018/09/15)
# 第一题 [N,M,P] = [int(x) for x in raw_input().split()] Ai = [int(x) for x in raw_input().split()] for i in range(M): ll = [x for x in raw_input().split()] act = ll[0] ind = int(ll[1]) if act == 'A': Ai[ind-1] += 1 if act == "B": Ai[ind-1] -= 1 S = Ai[P-1] arr =Ai i = 1 for v in arr: if S <v: i = i+1 print i
# 第二题
N = int(raw_input()) st = [] for i in range(N): [a,b] = [int(x) for x in raw_input().split()] st.append([max(a,b),min(a,b)]) st.sort() print st t = -1000 ans = 0 for i in range(N): if t <= st[i][1]: ans += 1 t = st[i][0] print ans
#爱奇艺##笔试题目#