Transform the Expression- ONP
I have been coding this code ONP and its giving me the correct answer on my compiler but a wrong answer here. Please someone help me to find the error in my code.include<stdio.h>int POP(char...
View ArticleDIVQUERY - editorial
Problem Link:PracticeContestauthor: Tasnim Imran Sunnytester: Roman Rubanenkoeditorialist: Utkarsh LathDifficulty:MediumPre-requisites:offline processing of queries, factorizing small...
View Article[closed]WA in BEENUMS SPOJ
problem: http://www.spoj.com/problems/BEENUMS/my solution: http://ideone.com/CvvsjO#stdinIf anyone could tell me the cause behind the WA,it would be really helpful. Thanks in advance.
View Articlehelp 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 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 ArticleNZEC PYTHON
D:\Python32import string t=1 st='fd' t=input() while(int(t) > 0): st=input() ctr=0 i=0 l=len(st) for i in range(0,l): if st[i]=='A' or st[i]=='D' or st[i]=='P' or st[i]=='O' or st[i]=='Q' or...
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 ArticleRuntime Error(NZEC) Factorial Trailing Zeros...
#!/usr/local/bin/python2.7 import 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 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 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 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 ArticleHow to start off with mathematics required for CodeChef problems
CodeChef problems seem to require a certain level of Mathematical proficiency. How can I prepare myself for the same? What all books can I read or what all links can refer 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 Article