Главная » Статьи » Задачи с acm.timus.ru » Пакет решений на 15.03.08 |
1299
var a, b, x, y, z, p, q:longint; ch:char; function min (a, b:longint):longint; begin if a<b then min:=a else min:=b; end; begin Readln (a, b); Readln (ch); Readln (x, y, z); a:=min (a, 100); if ch='A' then Read (p, q); if ch='P' then Read (p); if (ch='P') then if (x>0) then ch:='D' else begin if abs (p)<20 then write ('FRONT ', a); if abs (p)>160 then write ('BACKWARD ', a); if ((20<=p) and (p<90)) or ((-90>p) and (p>=-160)) then write ('LEFT ', a); if ((-20>=p) and (p>=-90)) or ((90<=p) and (p<=160)) then write ('RIGHT ', a); end; if ch='D' then if (x>0) and ((x*20) >= b) then if abs (z)<5 then write ('FIRE ', min (20, b)) else write ('BACKWARD ', a) else ch:='G'; if ch='G' then begin if x=0 then write ('STOP') else begin if abs (z)<5 then write ('FIRE ', min (20, b)); if z>=5 then write ('LEFT ', a); if z<=-5 then write ('RIGHT ', a); end; end; if ch = 'A' then if (p*q)>3*(y*x) then if (x>0) and (abs(z)<10) then write ('FIRE ', min (20, b)) else write ('FRONT ', a) else if (x>0) and (abs(z)<5) then write ('FIRE ', min (20, b)) else write ('BACKWARD ', a); end. | |
Категория: Пакет решений на 15.03.08 | Добавил: solver (15.03.2008) | |
Просмотров: 1186 |