记录编号 82324 评测结果 AAAAAAAAAA
题目名称 [USACO 1.1] 你的飞碟在这儿 最终得分 100
用户昵称 Gravatar甘罗 是否通过 通过
代码语言 Pascal 运行时间 0.002 s
提交时间 2013-11-23 12:36:40 内存使用 0.17 MiB
显示代码纯文本


program ride;
var
s:string[6];
a,b,c:longint;
begin
assign(input,'ride.in');
reset(input);
assign(output,'ride.out');
rewrite(output);
readln(s);
b:=1;
c:=1;
for a:=1 to length(s) do begin
    b:=b * (ord(s[a]) - 64);
end;
readln(s);
for a:=1 to length(s) do begin
    c:=c * (ord(s[a]) - 64);
end;
if (c mod 47) =(b mod 47) then
    writeln('GO')
else
    writeln('STAY');
close(input);
close(output);
end.