|
|
back to boardWhy I got W.A.? program ural1005; var s:array[1..400] of longint; i,j,k,l,c,max,total,a:longint; procedure init; begin read(k);total:=0;max:=200000; for i:=1 to k do begin read(s[i]);inc(total,s[i]);end; end; procedure main; begin c:=k;l:=0; for i:=1 to k do for j:=i+1 to k do begin l:=1;s[c+l]:=s[i]+s[j]; for a:=j+1 to k do begin inc(l);s[c+l]:=s[c+1]+s[a];end; inc(c,l); end; end; procedure printf; begin for i:=1 to c do begin k:=2*s[i]-total; if k<0 then k:=k*(-1); if k<max then max:=k; end; writeln(max:0); end; begin init; main; printf; end. It's wrong on test 1. why? Who can tell me the test datas ? My e-mail is tengfei_wei@yahoo.com.cn Re: Why I got W.A.? here 1 more: 10 1234 345 3453 567 2342 456 46 578 2344 567 My program said: 9, but yours - 83... Re: Why I got W.A.? Posted by Angor 4 Mar 2005 01:52 Why 9?! 1234+2342+46+2344 = 345+3453+567+456+578+567! Correct answer is 0, isn't it! Re: Why I got W.A.? Posted by Sni 2 Nov 2005 19:12 0 is true but my porgram said 1646:((((((( Re: Why I got W.A.? This is test must be for checked(Проверки, точно не знаю как на инглише)! My AC(!) program in this test say 246..... Re: Why I got W.A.? I have WA in test#1, but in this test I have answer 0! Edited by author 12.01.2007 17:43 |
|
|