Submission #199794

# Submission time Handle Problem Language Result Execution time Memory
199794 2020-02-03T12:51:13 Z zoooma13 Magnus (COCI18_magnus) C++14
50 / 50
12 ms 504 KB
#include <bits/stdc++.h>
using namespace std;

int main()
{
    string s ,f = "HONI";
    cin >> s;
    int idx = 0;
    for(int i=0; i<s.size(); i++)
        if(f[idx%4] == s[i])
            idx++;
    cout << idx/4 << endl;
}

Compilation message

magnus.cpp: In function 'int main()':
magnus.cpp:9:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i=0; i<s.size(); i++)
                  ~^~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 5 ms 256 KB Output is correct
2 Correct 5 ms 256 KB Output is correct
3 Correct 5 ms 380 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 256 KB Output is correct
2 Correct 5 ms 376 KB Output is correct
3 Correct 5 ms 256 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 256 KB Output is correct
2 Correct 5 ms 376 KB Output is correct
3 Correct 5 ms 252 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 376 KB Output is correct
2 Correct 4 ms 256 KB Output is correct
3 Correct 5 ms 256 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 256 KB Output is correct
2 Correct 5 ms 376 KB Output is correct
3 Correct 5 ms 256 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 10 ms 504 KB Output is correct
2 Correct 10 ms 504 KB Output is correct
3 Correct 10 ms 504 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 10 ms 504 KB Output is correct
2 Correct 10 ms 504 KB Output is correct
3 Correct 11 ms 504 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 10 ms 504 KB Output is correct
2 Correct 10 ms 504 KB Output is correct
3 Correct 10 ms 504 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 12 ms 504 KB Output is correct
2 Correct 10 ms 504 KB Output is correct
3 Correct 10 ms 504 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 11 ms 504 KB Output is correct
2 Correct 10 ms 504 KB Output is correct
3 Correct 10 ms 504 KB Output is correct