help needed spoj..
i have been trying to solve this question since the last 2 days but am not able to get a good algo for this problem.can someone help me out in this one.?.http://www.spoj.com/problems/C1LJUTNJ/
View ArticleRuntime Error(NZEC) Factorial Trailing Zeros...
!/usr/local/bin/python2.7import sys num_list = [] try: n = int(raw_input()) except EOFError: sys.exit(0) for i in range(n): try: input_no = int(raw_input()) except EOFError: sys.exit(0)...
View ArticlePRIMEDST - Editorial
PROBLEM LINKSPracticeContestDIFFICULTYHARDPREREQUISITESFast Fourier Transform, Graph TheoryPROBLEMYou are given a tree with N nodes and exactly N-1 edges.Find the number of pairs of nodes in the tree...
View ArticlePython NZEC Runtime Error
import sys num = int(sys.stdin.readline()) while (num != 42): sys.stdout.write(num) num = sys.stdin.readline() Why does the above code give an NZEC runtime error?
View ArticleCOUNTPAL - Editorial
PROBLEM LINKSPracticeContestDIFFICULTYEASYEXPLANATIONThe problem can be solved easily by dynamic programming:F(i) = CountPal(s') for s' is the subtring of s[1]..s[i]so F(i) = sum of F(j) with j < i...
View ArticleCOUNTPAL query
Can some one write a better editorial for COUNTPAL .A bit in detail for novice programmer like me. Thanks before hand
View ArticleLongest Increasing Subsequence :get the sequence
I have learned about this LIS problem and even implemented the O(N^2) solution.However am having problem grasping how to return the actual subsequence itself,specially when the explanation goes like...
View ArticleSPOJ ARITH2 using ScriptEngineManager gives TLE. Please help.
Problem: http://www.spoj.com/problems/ARITH2/Solution 1: http://ideone.com/jdUYbdI know the problem can be done using switch case very easily,but I learnt about ScriptEngineManager recently and want to...
View ArticleWhat do you do when the number of test cases are not mentioned?
I tried solving the 'Chef & Integers' question in the September Challenge. But, in the sample input, they have not written anything about the number of test cases. I assumed that there would be...
View ArticleLooks like Scala compiler is misconfigured
Submission: http://www.codechef.com/viewsolution/2491335 result: /spoj/scala_compile: /opt/scala/bin/scalac: /usr/bin/env: bad interpreter: No such file or directory spoj: The program compiled...
View ArticleAND - Editorial
Problem Link:PracticeContestDifficulty:SimplePre-requisites:Binary Notation, Binary AND operationProblem:You are given a sequence of N integer numbers A. Calculate the sum of A[i] AND A[j] for all the...
View Articleruntime error(sigsegv) in chef and integers question
Actually my code is correct and it is not showing any errors in ideone.com .but here it is showing this error.need help.!!
View ArticleTwo subsequence with maximum sum
Maximum Absurdity this problem was asked in Codeforces Round #193 (Div. 2). Plz anyone tell me what is the approach for solving this problem?
View ArticleWhat is the criteria for choosing the Time Limits on a program?
I was trying to solve the CAO Stage 2 problem in the September Challenge. However, it shows that my solution timed out. The time limit for the problem is 1 secs and I got TLE. However, some submitted...
View Articlemy countryID
I belong to india and my username is "ahsas" but my account shows that the codechef server couldnt detect my country.... plzzzz help admin
View Articlestore xml in java data structure
Define a java data structure to store n number of files as defined below note that each file may contain millions of tags and each tag may contain millions of subtags.the aim of ds should be such that...
View ArticleError in code
The code is working fine on my system. Can you please what is the error in it? The code is of CAO stage-1 of September Challenge 2013
View ArticleRuntime error SIGSEGv
My code runs perfectly fine on the system, both geany(ied) and terminal. I even checked for the standard input output format, reading the inputs from a file and directing them to another output file....
View Articlewhy, getting compile time error? (its working fine in netbeans)
Main.java:8: error: class cool_guys is public, should be declared in a file named cool_guys.java public class cool_guys
View Article