"I want to ask a question" - Ask them all here!

@manoj09 try this testcase

1

m

No such element exception usually occurs when your input method isnt in context with given. Like, asking for an extra input, or not minding the white spaces.

Eg-

4 
and 
4

are different (highlight the text and notice the white space after 4. It can cause exception in java).

If this doesnt help, i will convert it into a question without delay. :slight_smile:

Regarding stars, you can find it here- A Star Studded Rating System | CodeChef

hey @olofmeister , can you help him get some details on that error. I think its due to negligence of white spaces or something like that. Your opinion? :slight_smile:

time limit and memory limit for a particular question in codechef(any problem may b practice or contest) can be found if u scroll down till bottom… @bobra der u can see details about author,tester,time limit,source code limit !!
happy coding:)

Just a small correction, memory limit is not the source limit. Usually memory limit is ~256 (or 512) MB. You can declare an array size upto 10^8 easily (~10^4 for 2-D array). (Array sizes of 10^9 give error as they take too much memory)

ohh im sorry nd tqq @vijju123

Thanks for helping him dear ^^

@vijju123 @manoj09 , i guess accessing direct elements such as ch[1], without knowing they have been initiated before may lead to a runtime error(i am not 100% sure, as this is a condition of SIGSEG too), but as u can see, u have directly used ch[1] and ch[ch.length-2] which wont be declared for string size of 1, and as expected it gives a runtime error on strings of length 1. I think that could be the case.

1 Like

thanks everybody …i got it

1 Like

Thank you. This will help a lot:D

question from chef and feast(NEO01)

again getting this error in my solution
https://www.codechef.com/viewsolution/14253104

works fine on online ide for custom input and my own ide for sample cases…
somebody pls help me out

I will say rather start from geeksforgeeks.org , most of the books will deal only with basics and you will need more than it. Also, give a search on forums, this question regarding books and notes are answered alot before.

Badges can be taken as “trophies” you get for some achievement. No, they dont affect karma in any way.

You could have created a Q yourself…You want me to convert it into a question??

TBH, seeing the pattern, i dont think the editorials will come out…But i see that community has been really helpful this time. Alot of questions are discussed actively and excellent approaches were given. You can refer those till then. :slight_smile:

What if the foo() function leads to true value, then it will print the reqiired result and return true which fails the condition given in main() and the program ends. Basically i want my code to print the result when foo() returns true, else continue to find a result if it return false. Please suggest some way to correct it.

Where are you getting this bug? If this would had been the case, you wouldnt get WA after 0.81s, but instantly at 0.00sec. Are you inserting input in correct format? In JAVA, inout is sensitivive to extra spaces and extra lines.

Thanks man :slight_smile: