|
|
back to boardWhat's wrong???? This is my solution. I have WA at 7-th test. Why? var i,n,hu,sa:integer; a:array[1..100]of integer; b:array[1..100]of string; begin read(n); hu:=3; sa:=10; for i:=1 to n do begin read(a[i]);read(b[i]); if b[i]=' hungry' then if a[i]>hu then hu:=a[i] else hu:=hu else if a[i]<sa then sa:=a[i] else sa:=sa; end; if hu<sa then writeln(sa) else writeln('Inconsistent'); end. Edited by author 23.02.2010 00:54 Re: What's wrong???? "Inconsistent" Re: What's wrong???? Thanks, but now I've got WA on 7-th test=(( Re: What's wrong???? Test: 1 3 satisfied Answer: 3 Re: What's wrong???? Why? russian: если по условию он минум от 3 остается голодным, а тут 3 наелся, это противоречие! Re: What's wrong???? In statement: "Попугай заведомо наестся десятью орехами и заведомо останется голодным, съев лишь два" Where do you see 3? Re: What's wrong???? Sorry Re: What's wrong???? Test #7 2 4 s 3 s Correct answer is 3, not 'Inconsistent' |
|
|