Submission #515949

# Submission time Handle Problem Language Result Execution time Memory
515949 2022-01-20T07:46:59 Z KoD Sifra (COCI21_sifra) C++17
50 / 50
1 ms 312 KB
#include <bits/stdc++.h>

using std::vector;
using std::array;
using std::pair;
using std::tuple;

int main() {
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(nullptr);
    std::string s;
    std::cin >> s;
    const int n = s.size();
    std::set<int> set;
    for (int i = 0; i < n;) {
        if (std::isdigit(s[i])) {
            int j = i;
            while (std::isdigit(s[j])) {
                j += 1;
            }
            set.insert(std::stoi(s.substr(i, j - i)));
            i = j;
        } else {
            i += 1;
        }
    }
    std::cout << set.size() << '\n';
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 0 ms 312 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 312 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 308 KB Output is correct
10 Correct 0 ms 312 KB Output is correct