Submission #375160

#TimeUsernameProblemLanguageResultExecution timeMemory
375160rinriSifra (COCI21_sifra)C++14
50 / 50
1 ms364 KiB
/* #pragma GCC target ("avx2") #pragma GCC optimize ("Ofast") #pragma GCC optimize ("unroll-loops") */ #include "bits/stdc++.h" #define iosb ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0) #define BIT(x) __builtin_popcount(x) #define all(x) x.begin() , x.end() #define F first #define S second #define pb push_back using namespace std ; typedef unsigned long long UL ; typedef long long L ; typedef string T ; typedef int I ; const I MaxN = 1e5+1 ; const I MOD = 1e9+7 ; const I inf = 2e9+7 ; const L INF = 2e18+7 ; int32_t main() { //freopen(".in" , "r" , stdin) ; //freopen(".out" , "w" , stdout) ; string s ; cin >> s ; set<string> st ; for(int i = 0 ; i < s.size() ; ++i) { if(s[i] >= '0' && s[i] <= '9') { string t = "" ; int j ; for(j = i ; j < s.size() ; ++j) if(s[j] >= '0' && s[j] <= '9') t+=s[j] ; else break ; st.insert(t) ; i = j-1 ; } } cout << st.size() ; }

Compilation message (stderr)

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