# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1038280 | MrPavlito | Sifra (COCI21_sifra) | C++17 | 1 ms | 348 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |