Submission #1038280

#TimeUsernameProblemLanguageResultExecution timeMemory
1038280MrPavlitoSifra (COCI21_sifra)C++17
50 / 50
1 ms348 KiB
#include <bits/stdc++.h> #define int long long #define pb push_back #define mp make_pair #define all(x) (x).begin(),(x).end() #define fi first #define sc second #define endl "\n" #define pii pair<int,int> using namespace std; const int MAXN = 1e5+5; const int mod7 = 1e9+7; const long long inf = 1e18; bool isnumber(char c) { if(c=='0')return true; if(c=='1')return true; if(c=='2')return true; if(c=='3')return true; if(c=='4')return true; if(c=='5')return true; if(c=='6')return true; if(c=='7')return true; if(c=='8')return true; if(c=='9')return true; return false; } signed main() { ios_base::sync_with_stdio(false),cin.tie(0), cout.tie(0); int tt=1; //cin >> tt; while(tt--) { string s; int n; cin >> s; n = s.size(); set<string> setic; for(int i=0; i<n; i++) { if(isnumber(s[i])) { int poz = i; while(i<n && isnumber(s[i])) { i++; } i--; string novi = s.substr(poz, i-poz+1); setic.insert(novi); } } cout << setic.size() << endl;; } }
#Verdict Execution timeMemoryGrader output
Fetching results...