ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1102. Strange Dialog

VERY SIMPLE SOLUTION.
Posted by c_pp 8 Jan 2017 16:28
There only 10 situations!!!!!
//1. in
//2. input
//3. inputon
//4. inputone

//5. out
//6. output
//7. outputon
//8. outputone

//9. puton
//10. one

Check their in inverse order.

   bool check(char const* s){
        while(*s != '\n'){
               if (s == "one") s += 3;
              // there s == "one" only pseudocode, you may check
             //  as memcmp(s, "one",3) == 0
               else  // ......

               //.............

               // 10 times else
               else if (s == "in") s +=2;
               else
                  return false;
         }
        return true;
   }
Re: VERY SIMPLE SOLUTION.
Posted by Gazizbek 15 Jan 2017 17:37
Is it DFA?
Re: VERY SIMPLE SOLUTION.
Posted by Abid29 13 Oct 2020 00:29
thnx a lot  c_pp
atleast i learn something