题解 | 左侧严格小于计数

左侧严格小于计数

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 = ' ')

全部评论

相关推荐

04-28 15:42
郑州大学 C++
找工作勤劳小蜜蜂:网易这几个月在大面积裁员,外包岗全退,今年网易收缩严重,建议慎重考虑网易
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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