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

KFORK - can't find problem in code

Hey guys,I tried solving the KFORK problem in today's lunchtime. My algorithm is almost equivalent to the one given on the editorial for the problem. For some reason, it's not getting AC (passes only...

View Article


Turbo Sort Time Time Limit Exceeded Round 2

I tried using std::sort and std::vector and i'm still getting the time limit error. Perhaps using vectors isn't fast enough.include <iostream>include <algorithm>include <vector>int...

View Article


Turbo Sort Time Time Limit Exceeded

This program runs in under 5 seconds on Xcode. Could somebody please give me some advice as to why code chef might giving me this time limit error.include <iostream>using namespace std; int...

View Article

HOTEL - Editorial

PROBLEM LINKSPracticeContestDIFFICULTYEASYEXPLANATIONSeveral approaches exist to this problem. The simplest solution is to simply count the number of guests present at the hotel for each time from 0 to...

View Article

COOLING Problem

#include<stdio.h> #include<stdlib.h> int cnt,r[30],n,p[30]; void check(int pie) { int max=100,flag=0,index,i; for(i=0;i<n;i++) { if(r[i]>=pie&&r[i]<max) { index=i;...

View Article


Problem Code SNAPE - NZEC while using PHP

Solution Link I tried this simple problem using PHP and I get NZEC. I cant figure out what is the problem with my code. I think my code can easily handle the input data in the given limits. Any...

View Article

WSTRING - Editorial

Problem Link:PracticeContestDifficulty:EasyPre-requisites:Dynamic ProgrammingProblem:A W-String is defined as a string consisting of lower-case alphabets, and exactly 3 "#"s that divide the string into...

View Article

Encode n significant bits of a group of values

someone please help me here how it implemented in c/c++? Given an array of unsigned bytes of arbitary length. Each of these bytes are of n bits in resolution, which means value range lies between 0 and...

View Article


Tri-hexagonal problem

This has been the only problem I've truly been stuck on. For those who browse this thread, I already assume you know the problem, if not just look in the Easy section.Call me a bad coder but I cannot...

View Article


Wifi to Wifi communication for Android

Hello Guyzzz.. This is a paltform of talented Coder.. I hv jst 1 Question.. Is it possible to call wifi to wifi without internet Connection in Android? If yes then How is it possible?

View Article

Prize in contests

Hi all! i'm new here so, just wanted 2 noe: What are prizes/prize money for different contests in Codechef?

View Article

LEBOMBS WA

Problem link: http://www.codechef.com/problems/LEBOMBS/My solution: http://www.codechef.com/viewsolution/3800311I found the question quite straight forward and my logic seems quite alright to me. Yet I...

View Article

NUMGAME2 - Editorial

PROBLEM LINKSPracticeContestDIFFICULTYEASYEXPLANATIONFor this particular combinatorial game theory problem the the values of N for which the first player looses are 1,5,9,13,17,21,25 etc.SETTER'S...

View Article


Why do I get a Time Limit Exceeded?

Why my program keeps getting Time Limit Exceeded? What are some of the reasons of getting TLE?

View Article

IARCS judge showing wrong answer?

List of books is a problem I found in IARCS online problem archive. But their judge is showing wrong answer to my solution. I don't know what went wrong? Is my algorithm is totally a fail? or some...

View Article


weird behaviour of scanf

#include<stdio.h> #include<conio.h> void array(int * ,int ); int main() { int n,a[20]; printf("Enter the size of the array"); scanf("%d",&n); array(&a[0],n); } void array(int *j,int...

View Article

How to take input of an array in 1 line in C++?

How to take input of an array in one line? first line will be the size of the array. cin>>sizeofarray.then I want to take input of a[0]- a[n-1] on the same line like this: a[0] a[1] a[2]---- so...

View Article


Graph theory

Can anyone provide me with Graph theory material however except topcoder's i have read it and want some more. Thanx in advance.

View Article

unexpected runtime error

can someone please tell me why this code is giving runtime error sigsegv http://www.codechef.com/viewsolution/3801341 it's an atempt to solve the problem knight fork in lunchtime april 14

View Article

candle problem

whats wrong with code,can someone give me a testcase for which it does not work#include<stdio.h> #include<stdlib.h> int t,p,c[10],i,flag=0; int cnt=0,num; int main() { scanf("%d",&t);...

View Article
Browsing all 40121 articles
Browse latest View live


Latest Images

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