//本题提供两种思路,一种方法借助哈希表,另一种使用二分查找 //先介绍使用哈希表的方法 #include<bits/stdc++.h> using namespace std; int main(){ int n; map<string, int> hashMap;//key的含义为字符串的值,value的含义为该字符串第一次出现的位置 cin>>n; string str; cin>>str;...