hiho week 311 register

Ended

Participants:28

Verdict:Accepted
Score:100 / 100
Submitted:2020-06-18 15:08:43

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 <algorithm>
#include <string>
#include <vector>
#include <map>
using namespace std;
struct Node {
    string name;
    string num;
    int val;
    Node(string s, string x, int v):name(s), num(x), val(v) {}
};
map<char, int> mp;
void init()
{
    mp['I'] = 1;
    mp['V'] = 5;
    mp['X'] = 10;
    mp['L'] = 50;
    mp['C'] = 100;
    mp['D'] = 500;
    mp['M'] = 1000;
}
int transfer(string &num) 
{
    int len = num.length();
    int res = 0;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX