solution : https://www.codechef.com/viewsolution/14313209 mistake : 1) for(i=1;i<=n;++i) cin>>a[i]; sort() sorts from a[0] to a[n1] and your input is from a[1] to a[n] 2) long min=a[n]; // I changed the array to operate from a[0] to a[n1] so min = a[n1] answered 23 Jun '17, 09:42

https://www.codechef.com/viewsolution/14313839 question: life the universe the everthing include <stdio.h>int main(void) { int i; while (1) { scanf("%d", &i); if (i == 42) break; printf("%d", i); } return 0; } answered 23 Jun '17, 11:56
1
You are not printing each number in new line. Add '\n' in printf statement.
(23 Jun '17, 12:25)
Thanks :)
(24 Jun '17, 11:39)

https://www.codechef.com/viewsolution/14319887 whats wrong with this code it says time limit exceeded answered 24 Jun '17, 12:17
First of all your array size if not according to constraint
(24 Jun '17, 13:17)
Also, your logic doesn't seem correct to me.Modify it.
(24 Jun '17, 13:17)
