文件名称:c++2
介绍说明--下载内容均来自于网络,请自行研究使用
题目:训练场上n(1≤n≤50000)个高矮都不相同的士兵从左到右排成一行,依次编号为1,2,…,n。第i个士兵的身高H(i),由于采用特殊单位,H(i)满足1≤H(i)≤2000000000。设第i个士兵右侧最近的比他个高的士兵编号为j,则第i个士兵可看到在他的右侧比他矮的士兵的个数S(i)=j-i-1。(不考虑客观因素,比如视力范围等-,-)
求S(1)+S(2)+…+S(n)。-Topic: training ground n (1 ≤ n ≤ 50000) were the same height are not lined up his soldiers from left to right, followed by numbered 1,2, ..., n. No. i soldiers height H (i), as a result of the use of special units, H (i) satisfy 1 ≤ H (i) ≤ 2000000000. I set up the first of the soldiers the right than his most recent high-soldiers numbered j, the first soldiers i can see is that the right side of his soldiers than his dwarf the number of S (i) = ji-1. (Without regard to objective factors, such as vision scope-,-) for S (1)+ S (2)+ ...+ S (n).
求S(1)+S(2)+…+S(n)。-Topic: training ground n (1 ≤ n ≤ 50000) were the same height are not lined up his soldiers from left to right, followed by numbered 1,2, ..., n. No. i soldiers height H (i), as a result of the use of special units, H (i) satisfy 1 ≤ H (i) ≤ 2000000000. I set up the first of the soldiers the right than his most recent high-soldiers numbered j, the first soldiers i can see is that the right side of his soldiers than his dwarf the number of S (i) = ji-1. (Without regard to objective factors, such as vision scope-,-) for S (1)+ S (2)+ ...+ S (n).
(系统自动生成,下载前可以参看下载内容)
下载文件列表
第51次编程题目.txt
答案一.txt
答案七.txt
答案三.txt
答案二.txt
答案五.txt
答案六.txt
答案四.txt
答案一.txt
答案七.txt
答案三.txt
答案二.txt
答案五.txt
答案六.txt
答案四.txt