Quantcast
Browsing all 39796 articles
Browse latest View live

advantage of using assert in program

i want to know that some programmer use assert in their program , is there any advantage of using assert while running the program on judge where all the constraints are defined and are guaranteed that...

View Article


ATM , Python Runtime Error ! Nzec

balance=int(raw_input()) while True: withdraw=int(raw_input())if withdraw <= 2000 and withdraw%5==0 and balance<=2000: if withdraw<balance: balance=(balance-(withdraw+0.50)) print "%.2f" %...

View Article


Holes in the text problem?

#include<stdio.h> int main() { char arr[100]; int t,i,j,count=0; scanf("%d",&t); for(j=0;j<t;j++) { scanf("%s",arr); i=0; while(arr[i]!='\0') {...

View Article

Suggest new features/updates for Codechef Ranking site

Hello most of you might be knowing about Codechef Ranking site : http://www.okrdx.com/DescriptionPluginFrom time to time the back-end and plugin was updated to suit the purpose of promoting...

View Article

Strongly Connected

Hey am stuck with this question .Please help me out :) http://www.codechef.com/problems/TUX02 Thnks in advance

View Article


ADIGIT time limit

I have no idea why my solution is exceeding the time limit. I've tried for pretty much hours. I even buffered the outputs. I tried saving all the possible answers in an array so that test cases would...

View Article

Regarding TLE in CNPIIM

Sir, I am getting TLE when I uploaded, but according to my test cases (2500 * 50) i.e all 50 cases consist of 2500, my output time was 0.5 s.I could not understand the problem,so please help.

View Article

my rating doesn't change

I have participied a lot of contests. But my rating does not change? I want to know why it does not change.

View Article


Storing the results of test Cases

Is it a good practice to store the results of various test cases in a array then giving the output so that the output becomes fast...The constraints being less which ensure that the results could be...

View Article


Memoization in C

Memoization is a very useful as well as often needed optimization technique.I implement this, using an extra array to store the results.Is there any more efficient way to achieve memoization in...

View Article

Quickest way to accept input

I am using Java. In most questions, one has to accept input like: 1 2 3 4 5 How do I accept "1 2 3 4 5" as array? Using Scanner? readLine()? Tokenizer? (i.e. which one is the fastest)

View Article

SIGSEGV runtime error in Shortest Path in Binary Trees

Could someone please tell me why this is giving me a runtime error (SIGSEGV).The problem is http://www.codechef.com/APRIL14/problems/BINTREE/Here is my code for this problem:...

View Article

initialising every elements of an array to 0 in c

At the time of declaration i can initialize every elements of an array to '0' in C using calloc() or statements like :int a[10]={0};but I want to reset all the elements to '0' after every iteration of...

View Article


partial points awarded for a few Contest problems

Hi all, I am relatively new to codechef competitions and had a question. I find that simetimes, even when a submitted solution is judged AC, the actual points awarded for that solution is not 1 but...

View Article

why getting wrong answer in the lead game

include<stdio.h>int main() { int n,i,si,ti,w,m=0,l; scanf("%d",&n); for(i=1;i<=n;i++) { scanf("%d %d",&si,&ti); if(si>ti) { l=si-ti; if(l>m) {m=l; w=1;} } else{ l=ti-si;...

View Article


Bytelandian gold coin - wrong answer why?

Here is my code, any help??include <stdio.h>int main(){ int i, num, a, b, c; scanf("%d", &num); long int coin[num], k[num]; for(i=0; i<num; i++)="" scanf("%d",="" &coin[i]);=""...

View Article

google code jam

i just went through the problem,and i am able to solve it easily. but i am not getting any idea how to deal with the bigger numbers(limit is set to (10^100)).problem description- a number that is a...

View Article


shortest distances

hello all, it would be great if someone tell me an efficient algorithm to this questionIf weight of an edge of a given graph is increased or decreased for which we already computed the shortest...

View Article

DFS for maze traversal

I am just starting to learn graphs...I am trying to implement a question.This question is a common one-There is a maze and there are 2 ppl in the maze- Jack and Robot..the robot can move only in all...

View Article

last digit sum-confusion

please can help me understand the editorial of lastdiglink: http://discuss.codechef.com/questions/4079/lastdig-editorial

View Article
Browsing all 39796 articles
Browse latest View live


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