Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 39796

getting wrong answer

$
0
0
#include<stdio.h>
int main(){
    int n,c,t,k,a[100];
    long unsigned int candy;
    for(scanf("%d",&t);t>0;t--){
    scanf("%d%d",&n,&candy);
    for(k=0,c=0;k<n;k++) {scanf("%d",&a[k]); c=c+a[k];}
    if(candy<c) printf("No");
    else printf("Yes");}
    return 0;
}

Viewing all articles
Browse latest Browse all 39796

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>