Submission #523253

#TimeUsernameProblemLanguageResultExecution timeMemory
523253tatoSifra (COCI21_sifra)C++14
50 / 50
1 ms296 KiB
#include <bits/stdc++.h> #define ll long long using namespace std; void answer() { string s; cin >> s; s += "a"; ll a = 0; if('0' < s[0] and s[0] <= '9') a = s[0] + 48; set < ll > st; for(int i = 1; i < s.size(); i++) { if('0' <= s[i] and s[i] <= '9') { a *= 10; a += (s[i] + 48); } else { if('0' <= s[i-1] and s[i-1] <= '9') { st.insert(a); a = 0; } } } cout << st.size(); } int main() { int t = 1; //cin >> t; while(t--) answer(); return 0; }

Compilation message (stderr)

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