题解 | 左侧严格小于计数

左侧严格小于计数

https://www.nowcoder.com/practice/c5922c6cdd1445749bd42f586c422435

n = int(input())
a = list(map(int,input().split()))
b=[]
for i in range(n):
  cnt = 0
  if i == 0:
    b.append(0)
    continue
  else:
    for j in range(i):
      if a[j] < a[i]:
        cnt+=1
        continue
      else:
        continue
    b.append(cnt)
for i in b:
  print(i,end = ' ')

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务