# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
375118 | IldarKA | Sifra (COCI21_sifra) | C++14 | 1 ms | 364 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;
string s;
int cnt;
int main(){
cin >> s;
bool ok = 0;
int san = 0;
vector < int > v;
for(int i = 0; i < s.size(); i++){
if(s[i] >= '0' && s[i] <= '9'){
san = (san * 10) + int(s[i] - '0');
if(!ok){
ok = 1;
}
if(i + 1 == (int)s.size()){
v.push_back(san);
}
}
else{
if(ok){
v.push_back(san);
san = 0;
ok = 0;
}
}
}
sort(v.begin(), v.end());
v.resize(unique(v.begin(), v.end()) - v.begin());
cout << v.size();
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |