Quantcast
Channel: CodeChef Discuss - latest questions
Browsing all 40121 articles
Browse latest View live

prefix sum...help

i read rectangular query editorial....it is using a concept prefix sum...what kind of techinique is this??what is the advantage?why and for what kind of problems we use this technique?please help me to...

View Article


Cheating in December Long-DECORATE

These 2 submissions seem to be identical.@admin do have a look at it. PS:Both are in the top 20.http://www.codechef.com/viewsolution/3095229http://www.codechef.com/viewsolution/3068078

View Article


HORSES - Wrong Answer , C

My solution to the problem HORSES is here http://www.codechef.com/viewsolution/3107208But after repeated attempts, I am unable to figure out my mistake leading to the Wrong Answer. Can someone please...

View Article

HS08TEST (ATM) Python Runtime (NZEC) Error

I am new to python, and trying my luck on some easy problems first. I have checked my source code for various inputs (problem code HS08TEST, link: http://www.codechef.com/problems/HS08TEST) but unable...

View Article

HOLES - Editorial

PROBLEM LINKSPracticeContestDIFFICULTYEASYEXPLANATION You just simply need to do what is mentioned in problem statement. Just note that only letter “B” has two holes, and only letters “A”, “D”, “O”,...

View Article


can u please tell me why it is giving wrong answer for reign?

//http://www.codechef.com/problems/CHODEinclude<iostream>include<stdio.h>using namespace std;long long int max(long long int x,long long int y) { return (y > x)? y : x; }long long int...

View Article

can u please tell me what is wrong with this code it is giving right output....

//code of chef and codes //http://www.codechef.com/problems/CHODE #include<stdio.h> #include<stdlib.h> #include<iostream> using namespace std; void sort( long int arr[26][4]) { int...

View Article

Some Problems in the state of Codechef

TL;DR This site is starting to become really bad and unprofessional for no reason.-An open letter to Codechef administration, and all Codechef users-I joined Codechef almost two years ago. Since I'm a...

View Article


Unanswered question tab shows some answered questions

Hi everyone,Whenever I click on unanswered tab on discuss page, I see questions which are already have been answered. Is that a bug or am I missing something here?

View Article


How to solve DECORATE?

@all please discuss your approaches for the DECORATE question. I've gone through the Manacher's algorithm to find the number of palindromes.But after that how to solve the combinatorial problem?What I...

View Article

ALEXNUMB - Editorial

Problem: You are given an array of N numbers. You are to find the number of pairs of numbers in the array s.t a[i] < a[j].Solution: First you find the set of all distinct elements in the array...

View Article

SPOJ RRANGE

I am trying to solve this problem RRANGE but cannot get an efficient approach with segment trees. I know I have to build the segment tree for the difference sequence but am unable to frame the complete...

View Article

HLD segment/BIT

I read the QTREE6 editorial and honestly i have never solved any question of that type (related to tree queries) But the editorial is mainly about HLD but i wanna know how do you store the given tree...

View Article


Image may be NSFW.
Clik here to view.

RECTQUER - Editorial

PROBLEM LINK:PracticeContestAuthor:Roman RubanenkoTester:Gerald AgapovEditorialist:Jingbo ShangDIFFICULTY:EasyPREREQUISITES:Prefix sumPROBLEM:Given a N*N matrix of at most 10 different numbers, answer...

View Article

small factorials ! wrong answer but it is working just the right way in my...

include<stdio.h>include<string.h>include<iomanip>include<iostream>using namespace std; long double fact(int); int main() { int t,n,i=0;long double sol[100]; scanf("%d",&t);...

View Article


WA in SPOJ BYTESM2

problem link: http://www.spoj.com/problems/BYTESM2/my solution: http://ideone.com/xGffsfgetting wrong answer can't figure out why. please help.

View Article

INTEST ->> time limit exceeded ----- how to shorten time duration taken to...

//Problem code :: INTEST#include<iostream> using namespace std; int main() { int a,i=0,sum=0; long k,temp; cin>>a>>k; while(i<a) { cin>>temp; if(temp%k==0) sum=sum+1; i++; }...

View Article


SIGSEGV PCYCLE...can you tell me whats wrong with this code..thanks..

hi, here's the code #include<stdio.h> int main(void) { int n,p,j=1,count=0,i,arr1[1010],arr2[2010]; scanf("%d",&n); for(i=1;i<=n;i++) { scanf("%d",&arr1[i]); } for(i=1;i<=n;i++) {...

View Article

MARBLEGF - Editorial

PROBLEM LINKContestAUTHOR@kurumaTESTER@white_kingSOLUTIONThis is a trivial application of Fenwick tree. Those not familiar with Fenwick tree may look at the topcoder editorial available here.All this...

View Article

Changing bits-Hackerrank

Well I've been trying this question on www.hackerrank.com for the past 3-4 days but am still not getting the perfect score.The problem is that in my code http://ideone.com/kfql6T when I used unsigned...

View Article
Browsing all 40121 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>