×

 0 I am trying to solve remember the recipe problem. https://www.codechef.com/problems/TWSTR although i have written my codes and tested it on PC ,here it is giving WA.I have checked that whether my data types are correct or not.As per me they are correct.I think my solution is doing way more computation than required(this is my guess) .Plz check my code and help me so i could submit it correctly.This is my solution. https://www.codechef.com/viewsolution/17563758 asked 28 Feb '18, 12:26 0★jshobhit 1 accept rate: 0% 15.4k●1●20●66

 1 Your is_Word() function is wrong. It is returning true even for strings which are not. Try running your code in Codechef IDE, its printing fish with pepper for all queries in sample input. Basically the problem is here- if(input[i] == word[i]) { if(i==input.length()-1) { return true; } } else{ break;//Causes it to break out of loop skipping the return statement. return false; }  answered 28 Feb '18, 16:00 15.4k●1●20●66 accept rate: 18%
 0 https://www.codechef.com/viewsolution/17566611 .But i am still getting error answered 28 Feb '18, 19:39 0★jshobhit 1 accept rate: 0%
 0 hey. as you said i tried running my codes on codechef ide. And yes it is giving wrong answer,i don't know why , while running on my pc it is giving correct answer.What could be the reason,i mean how one code which running fine in my pc is giving wrong answer here. answered 28 Feb '18, 19:45 0★jshobhit 1 accept rate: 0% That means your code runs on undefined behaviour for some inputs. Happens due to array-out-of-bounds exception etc. Eg, in your isWord function, for(int i=0;i
 0 NEED HELP GUYS sorry i m posting it here but i don't have that much point to post a question a recent ICL2018 a queston called MATRIX GAME was there can anyone help me with that i can't find what i did wrong in my code. Please guyss Please.... Here's my code link : https://www.codechef.com/viewsolution/17567231 it's giving me wrong answer... ............ answered 28 Feb '18, 21:19 4★keshav_ 1●1 accept rate: 0% Very silly error. Input 1 1 1 0 Your Output Cyborg Expected Output Draw` Similar if matrix is all 0s. (28 Feb '18, 21:30) Thank you!! I haven't considered the case that it can be '0'. Thanks, @vijju123 (01 Mar '18, 09:03) keshav_4★
 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:

×3,764
×2,718
×1,070
×643
×123

question asked: 28 Feb '18, 12:26

question was seen: 225 times

last updated: 01 Mar '18, 09:03