×

 10 It was mentioned by the GIFTCHEF author @omelyanenko in the comment section on the problem page that the input string will consist of only lowercase english letters... but that was not the case... i submitted my solution https://www.codechef.com/viewsolution/12100766 assuming the same and i got WA . Out of intuition, when i submitted the same code by stripping the strings with side whitespaces after the contest got ended, i got AC. The accepted solution is https://www.codechef.com/viewsolution/12100864 . The only difference between the two solution is use of strip() function. What should i expect from Codechef for such blunders? asked 14 Nov '16, 15:48 3★ayush_aa 91●3 accept rate: 0% 0★admin ♦♦ 19.8k●350●498●541 2 Hey, We will have the problem setting panel look into this. They will take the necessary action. (15 Nov '16, 12:55) admin ♦♦0★

 12 The author himself gave the answer on the contest page. You must not assume that line endings are unix-style '\n', they may very well be "\r\n". Java and C++-programmers are quite lucky when using formatted input because redundant white space is ignored. In python you have to take care of this yourself. EDIT: What I'm trying to say is that this is not a blunder on the site of codechef, but it propably will happen again. Nevertheless this question obviously has its merits, because it's easy to forget about the different forms of line endings. But the issue of this thread should be learning about this pitfall, not complaining. answered 14 Nov '16, 17:02 7★ceilks 1.8k●9 accept rate: 36%
 10 Yes, the author mentioned that string consists of only lowercase letters. I also got many Wrong Answers while using python. So,I switched to C++ and got it Accepted. Codechef should keep a check on such blunder mistakes, it wastes time of the participants. answered 14 Nov '16, 16:37 4★atulac 183●7 accept rate: 16%
 4 I submitted around 60 WA's and in all of the subtasks, I got WA in one and AC in rest. It took me so much time, to realize that strings might not be all lowercase as mentioned. They carried a stepney "\n" at the end. strip() was required. answered 14 Nov '16, 16:25 21●2 accept rate: 0%
 4 @ceilks Sir, there is comment by the author @omelyanenko on the problem page as per which he says, "Strings consist of only lowercase English letters". A novice might get intuition to check for the alternative cases, but author's specific answer makes him think one way. I got many WA when i switched to C++ and knew that same logic worked in C++. answered 14 Nov '16, 17:19 4★atulac 183●7 accept rate: 16% 2 I was referring to the answer of the author further down in the thread. You are correct that it's pretty unfortunate for python users, but the authors first answer is also technically correct as the dangling "\r" is not part of the sring but of the representation of the line ending. (14 Nov '16, 17:42) ceilks7★
 2 It is high time that codechef should disclose the testcases after the contest or bring out something like "hackos" points of hackerrank. It really helps. answered 14 Nov '16, 16:46 3★ash_code 475●1●14 accept rate: 15%
 0 I too had this same problem, and just by intuition i did strip() and got everything correct. answered 14 Nov '16, 16:05 1 accept rate: 0%
 0 Going by the topic of discussion I thought the problem had wrong test cases. But for fomatting, I don't think it is correct to blame the problem setter(heck even icpc contests have such test files). It is up to the programmer to read what is required and be familiar with nuances of the language, at least i/o. answered 17 Nov '16, 10:03 5★noob333 104●1●4 accept rate: 0%
 toggle preview community wiki:
Preview

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported
• mathemetical formulas in Latex between \$ symbol

Question tags:

×1,070
×26

question asked: 14 Nov '16, 15:48

question was seen: 1,688 times

last updated: 17 Nov '16, 10:03