Submission #1078617

# Submission time Handle Problem Language Result Execution time Memory
1078617 2024-08-28T00:17:49 Z vjudge1 Magnus (COCI18_magnus) C++17
50 / 50
3 ms 748 KB
#include <bits/stdc++.h>
using namespace std;
int main()
{
    string s;
    cin>>s;
    int x=0;
    bool xd=true;
    for (int i=0;i<s.size();i++){
        if (s[i]=='H'){
            for (int a=i;a<s.size();a++){
                if (s[a]=='O'){
                    for (int b=a;b<s.size();b++){
                        if (s[b]=='N'){
                            for (int c=b;c<s.size();c++){
                                if (s[c]=='I'){
                                    x++;
                                    i=c;
                                    xd=false;
                                    break;
                                }
                            }
                        }
                        if (xd==false) break;
                    }
                }
                if (xd==false) break;
            }
        }
        if (xd==false) xd=true;
    }
    cout<<x<<"\n";
}

Compilation message

magnus.cpp: In function 'int main()':
magnus.cpp:9:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    9 |     for (int i=0;i<s.size();i++){
      |                  ~^~~~~~~~~
magnus.cpp:11:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 |             for (int a=i;a<s.size();a++){
      |                          ~^~~~~~~~~
magnus.cpp:13:35: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   13 |                     for (int b=a;b<s.size();b++){
      |                                  ~^~~~~~~~~
magnus.cpp:15:43: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   15 |                             for (int c=b;c<s.size();c++){
      |                                          ~^~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 600 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 432 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 436 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 604 KB Output is correct
2 Correct 2 ms 604 KB Output is correct
3 Correct 2 ms 600 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 604 KB Output is correct
2 Correct 2 ms 604 KB Output is correct
3 Correct 2 ms 748 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 604 KB Output is correct
2 Correct 2 ms 604 KB Output is correct
3 Correct 2 ms 604 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 604 KB Output is correct
2 Correct 3 ms 600 KB Output is correct
3 Correct 2 ms 604 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 604 KB Output is correct
2 Correct 2 ms 604 KB Output is correct
3 Correct 3 ms 616 KB Output is correct