Submission #475108

# Submission time Handle Problem Language Result Execution time Memory
475108 2021-09-21T08:09:22 Z Ahmed_Solyman Sifra (COCI21_sifra) C++14
30 / 50
1 ms 204 KB
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

bool isNum(char c){
    return (c>='1' && c<='9');
}
int main()
{
    string s;cin>>s;
    string t="";
    s+='a';
    bool b=0;
    set<string>st;
    for(ll i=0;i<s.size();i++){
        if(isNum(s[i]))t+=s[i],b=1;
        else if(b){
            b=0;
            st.insert(t);
            t="";
        }
    }
    cout<<st.size()<<endl;
    return 0;
}

Compilation message

Main.cpp: In function 'int main()':
Main.cpp:17:17: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   17 |     for(ll i=0;i<s.size();i++){
      |                ~^~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Incorrect 0 ms 204 KB Output isn't correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Incorrect 1 ms 204 KB Output isn't correct
8 Incorrect 1 ms 204 KB Output isn't correct
9 Correct 0 ms 204 KB Output is correct
10 Incorrect 0 ms 204 KB Output isn't correct