We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- All Contests
- HourRank 9
- Fair Rations
- Discussions
Fair Rations
Fair Rations
Sort by
recency
|
23 Discussions
|
Please Login in order to post a comment
If Bi can go beyond 10 then why they have mentioned 1<=Bi<=10. Because of that I thought Max loaves that one subject can have was 10.
//MY SOLUTION
import java.io.; import java.util.; import java.text.; import java.math.; import java.util.regex.*;
public class Solution {
}
Hey, why no gaming reference in this problem?
well, I didnot sign up for this contest. And I did this in a tricky way.
View the submission at
https://www.hackerrank.com/contests/hourrank-9/challenges/fair-rations/submissions/code/6009102
int main() { int N,i,l=0;; int B[100]; printf("enter no of people in a row"); scanf("%d",&N); printf("enter of loafs given to each individual"); for(i=1;i<=N;i++) { scanf("%d",B[i]); } for(i=1;i<=N;i++) { l=l+(B[i]/N); } if(l%2==0) { printf("%d",l); } else{ printf("NO"); } return 0; } after submitting it shows segmentation fault at each case what is segmentation fault????