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

xor sum ACM Amritapuri 2009

problemhow to find maximum xor of contiguous sub-sequence of array

View Article


small factorials - C code

what is wrong in this code??include<stdio.h>int main() { long int t,n,fact=1,i; scanf("%d",&t); for(n=0;n<=t;n++) { scanf("%d",&n); for(i=n;i>=1;i++)fact=...

View Article


Best known algos for calculating nCr % M

I have often encountered calculating nCr problems the last one being one of the IIIT-M problems but it probably had weak test cases that got easy solutions AC. The other one...

View Article

Help me with this TLE please...

I don't know why I'm getting TLE for this code : http://www.codechef.com/viewsolution/6605888So, I try the other way, then I got Wrong Answer : http://www.codechef.com/viewsolution/6606308Help me...

View Article

Broken Telephone

i don't understand the second simple.input: 5 1 3 1 1 1 output: 4 Example 2: First 3 players misheard the message or whispered it wrongly. help me,thank you.

View Article


Help me to solve this

Given two strings.You have to find number of strings of minimum length for which the two strings are subsequence. For exampleString 1-abString 2-baaba is one of the minimum length string

View Article

BIGO04-Editorial

Problem Link : PracticeContest Author:Amrutansu Garanaik , Abhishek Patnaik Tester: Keshow Sablaka, Amit Das Editorialist:Amrutansu Garanaik , Amit Kumar Sahu Difficulty : Easy Pre-requisite Graph...

View Article

Why we never see any problems based on calendrical calculations in sport...

In my 1 year of solving problems on codechef and spoj i have never hit upon a single problem that deals with Calendrical Calculations .Why do problem setters avoid creating problems dealing with...

View Article


Spoj giving me runtime error (NZEC) for CANDY - Candy I problem.

I am trying to code a simple problem in java available hereMy approach to solve it is , get the number of candy packets in count variable and number of candies in each packet in a array.My code is...

View Article


How does Tomohiko Sakamoto's Algorithm work? need details explanation

Following function represents Sakamoto's Algorithm from Wikipedia page- http://en.wikipedia.org/wiki/Determination_of_the_day_of_the_weekint dow(int y, int m, int d) { /* 1 <= m <= 12, y >...

View Article

holes, wrong answer.

include<stdio.h>int main() { int count = 0, counter = 0; char input; scanf("%d", &count); for (; count != 0; count--) { scanf("%c", &input); while (input != '\n') { scanf("%c",...

View Article

TEST - Editorial

PROBLEM LINK:PracticeAuthor:ADMINEditorialist:SUSHANT AGARWALDIFFICULTY:CAKEWALKPREREQUISITES:Basic looping,Basic Input/OutputPROBLEM:Rewrite small numbers from input to output. Stop processing input...

View Article

TASHIFT Error

I am using python. I don't think there is anything wrong with my algorithm. I am using z-algorithm to compute the values of longest prefixes of the string as A+B+B.(+means concatenation). I am new to...

View Article


CHEF AND HIS SECRET

Does anyone feel that there is a problem in the test cases of "Chef and his secret" (http://www.codechef.com/PSCD2015/problems/PSUDO2 ) from the contest Pseudo Code?

View Article

Output format of GOOGOL05

What is exactly the output format of laboratories-GOOGOL05 problem? Are there any spaces? If yes, how many?

View Article


Challenge Hunt - All programming challenges at one place

Hi all!We all love to participate in programming challenges, don't we? The only problem is that we are often not aware about the numerous online programming challenges that happen regularly and only...

View Article

Chef and Piano Scales Sample Test Cases Explanation

Can somebody explain the first and second test case given and meaning of the statement "Two plays differ if and only if they start at different keys or patterns are repeated different number of times."

View Article


TLE chef and interview (second subtask)

Hello!! Any body can help me? My code is working well for the first subtask:1 ≤ T ≤ 100 1 ≤ N ≤ 10^5So I declare T as int and N as long long where T is the number of test cases and N is the number to...

View Article

what is the problem in this code of c?

include<stdio.h>int main(void) { int T,i,j,N,A[1000]; int c=0; clrscr(); printf("enter the no. of test cases"); scanf("%d", &T); for(i=1;i<T;i++) { printf("enter no. of players");...

View Article

DIGJUMP - Editorial

PROBLEM LINK:PracticeContestTester:Shiplu HawladerEditorialist:Praveen DhinwaDIFFICULTY:EasyPREREQUISITES:bfs, dijkstraPROBLEM:Given a string s of N. You have to go from start of the string(index 0) to...

View Article
Browsing all 39796 articles
Browse latest View live


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