|
|
back to boardHere is my AC program Posted by Pimp 13 Oct 2005 17:27 var m,n,i,k:integer; begin readln(n,m);k:=0; for i:=n to m do if odd(i) then inc(k); writeln(k);readln; end. Re: Here is my AC program I'd say this is a brute force. Here is mine AC: var a,b,c:integer; begin readln(a,b); c:=(b-a+1) div 2; if (odd(b)) and (odd(a)) then inc(c); writeln(c); end. Re: Here is my AC program Why do you post your ACC programs here ? This is a bad practice. Edited by author 19.07.2006 16:22 Re: Here is my AC program Posted by KIRILL 18 Sep 2006 21:49 This is shorter b shr 1 - a shr 1 + b and 1 Re: Here is my AC program Posted by hhgff 6 Jul 2010 12:45 (b - a) / 2 + (a % 2 | b % 2) Re: Here is my AC program (b+1)/2-a/2 |
|
|