Tutorial: How to solve problems
đ Welcome! This page will show you step by step how to use our platform and solve tasks.
Markov algorithm
The Rules is a sequence of pair of strings, usually presented in the form of pattern â replacement. Each rule may be either ordinary or terminating.
Given an input string:
- Check the Rules in order from top to bottom to see whether any of the patterns can be found in the input string.
- If none is found, the algorithm stops.
- If one (or more) is found, use the first of them to replace the leftmost occurrence of matched text in the input string with its replacement. If the rule just applied was a terminating one, the algorithm stops.
- Go to step 1.
Note that after each rule application the search starts over from the first rule.
Syntax
pattern:replacement â This is an ordinary rule. Replace first occurrence of pattern to replacement.
pattern::replacement â This is a terminating rule. Replace first occurrence of pattern to replacement and the algorithm stops.
- Empty string matches to the beginning of a string.
- Lines not containing
: are regarded as comments.
- Leading/trailing spaces in pattern/replacement are ignored.
- The number of replacements must not exceed 50000 times. The length of input string must not exceed 500 at any moment. The length of the code must not exceed 1000 including comments and blanks.
Editor
To write you Markov algorithm rules you can use our online editor.
You can use keyboard shortcuts:
- Ctrl + Enter â Run a code.
- Ctrl + Space â Step execution.
- Ctrl + R â Reset execution.
Submitting
After selecting one of the problems, you can submit your solution. It will be tested against a set of testcases. If all tests passes, you will get AC verdict. If some tests didn't pass, you will get one of the following verdicts:
- WA â Your code terminated but gave a wrong answer.
- TLE â Your code violated the limit on number of replacements.
- OLE â Your code violated the limit on length of a string.
- PD â Your solution is still being judged.
- CE â Your solution contains a syntax error. Probably multiple
: and :: on a single line.
Please note that the verdict shown is the verdict you received for the first test case that failed.
Ranking
For each problem you can see ranking. You can also check other's solutions.
âšī¸ In case of any problems with the site, contact administrators.