链接:https://ac.nowcoder.com/acm/contest/13926/E
来源:牛客网
Figure skating 花样滑冰
gymnastics 体操
execute 执行
contestant 参赛者
Olympics observers from the Bookmakers’ Association for the Prevention of Cheating are tasked with assessing the objectivity of the jury. They will compare the predicted ranking of the contestants with the fifinal outcome to determine who is the jury’s favourite. The favourite is the contestant who rose the most places between the predicted and fifinal scoreboard. Ties are broken by whoever ends up higher on the fifinal scoreboard. However, if no one did better than predicted, this raises some red flflags with the observers, which is declared “suspicious”.
排名上升最多的就是 要找的那个人
如果没有,“suspicious”.
#include<bits/stdc++.h>
#define ios ios::sync_with_stdio(false);cin.tie(0)
#define rep(i,a,b) for(int i=a;i<=b;++i)
using namespace std;
string arr[1010];
map<string, int> mp;
void solve()
{
int n;
cin >> n;
rep(i,1,n)
{
cin >> arr[i];
mp[arr[i]] = i; // 记录对应的位置
}
int ans = 0;
string str;
rep(i,1,n)
{
string s;
cin >> s;
if(mp[s]-i>ans){
ans = mp[s]-i;
str = s;
}
}
if(ans) cout << str << endl;
else puts("suspicious");
}
int main()
{
ios;
solve();
return 0;
}