Algorithm: Given an array, find all the pairs of elements whose sum is k.
algorithm for:-----Given an array, find all the pairs of elements whose sum is k.
View ArticleNZEC error in Sums in a Triangle - Python 2.7
I wrote the following code for the problem Sums in a Triangle. It is working in my computer but here on codechef I am getting NZEC. The input isn't that big then why this error?import sys from...
View ArticleTETRA : Wrong Answer
please help.......i'm getting wrong answer. i don't know wats wrong with the code . Here is the link to my solutionClick here
View ArticleDELISH - Editorial
Problem Link:PracticeContestDifficulty:SimplePre-requisites:Dynamic ProgrammingProblem:Given an array D[1...N], find max(abs((D[i] + ... + D[j]) - (D[k] + ... D[l])) : 1<= i <= j < k <= l...
View ArticlePERMUTE - Editorial
Problem Link:PracticeContestDifficulty:Medium-HardPre-requisites:ad-hoc, mathProblem:Given integers N and M, find how many permutations are there from 1 to N, such that the sum of adjacent numbers does...
View ArticleCylinder Editorial confusion
Could somebody please help me with the vertically aligned circles case when W/2 < H/(PI+1).As in the previous case we could then move circles a bit and this will allow us to increase D.How are we...
View ArticleCHEFGAME-WA
I was getting WA for CHEFGAME after implementing Prim as in the editorial.Could somebody tell where am I going wrong?Code
View ArticleCYLINDER - Editorial
ATTENTION!!!Before posting your query about asking for help make sure that your output for the case1 3 is0.2929480435159PROBLEM LINK:PracticeContestAuthor:Anton LunyovTester:Hiroto...
View ArticleCHEFGAME - Editorial
PROBLEM LINK:PracticeContestAuthor:Roman RubanenkoTester:Hiroto SekidoEditorialist:Anton LunyovDIFFICULTY:MEDIUMPREREQUISITES:Prim's algorithmPROBLEM:The best described in the problem statement.QUICK...
View ArticleWA in SPOJ: PLD
Here is this spoj Problemhttp://www.spoj.com/problems/PLD/i am using manacher's algorithm for finding palindromic substring but getting WA, can somebody tell where i am wrong?Here is link to my...
View ArticleHoles in a text- wrong answer
Here is my code. Please help with the error.import java.io.*; public class Main { public static void main(String args[])throws Exception { BufferedReader br=new BufferedReader(new...
View ArticlePackaging Cupcakes-Time limit exceeded error
I changed cin/cout to scanf/printf but still it gives me time limit exceeded error.Can someone please tell me how to rectify it?#include <stdio.h> #include <iostream> using namespace std;...
View ArticleAlgorithmic
Given n(<=10^5) stright lines,numbered from 1 to n, each of the form y = a*x + b where a and b is provided in the input.Now you are given 10^5 queries where we have to find the line whose y is...
View Articlereversing array for conversion to binary number
I'm looking to perform the decimal to binary conversion...how do I reverse the binary code stored in str[i], marked in asterisk so that I get the correct output ??#include <stdio.h> #include...
View Articlei have a virtual machine that runs on fedora and i dont have conio.h as a...
thank you for your help
View ArticleYahoo Hackathon DP Problem
There is a sequence of N random integers, which can contain any integer between -10 and 10 (both of which are inclusive). The task is to find the number of continuous sequences of integers such that...
View ArticleSubmission of a solution after an event ends
Please tell me where can I submit the questions asked in long event or cook-off after the event has ended.
View ArticleJune cook off 2013 Attic Crossing Problem
here is my code ..!import java.io.*;class Attic { public static void main(String args[])throws IOException { BufferedReader br=new BufferedReader(new InputStreamReader(System.in));int t,arr,days,max;...
View ArticleATTIC problem
Can u tell me whats wrong with the code below , the code is accepted but giving an execution time of 2.53 sec ! How can i optimize it ? Provide some tips !int main(){ int t ; cin>>t; getchar();...
View Article