Lang:G++
Edit12345678910111213141516171819202122232425262728293031#include <iostream>#include <string>#include <algorithm>using namespace std;struct Names{string name;string s;int Num;}arr[100010];int lm[24] = {0,0,100,500,0,0,0,0,1,0,0,50,1000,0,0,0,0,0,0,0,0,5,0,10};int LuoMa(string luoma)//罗马数字变数字{int len = luoma.length();int t = lm[luoma[0]-'A'];for(int i=1;i<len;i++){if(lm[luoma[i]-'A']>lm[luoma[i-1]-'A'])t += lm[luoma[i]-'A']-2*lm[luoma[i-1]-'A'];elset += lm[luoma[i]-'A'];}return t;}bool cmp(const Names& a,const Names& b){if(a.name == b.name)return a.Num < b.Num;return a.name<b.name;