[Offer收割]编程练习赛104 register

Ended

Participants:85

Verdict:Accepted
Score:100 / 100
Submitted:2019-07-21 12:24:02

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<bits/stdc++.h>
#define LL long long
using namespace std;
const int maxn=1e5+100;
char s1[maxn];
map<string,char>mp;
int main()
{
    string s;
    s="101";
    mp[s]='A';
    s="11";
    mp[s]='B';
    s="0";
    mp[s]='C';
    s="100";
    mp[s]='D';
    cin>>s1;
    int len=strlen(s1);
    s.clear();
    for(int i=0;i<len;i++)
    {
        s+=s1[i];
        if(mp.find(s)!=mp.end())
        {
            cout<<mp[s];
            s.clear();
        }
    }
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX