Spoj/codechef..next palindrome
Guys..i am trying to solve this question and i have checked for many testcases but i can't figure out where my code is failing exactly..any idea??Here is a link to my solution :...
View ArticleSPOJ Brackets
Can anybody tell me how to build segment tree for this problem?? what all properties should it contain?? I am not able to figure it out.. http://www.spoj.com/problems/BRCKTS/
View ArticleSTONES Wrong Answer
My code looks correct. Its giving WA. Can someone help?#include<iostream> using namespace std; int main() { int t; cin >> t; while(t--) { char a[110] = "", b[110] = ""; int...
View Articleclarification of question LEBALON
for a given color if there are two possibilities....do we have to consider both or the least one.12 11 101 40is the answer ((10)+(40)+(40+10))/3=100/3=33.3333333 or is the answer 10 just beacause it is...
View ArticleTSORT..why run time error..??
i declared array[1000000] inside main..it gave runtime error but when declared gobally it worked..why so..??
View Articlefactorial problem in c - "wrong answer"
i checked every input. Its giving the right output but the judge says "wrong answer". Whats wrong with it?include <stdio.h>include <stdlib.h>include<math.h>int power(int);int main() {...
View Articlecalculating the age of employees in year,month and days from their date of birth
I have been given an employee's date of birth and i have to find his age till current date in years, months and days. How to do so?
View ArticleCHEFBRO - Editorial
PROBLEM LINKSPracticeContestDIFFICULTYEASYEXPLANATIONThe problem saw a lot of successful submissions with mostly the same approach(but different implementations).This problem is a simple application of...
View Articleunderstanding segment tree
Hello guys, I need a little help implementing and understanding segment tree data structure. I have read many online tutorials and I understand the concept pretty well. But when comes to implementing...
View ArticleTest locally
How do I test my program on local machine with a provided input file. Many contest (like Google CodeJam) provide a input file and you have to submit the output file as well as the source code. So,...
View ArticleLittle Elephant and Bombs
#include<stdio.h> int bomb_calculator(char a[],int n) { int i=0,remaining=0; for(i=1;i<n-1;i++) { if(a[i]=='1') { a[i]=a[i-1]=a[i+1]='e'; } } if(a[0]=='1') a[0]=a[1]='e'; if(a[n-1]=='1')...
View ArticleJAVA PRIME GENERATOR PROBLEM
MY QUESTION=www.codechef.com/problems/PRIMEMY SOLUTION=http://www.codechef.com/viewsolution/4573034TYPE OF ERROR=TIME LIMIT EXCEEDED`PLZ EXPLAIN MY MISTAKE AND DEBUG MY CODE
View ArticleEQUAKE - Editorial
PROBLEM LINK:PracticeContestAuthor:Pavel SheftelevichTester:Praveen Dhinwa and Hiroto SekidoEditorialist:Lalit KunduDIFFICULTY:Medium PREREQUISITES:Segment Trees/Lazy PropagationPROBLEM:Rotation by...
View ArticleC language project
I am a student & findin' new topics for project in C language. Will anyone please guide me about an innovative project idea ?? I've seen number of topics but they are common & repetitive, will...
View Articleplease help me with this factorial problem
i check every input. Its giving the output but the judge says "wrong answer". Whats wrong with it?include <stdio.h>include <stdlib.h>include<math.h>int power(int); int main() { int...
View ArticleC FACTORIAL PROBLEM
MY QUESTION=http://www.codechef.com/problems/FCTRL2/MY SOLUTION=http://www.codechef.com/viewsolution/4571855TYPE OF ERROR=WRONG ANSWERPLZ EXPLAIN MY FAULT AND DEBUG THE CODE
View Articleatm problem need help
#include <stdio.h> #include <stdlib.h> #ifndef BANK_CHARGE #define BANK_CHARGE 0.5 #endif; int main (int argc, char **argv){ // if(argc != 3){ // printf("Usage: %s [int] [float]\n",...
View ArticleFROGV - Editorial
PROBLEM LINK:PracticeContestAuthor:Dmytro BerezinTester:Shang Jingbo and Gerald AgapovEditorialist:Devendra AgarwalDIFFICULTY:SIMPLEPREREQUISITES:Basic Dynamic Programming PROBLEM:Given Frog's location...
View Articlecleaning up test cases
http://www.codechef.com/viewsolution/4572925 plz give me some test cases at which my code is giving wrong answer
View Article