Submission #515949

#TimeUsernameProblemLanguageResultExecution timeMemory
515949KoDSifra (COCI21_sifra)C++17
50 / 50
1 ms312 KiB
#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 timeMemoryGrader output
Fetching results...