Lyndon's Golf Contest 1 P4 - Symbolic Ruby

View as PDF

Submit solution


Points: 0 (partial)
Time limit: 2.0s
Memory limit: 256M

Author:
Problem type
Allowed languages
Ruby

The evil Ruby overlord has taken you hostage. He agrees to let you go, but only if you are able to solve his puzzle:

Write me a Ruby program that reads a string s from STDIN, and outputs its length to STDOUT. You can only use symbolic characters in your code (!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~). In addition, your source code must be as short as possible.

Note: You may only submit to this problem in Ruby.

Input Specification

The first line of input contains a single string s (1 \le |s| \le 100). You may assume that s only contains printable characters.

Output Specification

Output on a single line, the length of s.

Scoring

Your score will be computed based on the length of your source code, the shorter the better. For an L-byte program,

  • if L \le 20, you will receive the full 100 points.
  • if 21 \le L \le 23, you will receive 80-10 \times (L-21) points.
  • if 24 \le L, you will receive \lfloor 2^{0.1(80-L)} \rfloor points.

Sample Input

Hello, World!

Sample Output

13

Comments

There are no comments at the moment.