NEXTODD2 - Next odd extreme golf
Given an integer 1 <= N <= 10000, you have to print the next odd number.
Just one restriction you have to equal or better my best 14 bytes solution.
http://www.spoj.com/ranks/NEXTODD/
Score = source code length
Input
The input file consists of series of numbers one in each line. The input is terminated by EOF.
Output
The next odd number followed by a new line.
Example
Input: 5
2
6
17 Output: 7
3
7
19
hide comments
Alex Anderson:
2013-01-19 18:51:59
Being in classical doesn't mean "The problem isn't trivial." Imo, the focus is on the algorithm, not on minimizing code length. If SHORTEN problems were considered classical, there wouldn't be a SHORTEN contest on spoj in the first place. However, this doesn't mean I'm against lowering the source code limit, because for some problems you can hardcode the answers which is sometimes not intended.
|
|
Ehor Nechiporenko:
2013-01-19 18:51:59
For 14 bytes all problems except AWK could be removed.
|
|
Mohamed Maher:
2013-01-19 18:51:59
should be moved to challenge
|
|
SAHIL SAREEN:
2013-01-19 18:51:59
no possible solution in C/C++.. :C
|
|
(Tjandra Satria Gunawan)(曾毅昆):
2013-01-19 18:51:59
I think this problem is very good for Brainf**k, could you set it?
|
|
Mitch Schwartz:
2013-01-19 18:51:59
I'd say it's trivial if you know AWK reasonably well.
|
|
Mitch Schwartz:
2013-01-19 18:51:59
The best has been 10 for a long time http://www.spoj.com/SHORTEN/ranks/NEXTODD/
|
|
Alex Anderson:
2013-01-19 18:51:59
I'd prefer if this were in Challenge.
|
|
Aditya Pande:
2013-01-19 18:51:59
congrats XeRoN!X you are the first to solve this problem.
|
Added by: | Aditya Pande |
Date: | 2013-01-17 |
Time limit: | 1s |
Source limit: | 14B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |
Resource: | Golfing |