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

Euler’s totient function???

Plz...can anyone explain me this and whats the use for it ..I have read the topcoder but could not understand it..

View Article


convex hull

can anyone suggest problems on convex hull.i want to practice it but cant find any questions... :-(

View Article


Lunch Time Ratings

Finally it is nice to see that ranking system for Lunch Time contest is also up. Hope that the ratings will be updated very soon :)Nice Initiative :) Keep Going CODECHEF :)

View Article

Lunch Time ratings now added on the profile.

Codechef has now started calculating the lunch time contests ratings and ranks. Check your profiles!

View Article

Help in Dynamic Inversion of June Lunchtime

The following solution is accepted as correct solution in the practice link of the question , But when i submitted the same Code during the contest with int inv=0; statement declared outside the while...

View Article


Wrong order Statistics Partition??

int partition(int *a,int low,int high,int index){if(low==high) return a[low]; if(low<high){ int temp,i=low,j=high,key=low; while(i<j){ while(a[i]<=a[key]&&i<high) i++;...

View Article

SMPAIR - Editorial

Problem link : contestpracticeDifficulty : CakeWalkPre-requisites : SortingProblem : Given a sequence a1, a2, ..., aN. Find the smallest possible value of ai + aj, where 1 ≤ i< j≤ NExplanationThis...

View Article

SUBQUERY - Editorial

Problem link : contestpracticeDifficulty : MediumPre-requisites : Suffix AutomatonProblem : Given a string S and N queries. Each query is defined by two integers - Li and Pi. Count the number of...

View Article


counting sort

http://www.geeksforgeeks.org/counting-sort/ Can we skip the step of making each c[i]=c[i]+c[i-1] and directly print all the elements from the c[i] originally produced ??like i did it below and it works...

View Article


NUMFACT - Editorial

Author: Vamsi Kavala Tester: Roman Rubanenko Editorialist: Bruno OliveiraPROBLEM LINKSPracticeContestDIFFICULTYCakewalkPRE-REQUISITESSimple Math, Integer FactorizationProblem:You are given a very large...

View Article

DYNAINV - Editorial

Problem link : contestpracticeDifficulty : SimplePre-requisites : Basic MathProblem : Maintain the number of inversions in the permutation (modulo 2), while performing swap operations.ExplanationAt...

View Article

why am i getting wrong answer,yet it is right on my local machine??(the...

include<stdio.h>include<stdlib.h>int comp(const void ,const void );int main(){ int i=0,t=0,n=0,j=0; long int arr[100]; // printf("enter the noo of test cases"); scanf("%d",&t);...

View Article

getting WA,plz check the code

problem:http://www.codechef.com/problems/RECIPE my solution:http://www.codechef.com/viewsolution/4163741

View Article


COPRIME3 - Editorial

Problem link : contestpracticeDifficulty : Easy-MediumPre-requisites : Möbius function, Inclusion-Exclusion PrincipleProblem : Given a sequence a1, a2, ..., aN. Count the number of triples (i, j, k)...

View Article

SHIRO - Time Complexity clarification

Can Someone Suggest Me why the O(100 * 10000 * 100) simple Knapsack Approach is Acceptable in 1 sec.my code: http://www.codechef.com/viewsolution/4164317Thanks.

View Article


TLE in FLIPCOIN

problem::http://www.codechef.com/problems/FLIPCOIN/ solution::http://www.codechef.com/viewsolution/4164335plz help I am again and again getting TLE

View Article

small factorials..why am i getting wrong answer for my code..? my code is...

include<stdio.h>int main() { unsigned long f=1; int t,i,j; scanf("%d",&t); int n[t]; for(i=0;i<t;i++) { scanf("%d",&n[i]); } for(i=0;i<t;i++) { for(j=1;j<=n[i];j++) { f=f*j; }...

View Article


holes in the text....i am not getting the right answer....what's wrong with...

include<stdio.h>include<string.h>int main() {int count=0,i,t,j; scanf("%d",&t); char str[100]; for(i=0;i<=t;i++) { gets(str); } for(i=1;i<=t;i++) { for(j=0;j<strlen(str);j++) {...

View Article

Book for java

Anyone can recommend a good book for programing in java. i know how to program in c/c++ also OOPS conceptsI am looking for a book which is easy to cover in short time and it should contain only...

View Article

CIELDIST - Editorial

PROBLEM LINKSPracticeContestDIFFICULTYCAKEWALKPREREQUISITESSimple math, Triangle inequalityPROBLEMWe have two markets S and T. We want to build two restaurants. The markets and restaurants can be...

View Article
Browsing all 39796 articles
Browse latest View live


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