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

Ended

Participants:405

Verdict:Accepted
Score:100 / 100
Submitted:2017-07-23 12:28:10

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 <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#define MAXN 100050
#define LL long long
using namespace std;
int a[MAXN];
int n;
map<int, int> mp;
int q[MAXN];
int main() {
    int tt;
    scanf("%d", &tt);
    while (tt--) {
        mp.clear();
        int st=0;
        int tail = 0;
        char ch[11];
        scanf(" %s", ch);
        int n=strlen(ch);
        for(int i=0;i<n;++i)
            st=st*10+ch[i]-'0';
        q[tail++] = st;
        mp[st]=0;
        int ed = 0;
        for (int i = 1; i <= n; ++i)
            ed = ed * 10 + i;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX