hiho week 311 register

Ended

Participants:28

Verdict:Accepted
Score:100 / 100
Submitted:2020-06-13 21:38:26

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#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'];
        else
            t += 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;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX