hiho week 176 register

Ended

Participants:281

Verdict:Accepted
Score:100 / 100
Submitted:2017-11-17 21:14:15

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<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
int a[300],len[25];
char  str[25][1000];
int get_num(int i,int &p)
{
    if(str[i][p]>='A'&&str[i][p]<='Z')
        return a[str[i][p++]];
    int num=0;
    while(str[i][p]!='<'&&p<len[i])
        num=num*10+str[i][p++]-'0';
    return num;
}
int main()
{
    char ch;
    int x,y,n,m;
    //freopen("in.txt","r",stdin);
    while(scanf("%d",&n)!=EOF)
    {
        memset(a,0,sizeof(a));
        for(int i=1;i<=n;i++){
            scanf("%s",str[i]);
            len[i]=strlen(str[i]);
            for(int j=0;j<len[i];j++)
                a[str[i][j]]=1;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX