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

×

CHNUM problem

include<stdio.h>

int main() { int j,i,T; scanf("%d",&T);

for(j=0;j<t;j++) {="" int="" n;="" scanf("%d",&n);="" int="" s="0,s1=0,a[N];" i="0;" while(i<n)="" {="" scanf("%d",&a[i]);="" i++;}="" for(i="0;i&lt;N;i++)" {="" if(a[i]="">=0) s++; else s1++;

  }

<t;j++) {="" int="" n;="" scanf("%d",&n);="" int="" s="0,s1=0,a[N];" i="0;" while(i<n)="" {="" scanf("%d",&a[i]);="" i++;}="" for(i="0;i&lt;N;i++)" {="" if(a[i]="">=0) s++; else s1++;

  }

   if(s==N)
   printf("%d %d\n",N,s);

   else
    printf("%d %d\n",s,s1);
     }

return 0; } In this code// if(s==N) printf("%d %d\n",N,s); else printf("%d %d\n",s,s1); } works just fine but why the output as per the problem should be (largest possible,smallest possible) this does not include all possibilities?

asked 14 Mar, 12:47

tachyon_7's gravatar image

1★tachyon_7
1
accept rate: 0%

I saw you got AC. Do you still have doubts?

(2 days ago) akashbhalotia5★
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:

×163

question asked: 14 Mar, 12:47

question was seen: 36 times

last updated: 2 days ago