Submission #366340

# Submission time Handle Problem Language Result Execution time Memory
366340 2021-02-14T03:29:37 Z CodePlatina Sifra (COCI21_sifra) C++14
50 / 50
1 ms 364 KB
#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>
#define pii pair<int, int>
#define piii pair<int, pii>
#define pll pair<long long, long long>
#define plll pair<long long, pll>
#define ff first
#define ss second
#define ee ss.ff
#define rr ss.ss
#define DEBUG

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    string s; cin >> s;
    vector<string> S;
    bool flag = false;
    for(auto c : s)
    {
        if('0' <= c && c <= '9')
        {
            if(flag) S.back() += c;
            else
            {
                S.push_back(string({c}));
                flag = true;
            }
        }
        else flag = false;
    }

    sort(S.begin(), S.end());
    cout << unique(S.begin(), S.end()) - S.begin();
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 364 KB Output is correct
2 Correct 0 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 0 ms 364 KB Output is correct
5 Correct 0 ms 364 KB Output is correct
6 Correct 1 ms 364 KB Output is correct
7 Correct 0 ms 364 KB Output is correct
8 Correct 0 ms 364 KB Output is correct
9 Correct 0 ms 364 KB Output is correct
10 Correct 0 ms 364 KB Output is correct