Submission #373264

#TimeUsernameProblemLanguageResultExecution timeMemory
373264rk42745417Sifra (COCI21_sifra)C++17
50 / 50
1 ms384 KiB
#include <bits/stdc++.h> using namespace std; #define EMT ios::sync_with_stdio(0); cin.tie(0); using ll = int64_t; using ull = uint64_t; using uint = uint32_t; using ld = long double; const int MOD = 1e9 + 7; const int INF = 0x3f3f3f3f; const ll LINF = 2e18; const double EPS = 1e-9; string proc(string s) { reverse(s.begin(), s.end()); while(s.size() > 1 && s.back() == '0') s.pop_back(); reverse(s.begin(), s.end()); return s; } signed main() { EMT string s; cin >> s; set<string> has; for(int i = 0, it = 0; i <= s.size(); i++) { if(i < s.size() && '0' <= s[i] && s[i] <= '9') { } else { if(it < i) has.insert(proc(s.substr(it, i - it))); it = i + 1; } } cout << has.size() << '\n'; }

Compilation message (stderr)

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