hiho week 127 register

Ended

Participants:196

Verdict:Accepted
Score:100 / 100
Submitted:2016-12-09 21:03:34

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<string>
#include<vector>
#include<stdlib.h>
#include<map>
using namespace std;
int stktop;
map<string,vector<int>> msv;
map<string,vector<int>>::iterator msvi;
struct state{
vector<string> vs;
vector<int> vi;
}states[1000];
int main(){
stktop = 0;
char s[1000];
scanf("%s",&s);
int i;
int j;
for(j=0;s[j];j++){
        for(i=0;i<=j;i++){
                char tmp[100];
                int k;
                for(k=0;k<=j-i;k++){
                        tmp[k] = s[i+k];
                }
                tmp[j-i+1] = 0;
                string s = string(tmp);
                msv[s].push_back(j+1);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX