Make a copy of the array sss: call it ttt. Sort ttt in non-decreasing order, so that t1t_1t1 is the maximum strength and t2t_2t2 — the second maximum strength.
Then for everyone but the best person, they should compare with the best person who has strength t1t_1t1. So for all iii such that sisisi ≠≠= t1t_1t1, we should output sis_isi − t1.t_1.t1. Otherwise, output sis_isi − t2t_2t2 — the second highest strength, which is the next best person.
#include
using namespace std;int main()
{int T=1;cin>>T;while(T--){int n;cin>>n;vector a(n);for(int i=0;i>a[i];auto b=a;sort(b.begin(),b.end());for(int i=0;iif(a[i]==b[n-1]) cout<
上一篇:菲尔克鲁格生日当天参与3粒进球,04-05赛季以来德甲首人 菲尔克鲁格进球庆祝动作 菲尔克鲁格生日
下一篇:多特蒙德vs弗赖堡球员评分:马伦9.2分,马特乌-默雷伊5.7分 多特蒙德1314首发 2022多特蒙德上半场比分