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

LEBAMBOO - Editorial

PROBLEM LINK:PracticeContestAuthor:VitaliyTester:Jingbo ShangEditorialist:Ajay K. VermaDIFFICULTY:EASYPREREQUISITES:High school mathsPROBLEM:Given a set of N linear equations (of a very specific form)...

View Article


coins :using recursion

this is my program but i am unable to fix the bug. Can anybody help me figure this out.#include<stdio.h> int fun(int x); int main() { int test,n,y; scanf("%d",&test); while(test--) {...

View Article


Intuition behind this problem: DMS Mathematica

Referring to this problem , the answer seems to be n*n/2 - 1 (for n > 1) .Can someone explain the intuition behind this solution, or is it just guessed by observing some small inputs and outputs?

View Article

what is wrong in d code

include<iostream>using namespace std; int main() { int t,n,k,i; cin>>t; while(t--) { cin>>n>>k; if(n==1) { if(k==1) cout<<"1"<<endl; else...

View Article

Image may be NSFW.
Clik here to view.

SSTORY - Editorial

PROBLEM LINK:PracticeContestAuthor:Bruno OliveiraTester:Mahbubul HasanEditorialist:Jingbo ShangDIFFICULTY:MediumPREREQUISITES:Suffix Array, Suffix Automaton, Binary Search, HashPROBLEM:Find the longest...

View Article


FIXED POINT COMPUTATION

I know a little fixed point numbers....but i don't understand what fixed point computation is......and how fixed point computation is done on Context free grammar(CFG).

View Article

not able to locate error although program is running successfully on...

include<stdio.h>void sums(int arr[101][101],int n) { int i,j; for(i=n;i>0;i--) //going on the last element of last second line { //adding bigger element to it from the next two elements below...

View Article

WA in cipher AC in Decryption

I submitted a solution for Decryption(http://www.codechef.com/problems/CF01) and got AC : (http://www.codechef.com/viewsolution/3655596)I find the this problem similar to it Cipher...

View Article


need advise for improving running time

I'm new to codechef and also a beginner. I solved INTEST with this solution: http://www.codechef.com/viewsolution/3663846Its running time was nearly 5.6s. Some other solutions in C are taking very less...

View Article


Compiler confusion

I am new to codechef I used turbo C++ to write my codeand than uploaded the code but it didn't work.. Can anyone tell me which ompiler to use and send me ant download link..

View Article

DAILY - Editorial

PROBLEM LINKSPracticeContestEXPLANATIONIt's obvious that we can solve the problem for each compartment separately. Let's find the number of free places in a particular compartment, say Y. If Y> X...

View Article

PAIRING - Editorial

PROBLEM LINKSPracticeContestDIFFICULTYEASYEXPLANATIONA greedy strategy works here. Consider the pairs in the reverse of the order they appear. When considering a given pair, we greedily take it if...

View Article

BUY1GET1 - Editorial

Problem Link:PracticeContestDifficulty:CAKEWALKPre-requisites:Ad-hocProblem:You are given a set of jewels of different colors that you need to purchase. Buying a jewel of color k makes you eligible to...

View Article


LAZY PROPAGATION!!!(HORRIBLE SPOJ)

Was trying to solve http://www.spoj.com/problems/HORRIBLE/ with lazy propgation http://ideone.com/oSdgKp but could not get the logic of using the ""tree[node]+=val*(min(b,j)-max(a,i));"" as the code...

View Article

How to add bits/stdc++.h in Dev C++

I guess the #inlude<bits stdc++.h=""> is not present for Dev C++. Can anyone please help me out? Is there anyway in which we can do it manually?

View Article


Unable to resolve the SIGSEGV Runtime Error

Hey Guys, I am working on the problem LEBOMBS (http://www.codechef.com/problems/LEBOMBS).I don't know why I am getting a SIGSEGV. My code is: include<stdio.h>include<string.h>char...

View Article

killer problem

how to solve this sum?? Are all query related problems solvable by segment tree??

View Article


ABCSTR - Editorial

PROBLEM LINK:PracticeContestAuthor:Konstantin SokolTester:Gerald AgapovEditorialist:Tasnim Imran SunnyDIFFICULTY:SimplePREREQUISITES:Ad-Hoc, MapPROBLEM:Given a string S which is consisted of characters...

View Article

General infromation for Beginners .

This is the new blog .BlogMight help beginners as they are frequently used in programming competitions.

View Article

HOLES ,GETTING WRONG ANSWER

#include<stdio.h> #include<string.h> int main() { int t,i,J,c; char a[101],n=0; scanf("%d",&t); for(i=0;i<t;i++) { scanf("%s",a); c=strlen(a); J=0; n=0; for(J=0;J<c;J++) {...

View Article
Browsing all 40121 articles
Browse latest View live


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