Submission #495224

# Submission time Handle Problem Language Result Execution time Memory
495224 2021-12-18T07:07:25 Z kappa Sifra (COCI21_sifra) C++14
40 / 50
1 ms 300 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;
            
            for (int j = i; j < strr.length(); j++)
            {
                if(isdigit(strr[j])){
                    temp += strr[j];
                }else{
                    i = j;
                    break;
                }
            }

            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:17:31: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   17 |             for (int j = i; j < strr.length(); j++)
      |                             ~~^~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 208 KB Output is correct
2 Incorrect 1 ms 292 KB Output isn't correct
3 Correct 0 ms 208 KB Output is correct
4 Incorrect 0 ms 208 KB Output isn't correct
5 Correct 1 ms 208 KB Output is correct
6 Correct 0 ms 208 KB Output is correct
7 Correct 1 ms 208 KB Output is correct
8 Correct 1 ms 288 KB Output is correct
9 Correct 0 ms 300 KB Output is correct
10 Correct 0 ms 208 KB Output is correct