You are not logged in. Please login at www.codechef.com to post your questions!

×

Doubt in Traverse problem of Innerve's summer code challenge.

Where this logic is giving wrong answer??? Traverse problem of innerve....

while(t--){
scanf("%d",&m);
if(m%3 == 0){
    printf("%d %d\n",m/3,2*(m/3));
}
else{
    double n=m;
    i=ceil(n/3);
    j=i-1;
    while(j<2*i){
        if(i+j == n)
            {
                goto label;
            }
            j++;
    }
    label:
    printf("%d %d\n",i,j);
}

} return 0;

asked 27 Jul '17, 16:36

jaina15's gravatar image

2★jaina15
32
accept rate: 0%

edited 01 Sep '17, 00:59


@jaina15 Your code is working fine. check out here: https://www.codechef.com/viewsolution/15220747 Just copy and paste.

link

answered 02 Sep '17, 18:10

mukul_vashisht's gravatar image

4★mukul_vashisht
16
accept rate: 10%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×3,820
×1,191
×890
×181

question asked: 27 Jul '17, 16:36

question was seen: 332 times

last updated: 02 Sep '17, 18:10