Submission #780838

#TimeUsernameProblemLanguageResultExecution timeMemory
780838borisAngelovSifra (COCI21_sifra)C++17
50 / 50
3 ms320 KiB
#include <bits/stdc++.h> using namespace std; void fastIO() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); } int main() { fastIO(); string s; cin >> s; unordered_set<int> uniq; int curr = 0; for (int i = 0; i < s.size(); ++i) { if ('a' <= s[i] && s[i] <= 'z') { continue; } curr = curr * 10 + (s[i] - '0'); if (i == s.size() - 1 || ('a' <= s[i + 1] && s[i + 1] <= 'z')) { uniq.insert(curr); curr = 0; } } cout << uniq.size() << endl; return 0; }

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:23:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   23 |     for (int i = 0; i < s.size(); ++i)
      |                     ~~^~~~~~~~~~
Main.cpp:32:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   32 |         if (i == s.size() - 1 || ('a' <= s[i + 1] && s[i + 1] <= 'z'))
      |             ~~^~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...