Submission #495225

# Submission time Handle Problem Language Result Execution time Memory
495225 2021-12-18T07:19:03 Z kappa Sifra (COCI21_sifra) C++14
50 / 50
1 ms 204 KB
#include <bits/stdc++.h>

using namespace std;

set<string> q;

string strr;

int main(){
    cin >> strr;

    for (int i = 0; i < strr.length(); i++)
    {
        if(isdigit(strr[i])){
            string temp;

            int j = i;

            while(j < strr.length())
            {
                if(isdigit(strr[j])){
                    temp += strr[j];
                }else{
                    break;
                }
                j++;
            }

            i = j;

            q.insert(temp);
        }
    }

    cout << q.size();
}

Compilation message

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