蓝桥杯第一期回文题,热衷于算法。
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-8Wc9KSi5-1615769613050)(https://imgblog.csdnimg.cn/20210315085316848.jpg?,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl81NjAxMDcyNQ==,size_16,color_FFFFFF,t_70)]
n = int( input())
mlist = list( map(int,input().split()))
li = [0]*100
res = 0
for i in range(n):
li[ mlist[i]] += 1
res += sum( li[ mlist[i]+1:])
print( res)
小伙伴们试试!