# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
475104 | HossamHero7 | Sifra (COCI21_sifra) | C++14 | 1 ms | 204 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>
using namespace std;
typedef long long ll;
#define endl '\n'
void solve(){
string s;
cin>>s;
s += 'z';
int n = s.size();
ll ans = 0;
ll x = 0;
map <int,bool> mp;
bool m = 0;
for(int i=0;i<n;i++){
if(s[i] >= '0' && s[i] <= '9'){
x *= 10;
x += s[i]-48;
m = 1;
}
else if(m){
m = 0;
if(!mp[x]){
ans ++;
}
mp[x] = 1;
x = 0;
}
}
cout<<ans<<endl;
}
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int t=1;
// cin>>t;
while(t--){
solve();
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |