wrong ouptut using naive method also

Guys why Im getting wrong output for 3 test cases eventhough code is very simple and solution is intuitive.
Which corner case Im missing plz help me out.

problem link:-link text

My solution:-link text

Can’t see your code!! can you copy paste your code here?

Updated now plz can u find it

You are declaring mincgpa[n] and maxkt[n] before storing the total number of students in n (which is obtained as input).

scanf("%d",&n); will come first, then the declaration of the aforementioned arrays i.e. mincgpa[n] and maxkt[n].

1 Like