Search found 3 matches

by cunbidun
Sat Oct 24, 2015 7:27 am
Forum: Volume 4 (400-499)
Topic: 481 - What Goes Up
Replies: 82
Views: 14431

481 run time error

someone help me with my code plz i dont understand why it cause run time error #include <stdio.h> #include<string.h> #include<math.h> int main() { // freopen("lis.inp","r",stdin); int pred[1000],i,n,j,max=0,a[1000],s=0,l[1000],dmax,j0,x[1000],k,m,sa; i=1; while(scanf("%d",&sa)!=EOF) { a[i]=sa; i++; ...
by cunbidun
Sat Oct 24, 2015 5:30 am
Forum: Volume 106 (10600-10699)
Topic: 10684 - The jackpot
Replies: 34
Views: 19123

10684- WA

i dont understand why my code is WA #include<stdio.h> #include<string.h> int main(){ freopen("10684uva.txt","r",stdin); long int a[1000],n,i=1,t[10000],max=-999999,j,cc; t[0]=0; while(scanf("%lld",&n)==1) { if(n==0)break; for(i=1;i<=n;i++){ scanf("%d",&a[i]); t[i]=t[i-1]+a[i]; } /*for(i=1;i<=n;i++) ...
by cunbidun
Fri Oct 23, 2015 12:23 pm
Forum: Volume 1 (100-199)
Topic: 108 - Maximum Sum
Replies: 233
Views: 24186

Re: 108 - Maximum Sum

my code work fine with random test but when i submit still WA my code: #include<stdio.h> #include<string.h> int maxx(int a,int b){ if(a>b) return a; else return b; } int main(){ freopen("tongcn1.inp","r",stdin); //freopen("tongcn1.out","w",stdout); int n,a[125][127],i,j,s[127][127],max[127][127],max...

Go to advanced search