# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
375353 | muhi1112 | Sifra (COCI21_sifra) | C++17 | 1 ms | 512 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;
#define f1 first
#define s2 second
#define INF 99999999
#define ll long long
#define pb push_back
#define fri(a) freopen(a,"r",stdin)
#define fro(a) freopen(a,"w",stdout)
const int N=2e5+5;
string s;
set<int>sety;
void solve(){
cin>>s;
for(int i=0;i<s.length();i++){
if((s[i]%'a'>=48)){
if(i+1<s.length() && s[i+1]%'a'>=48){
if(i+2<s.length() && s[i+2]%'a'>=48){
sety.insert(((s[i]%'a')%48)*100+((s[i+1]%'a')%48)*10+((s[i+2]%'a')%48));
i+=2;
}
else{
sety.insert(((s[i]%'a')%48)*10+((s[i+1]%'a')%48));
i++;
}
}
else sety.insert(((s[i]%'a')%48));
}
}
cout<<sety.size()<<endl;
}
int main(){
//fri("in.txt");
//fro("out.txt");
solve();
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |