Please tell me the logic for the code.
For eg. 2341 then we subtract the adjacent terms with each 2-3=1 2-4=1 4-1=3 then after subtracting we get :113 then we minus 1-1=0 1-3=2 that is the single term which is 2 this must be the answer....
View ArticleOutput is correct but getting wrong answer during submission.
http://discuss.codechef.com/problems/ERRORinclude<stdio.h>include<string.h>int main() { int i,t; scanf("%d",&t); for(i=1;i<=t;i++) { int len,j,k,l,flag=0,count1=0,count2=0,count3=0;;...
View Articlemy mergesort program does not perform sort what is the error i could not get it?
void merge(int L[],int R[],int A[]){ int nL=sizeof(L)/sizeof(L[0]); int nR=sizeof(R)/sizeof(R[0]); int i=0,j=0,k=0; while(i<nL && j<nR){ if(L[i]<=R[j]){ A[k]=L[i]; i++;} else{...
View Articlegetting runtime error in c(sigabrt)
https://www.codechef.com/viewsolution/18906525 getting runtime error in this question https://www.codechef.com/problems/CLFIBD.please help
View ArticleMajin Vegeta, VEGETA
I have tried this question, but I don't know why I am getting run time error. This is my source code: https://www.codechef.com/viewsolution/18906609 I am a beginner and I am stuck. Please help me...
View Articlequickmatch 10 coming soon with 3 hiring companies
This time we have 3 hiring companies and good ones, good coders working in them...Will update details once problems are ready. Readying it. https://www.codechef.com/KQ102018Edit: Codechef to share 250...
View ArticleCiel and A-B problem (why my solution is wrong?)
include <iostream>using namespace std; int main() { int A,B,p,q,dif; cin>>A >>B; dif=A-B; p=dif/10; if((dif%10)==9) q=(dif%10)-1; else q=(dif%10)+1;...
View Articleipc programming club june contest
www.hackerrank.com/june-contest we are organising a contest of 2 and half hours on 15th june at 9:00 pm ist to 11:30 pm ist on hackerrank.
View Articlesomebody pls explain the author soln for shkstr question of june challenge
link for author soln is https://s3.amazonaws.com/codechef_shared/download/Solutions/JUNE18/setter/SHKSTR.cpp
View ArticleCLFIBD - Editorial
PROBLEM LINK:PracticeContestAuthor:Avijit AgarwalTester and Editorialist:Soumik SarkarDIFFICULTY:CAKEWALKPREREQUISITES:Strings, SortingPROBLEM:Given a string $S$ find the frequency of each character in...
View ArticleNew blog for Competitive Programmers
Hey guys I have started a new blog. The first article is on dfs lowlinks . You can read it up here. Feel free to comment if anything is wrong or suggest any changes you want me to make. Also feel free...
View ArticleWRKWAYS - Editorial
Problem LinkPracticeContestAuthor:Noszály ÁronTester:Misha ChorniyEditorialist:Bhuvnesh JainDifficultyMEDIUMPrerequisitesFactroisation, CombinatoricsProblemYou are given $N$ workers and each of them...
View ArticleInvitation to CodeChef June Cook-Off 2018 sponsored by ShareChat!
Hello CodeChef Community!We’re happy to present to you another fresh set of challenges for your coding skills with the June Cook-Off 2018 sponsored by ShareChat. In addition, there are some exciting...
View ArticleNew channel for Data Structures and Algorithms.
https://www.youtube.com/channel/UCC1hzIV-nvdttUHfTP4UtzA?view_as=subscriber
View ArticleKrillin is dead AGAIN Problem Code
Can i get correct value of medium using this formula: 3median = 2mean + mode.Or i have to explicitly figure out through element wise compare.
View Articlewhy am i getting wrong in the problem? each time it's saing wrong output .i...
//also i have checked by breaking the whole program in different funtions.include<stdio.h>include<stdlib.h>void fun(); int i,j,k; char el;int main(){ int t;scanf("%d",&t);// taking the...
View Articlestring similarity
Suppose we are give two strings 'x' and 'y' of same length p (1 <= p <= 200000). Each string consists of atmost 3 distinct characters. These 3 distinct characters are same in both string. I want...
View ArticleData Structures and Algorithms
Hi all, I need your help to make a list of most used data structures and algorithms along with their tutorials, implementation and some problems on them. It will be helpful to everyone in many ways. I...
View ArticlePush unique array?
Please help me in this;Let's say I have n inputs $a_1$, $a_2$, $a_3$, $a_4$, $a_5$, ..., $a_n$ I have a vector vector<unsigned long long int> vWhat should I do if I do not want to input $a_i$ in...
View Articlekrillin is dead help
Can someone please tell me where I am wrong . Here is my code. I maintained 2 segment trees for maximum query and for sum query and then I found lower bound of prefix sum for the interval where my...
View Article