Submission #606192


Source Code Expand

Copy
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <vector>
#include <string>
#include <queue>
#include <deque>
#include <list>
#include <stack>
#include <set>
#include <map>
#include <algorithm>

#define int long long

using namespace std;

signed main() {
    string s;
    int k;
    cin >> s >> k;

    if (k > s.size()) {
	cout << 0 << endl;
	return 0;
    }

    set<string> str;
    for (int i = 0; i < s.size()-k+1; i++) {
	str.insert(s.substr(i, k));
    }

    cout << str.size() << endl;

    return 0;
}

Submission Info

Submission Time
Task B - 高橋君とパスワード
User iwashi31
Language C++ (GCC 4.9.2)
Score 100
Code Size 625 Byte
Status
Exec Time 32 ms
Memory 928 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 subtask0_sample_01.txt, subtask0_sample_02.txt, subtask0_sample_03.txt
All 100 / 100 subtask0_sample_01.txt, subtask0_sample_02.txt, subtask0_sample_03.txt, subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt, subtask1_13.txt, subtask1_14.txt, subtask1_15.txt, subtask1_16.txt, subtask1_17.txt, subtask1_18.txt, subtask1_19.txt, subtask1_20.txt, subtask1_21.txt, subtask1_22.txt, subtask1_23.txt
Case Name Status Exec Time Memory
subtask0_sample_01.txt 26 ms 676 KB
subtask0_sample_02.txt 25 ms 924 KB
subtask0_sample_03.txt 25 ms 792 KB
subtask1_01.txt 25 ms 744 KB
subtask1_02.txt 25 ms 804 KB
subtask1_03.txt 27 ms 804 KB
subtask1_04.txt 25 ms 928 KB
subtask1_05.txt 25 ms 928 KB
subtask1_06.txt 25 ms 796 KB
subtask1_07.txt 25 ms 924 KB
subtask1_08.txt 28 ms 808 KB
subtask1_09.txt 25 ms 920 KB
subtask1_10.txt 28 ms 796 KB
subtask1_11.txt 27 ms 800 KB
subtask1_12.txt 27 ms 800 KB
subtask1_13.txt 27 ms 800 KB
subtask1_14.txt 29 ms 800 KB
subtask1_15.txt 28 ms 920 KB
subtask1_16.txt 32 ms 716 KB
subtask1_17.txt 24 ms 800 KB
subtask1_18.txt 24 ms 924 KB
subtask1_19.txt 26 ms 812 KB
subtask1_20.txt 26 ms 804 KB
subtask1_21.txt 32 ms 800 KB
subtask1_22.txt 27 ms 928 KB
subtask1_23.txt 31 ms 776 KB