Boolean

View as PDF

Submit solution


Points:4
Time limit:2.0s
Memory limit:64M
Author:

Problem type

A boolean value can be either True or False. Given a string with less than 1000 characters with a number of space-separated not directives terminated by a True or False value, evaluate the boolean expression.

Sample Input 1

not not True

Sample Output 1

True

Sample Input 2

not not not False

Sample Output 2

True

Report an issue

Comments


  • -2
    root
     commented on June 22, 2017

    Never thought I'd ever see a problem where the assembly solution is shorter than C++.


  • -4
    println_hi_
     commented on Oct. 20, 2016
    Restriction?

    You might want to ban the use of pythons exec and eval


    • 2
      Xyene
       commented on Oct. 20, 2016

      The format the input is given in is not a coincidence.


  • 2
    richardyi25
     commented on March 5, 2016
    Python

    This problem might be a bit easy in Python


    • 0
      Kirito
       commented on March 5, 2016

      Python 2, that is. Python 3 still requires work.


      • -2
        richardyi25
         commented on March 6, 2016

        You can still do it in one line on Python 3 :)


        • 0
          AceWrecke
           commented on Sept. 26, 2017

          Technically you can do it with 0 lines on python


        • 1
          Kirito
           commented on March 6, 2016

          Right. Python's an interpreted language. Gotta remember that.

          On an unrelated note, I wonder if I can get AHK to solve equations by highlighting them using the same idea? Would save me so much time.


      • 2
        moladan123
         commented on March 6, 2016

        Not if you know the right shortcut ;)