Submission #1007980

# Submission time Handle Problem Language Result Execution time Memory
1007980 2024-06-26T04:36:12 Z vjudge1 Magnus (COCI18_magnus) Python 3
50 / 50
34 ms 3552 KB
def honiblock(word):
    word = word+"X"
    result = []
    target = "HONI"
    temp = ""

    wordcount = 0
    tempcount = 0

    while wordcount < len(word):
        if temp == target:
            result.append(temp)
            tempcount = 0
            temp = ""
        if word[wordcount] != target[tempcount]:
            wordcount += 1
        elif word[wordcount] == target[tempcount]:
            temp += word[wordcount]
            tempcount+=1
            wordcount+=1

    print(len(result))

honiblock(str(input()))
# Verdict Execution time Memory Grader output
1 Correct 11 ms 2908 KB Output is correct
2 Correct 10 ms 2760 KB Output is correct
3 Correct 15 ms 2796 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 10 ms 2908 KB Output is correct
2 Correct 10 ms 2756 KB Output is correct
3 Correct 10 ms 2988 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 11 ms 2908 KB Output is correct
2 Correct 10 ms 2908 KB Output is correct
3 Correct 10 ms 2908 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 10 ms 2908 KB Output is correct
2 Correct 10 ms 2908 KB Output is correct
3 Correct 10 ms 2908 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 10 ms 2908 KB Output is correct
2 Correct 10 ms 2828 KB Output is correct
3 Correct 10 ms 2908 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 26 ms 3420 KB Output is correct
2 Correct 27 ms 3420 KB Output is correct
3 Correct 26 ms 3420 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 27 ms 3420 KB Output is correct
2 Correct 34 ms 3460 KB Output is correct
3 Correct 26 ms 3500 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 26 ms 3412 KB Output is correct
2 Correct 24 ms 3420 KB Output is correct
3 Correct 27 ms 3420 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 25 ms 3420 KB Output is correct
2 Correct 25 ms 3420 KB Output is correct
3 Correct 27 ms 3412 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 27 ms 3420 KB Output is correct
2 Correct 28 ms 3420 KB Output is correct
3 Correct 26 ms 3552 KB Output is correct