hiho week 84 register

Ended

Participants:186

Verdict:Accepted
Score:100 / 100
Submitted:2016-02-11 18:56:51

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 <string>
#include <vector>
#include <set>
using namespace std;
int diffChar(string str){//
    vector<int> help(26, 0);
    for(char c : str){
        help[c - 'a'] = 1;
    }
    int ans = 0;
    for(int n : help)
        ans += n;
    return ans;
}
void findLuckySubstr(string str, set<string> &ans){
    vector<int> help(101, 0);
    help[0] = 1;
    help[1] = 1;
    int fn_1 = 1, fn_2 = 0, fn = 0;
    while(fn < 101){//fibonacci 100fibonacci 1.
        fn = fn_1 + fn_2;
        if(fn < 101){
            help[fn] = 1;
            fn_2 = fn_1;
            fn_1 = fn;
        }
    }
    int len = str.length();
    for(int i = 0; i < len; i++)//
        for(int j = 1; j <= len - i; j++){
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX