ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1327. Fuses

Here 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
Posted by Lutsenko 3 Feb 2006 15:59
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
Posted by Peter Petrov (Sedefcho) 19 Jul 2006 16:22
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
Posted by timur1992 7 Dec 2010 15:44
(b+1)/2-a/2