| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
Re:谁能告诉我输入2 1 3 是怎么赢的吗?具体步骤.......In Reply To:谁能告诉我输入2 1 3 是怎么赢的吗?具体步骤....... Posted by:tuhongguo at 2004-08-04 15:34:41 2 1 3
first :2 1 3--> 2 2 (第三堆丢2个移1个到第二堆)
second:2 2->必赢之道也(对方去几个我去另一堆的几个)
code:
program A_New_Stone_Game
const
inf='ANSG.in';
ouf='ANSG.out';
var
a :array[1..10000] of word;
n,ans:word;
f :text;
procedure init;
begin
assign(f,inf);
reset(f);
readln(f,n);
for n:=1 to n do readln(f,a[n]);
close(f)
end;
procedure out;
begin
assign(f,ouf);
rewrite(f);
writeln(f,ans);
writeln(f,0,0);
close(f);
end;
procedure work;
var m:longint;
begin
for n:=1 to n do inc(m,a[n]);
ans:=ord(odd(n) or (m mod 2)=0);
end;
begin
init;
work;
out;
end.
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator