SIGSEGV error (C++)
Hi, I encountered a SIGSEGV error when I was attempting a problem. Here's the solution that I submitted. Could anyone explain what was wrong in my code?Please help me out. Thanks.
View ArticleHow to start programming?
Where should I start to learn programming? Any websites recommended? I heard C++ isn't a bad place to start. Help would be welcome.
View ArticleThree Stack Implemention Using an Array?
Hello everyone, I know how to efficiently use an array to implement two stack, Algorithm works as Put Top1 as -1 it means first stack will grow from Left to write and put Top2 as Max+1 , This(second)...
View ArticleKnapsack Problems?
What are your favourite knapsack problems? Please link them in the answer. I just learnt the algo and would like to get proficient in it. Thanks :D
View ArticleONP i think my logic is correct.... bt not gettng submittd.....need help
include<iostream>using namespace std; void push(char ch); char pop(); int top=-1; char infix[400]; char postfix[400],stack[400]; int p=-1; int priority(char symbol); int main() { int t;...
View ArticleHow to convert very long numbers (more specifically long double) to integers
HelloI was solving this question where a very large number 16^123 is involved. As I have a habit of 'seeing' everything as programming problems, I realized that if I can just calculate 16^123 which is...
View Articlewrong answer holes in text
#include<iostream> #include<stdio.h> #include<string.h> using namespace std; int main(){ int z[40],r,q,c=0; char p[100]; cin>>q; for( int i=0;i<q;i++){ gets(p); r=strlen(p);...
View ArticleError in Stacks program
I am getting a run-time error in my program. Here is the code:CODEThe program shows unknown values when you select the 3rd option. Please help. Thanks in advance.
View ArticlePRIME1: C++ not getting accepted although giving right answers
#include <iostream> #include <math.h> using namespace std; int main() { int t,i; long m,n,current,rootn,marker,markeris; scanf("%d\n",&t); while(t--) { scanf("%ld %ld",&m,&n);...
View Articleeditorials not updated completely
when will the editorials of the toughest 3 problems of NOV-13 challlenge be updated ?? Also when will the ratings be updated...when it gets delayed soo much all the interest goes off :(
View ArticleATM C Runtime Error
#include <stdio.h> #include <stdlib.h> int main() { int WDAMT; float BAL; scanf("%d",&WDAMT); scanf("%f",&BAL); if(WDAMT%5 ==0 && (BAL-WDAMT) >= 0.5){...
View ArticleSigma c-program
let's consider a set that will call sigma which consists of an integer sequence with the following properties a0=1 am=n a0<a1<a2......<am-1<am quelque soit k apartient [1,m] il existe...
View Articlebrute force pattern matching algorithm
in the brute force pattern matching algorithm when all the characters in the pattern are unique then brute force can be implemented in Big-oh(n) complexity where n is the length of the string(...
View ArticlePRETNUM - Editorial
PROBLEM LINK:PracticeContestDIFFICULTY:EASYPREREQUISITES:Prime factorization, SievePROBLEM:Find the number of integers in the given range which have prime number of divisors.QUICK EXPLANATION:Although...
View ArticleHelp with segment trees - query processing
Hello all,I am now attempting to solve the problem FLIPCOIN in the practice section, medium difficulty level.I am aware that a naive solution gets TLE... However, I also know that some sort of segment...
View Articleneed guidance in sums in triangle problem
hi i have been working on sums in triangle problem http://www.codechef.com/problems/SUMTRIAN i don't want to see the solutions i just want to know the basic approach behind it so that i can solve it...
View Articlesegment tree implimentation
void seg_ment(int node,int b,int e){ if(b==e){ segment_tree[node]=A[b]; } else{ int left=2*node,right=2*node+1; seg_ment(left,b,(b+e)/2); seg_ment(right,(b+e)/2 +1,e); int...
View ArticleNext Magic Number
The given problem is simple but even though couldn't solve it.Can someone help me with following problem...'4' and '7' as Magic numbers. The numbers containing only magic numbers are also magical....
View ArticleLucky Palindrome of November LunchTime
I am doing Lucky Palindrome question of November Lunch. http://www.codechef.com/LTIME06/problems/PALINDRI passed it for two sub task but then getting TLE. Editorial says we should use treap for...
View ArticleSUPERPLN - Editorial
PROBLEM LINKSPracticeContestDIFFICULTYEASYEXPLANATIONAt each step Dunno is in some city at some time. If Roly-Poly lives in this city and the start time of the birthday party is not less than the time...
View Article