KAN13C - Editorial
PROBLEM LINK:PracticeContestAuthor: Dr. M Sohel Rahman Tester:Jingbo ShangEditorialist:Jingbo ShangDIFFICULTY:MediumPREREQUISITES:KMPPROBLEM:Given a string S[1..n], for each prefix of S[1..i],...
View ArticleCIELRCPT - Editorial
PROBLEM LINKPracticeContestDIFFICULTYCAKEWALKPREREQUISITESGreedy AlgorithmsPROBLEMYou need to find the representation of a given integer N as a sum of powers of two up to 211 with the smallest number...
View ArticleTRSUBTR - Editorial
PROBLEM LINK:PracticeContestAuthor:Vineet PaliwalTester:Roman RubanenkoEditorialist:Jingbo ShangDIFFICULTY:MediumPREREQUISITES:Encoding Trees to Strings, KMP, HashPROBLEM:Given an original labeled...
View ArticleNUMPATH - Editorial
PROBLEM LINK:PracticeContestAuthor:Vineet PaliwalTester:Roman RubanenkoEditorialist:Jingbo ShangDIFFICULTY:MediumPREREQUISITES:Dynamic Programming, Suffix Sum, Fenwick TreePROBLEM:Given a...
View Articlememory allocation
can codechef allocate 145M memory for the c program? i am getting an runtime error my code runs on ideone
View ArticleHandling large integers in C++???
While going through some successful submissions of Am I Fibonacci Number in COOK40, I have seen that some of them just use unsigned long long to store digits of the form of 1000 digits and still...
View ArticleTLE in RECTQUER
why my code for RECTQUER is giving TLE while same algorithm in c++ is executing in 0.98 sec??import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; import...
View ArticleWA in KAN13C
Can u explain why this code is giving WAinclude <stdio.h> include <stdlib.h> include <string.h> int main() { char str = (char ) malloc(4 * 1000000 * sizeof(char)); int asv = (int )...
View Articleicpc kanpur problem G
Can anyone please tell why my code is giving WA??? http://www.codechef.com/viewsolution/3099344
View Articlerun time error while printing strings.
Why this small simple code not giving the o/p. http://ideone.com/JAQr4U Also declaring the string like char left[4]={'0','0','0','0'}; gives rte!!http://ideone.com/ReyEq9 y so?? Its a part of one of my...
View ArticleCHODE - Editorial
PROBLEM LINK:PracticeContestAuthor:Vitalij KozhukhivskijTester:MahbubEditorialist:Jingbo ShangDIFFICULTY:CakewalkPREREQUISITES:Programming LanguagePROBLEM:Given a simple encryption method using the...
View ArticleInput String with spaces
How can I input a string in C with spaces. I know gets and scanf("%[^\n]s") are possible answers but they are not accepted by command line text input files with redirection operators. Plz answer?
View Articlegetting wrong answer ambiguous permutation help
include<iostream>using namespace std;int main(){int a[100000];unsigned long int b;unsigned long int c;unsigned long int x;unsigned long int l=0;while(b!=0){scanf("%d",b);if(b!=0){for(int...
View ArticleA tutorial on Suffix Arrays
Hello @all,This text will focus on the construction of Suffix Arrays, it will aim to explain what they are and what they are used for and hopefully some examples will be provided (it will be mainly...
View ArticleGetting WA on a cake-walk simple problem. Please help!!
I read the Editorial. It's basically the same thing. Still getting WA. I'm very confident that the code is correct :( Please please review. My life is at a standstill :(Problem:...
View ArticleMARBLES december long 2k13
can some one give a test case for which my program fails i tried many times while the contest was on. http://www.codechef.com/viewsolution/3066054
View ArticleUsing fflush gives WA
These two codes are the same: code1 and code2, the only difference being that I have used fflush(stdin) in the second code to omit the newline character while taking two strings as input one after the...
View Articleproblem creation of liste
#include<stdio.h> #include<stdlib.h> typedef struct cell cell; struct cell { int info; struct cell *suivant; }; int main() { cell *P,*liste; int n,i; printf("donner le nombre d'element");...
View ArticleHoles in the text..wrong answer..please help
Can someone please tell me what is wrong with this code. It always shows a wrong answer. Thanx in advance..Below is the code : -#include <iostream> #include <cstring> using namespace std;...
View ArticleKPRIME - Editorial
PROBLEM LINKPracticeContestDIFFICULTYSIMPLEPREREQUISITESSieve of EratosthenesPROBLEMA number is called a K-prime if it has K distinct prime factors.Find the number of K-prime numbers between some given...
View Article