안녕하세요. 오늘은 이상한 암호코드를 만들 거예요.
https://www.acmicpc.net/problem/18129
#include <iostream>
#include <string>
#define ll long long
using namespace std;
string s;
ll num(ll idx)
{
    ll cnt = 0, i = idx;
    for (i; i < s.length(); i++)
    {
        if (s[i] == s[idx]) cnt++;
        else break;
    }
    return cnt;
}
char change(char c)
{
    if ('A' <= c && c <= 'Z') return c - 'A' + 'a';
    return c;
}
int main(void)
{
    ios_base::sync_with_stdio(false); cin.tie(NULL);
    ll K;
    cin >> s >> K;
    for (ll i = 0; i < s.length(); i++) s[i] = change(s[i]);
    ll len = s.length(), i = 0;
    bool ck[1010] = { 0 };
    while (i < s.length())
    {
        if (ck[s[i]])
        {
            i++;
            continue;
        }
        ck[s[i]] = true;
        ll N = num(i);
        if (N >= K) cout << 1;
        else cout << 0;
        i += N;
    }
}

감사합니다.