I am getting correct answer for my code. But it still gives WA on submitting. Can you suggest the test case for which my code may fail. asked 03 Sep '12, 13:16

problem:ChefTown code: include<stdio.h>int a[400002]; int max(int,int); int main() { int n,w,maxp,p,q,count=0,i; long long int sum=0; scanf("%d",&n); scanf("%d",&w); for(i=0;i<n;i++) {="" scanf("%d",&a[i]);="" }="" for(i="0;i<w;i++)" sum+="a[i];" maxp="max(0,w);" p="a[0];" for(i="0;i<=nw;i++)" {="" if(sum="=(w*(w+1))/2+(w*(maxpw)))" count++;="" if(i!="(nw))" {="" sum="sum+a[i+w]p;" if(a[i+w]="">maxp) maxp=a[i+w]; else if(p==maxp) maxp=max(i+1,w+i+1); p=a[i+1];
} max(j,w){ int max=0,i; for(i=j;i<w+j;i++) {="" if(a[i]="">max) max=a[i]; } return max; } answered 03 Sep '12, 13:17
