五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

CF 1760C - Advantage

2023-07-03 10:02 作者:您是打尖兒還是住店呢  | 我要投稿

There are n participants in a competition, participant i having a strength of si.

Every participant wonders how much of an advantage they have over the other best participant. In other words, each participant i wants to know the difference between si and sj, where j is the strongest participant in the competition, not counting i (a difference can be negative).

So, they ask you for your help! For each i (1≤i≤n) output the ifference between si and the maximum strength of any participant other than participant i.

-------------------------------------------------

一場比賽有 n 名參賽者,參賽者 i 的實力為 si。

每個參與者都想知道他們比其他最好的參與者有多少優(yōu)勢。 換句話說,每個參與者i都想知道si和sj之間的差異,其中j是比賽中最強(qiáng)的參與者,不包括i(差異可以為負(fù))。

所以,他們請求你的幫助! 對于每個 i (1≤i≤n) 輸出 si 與除參與者 i 之外的任何參與者的最大強(qiáng)度之間的差異。

------------------

每個選手想知道自己跟其他最厲害的選手的差距,這時候可以用2個變量去存儲目前遇到的最大值,跟第2大的值。然后存儲在當(dāng)前數(shù)組中,這樣還不占額外的空間。

(我一開始是用的優(yōu)先隊列去存儲的,但是超時了。就參考其他人的代碼了)

下面是代碼:


CF 1760C - Advantage的評論 (共 條)

分享到微博請遵守國家法律
新乡市| 名山县| 松滋市| 太原市| 米林县| 临武县| 屏东县| 崇阳县| 搜索| 阿克陶县| 恩施市| 耿马| 通榆县| 惠东县| 辉南县| 仪陇县| 项城市| 淮安市| 新巴尔虎左旗| 古田县| 海原县| 永德县| 五指山市| 陕西省| 长垣县| 凤山县| 曲水县| 宜昌市| 郁南县| 察雅县| 镇宁| 尉氏县| 通山县| 璧山县| 阿勒泰市| 宁武县| 舟山市| 仁寿县| 突泉县| 盐池县| 正蓝旗|