- 寻宝
- 2015-12-26 13:12:42 @
type room=record
can:0..1;
num:longint;
end;
var i,j,k,l,m,n,up:integer;
sum,x:longint;
rx:array[1..10000,0..1000]of room;
tt:array[0..10000]of longint;
begin
readln(n,m);
for i:=1 to n do
for j:=0 to m-1 do readln(rx[i,j].can,rx[i,j].num);
readln(up);
for i:=1 to n do
begin
for j:=0 to m-1 do
if rx[i,j].can=0 then tt[i]:=tt[i]+1;
x:=rx[i,up].num;
sum:=(sum+x) mod 20123;
x:=x mod tt[i];
if x=0 then x:=tt[i];
l:=up-1;if l=-1 then l:=m-1;
while k<x do
begin
l:=l+1;if l=m then l:=0;
if rx[i,l].can=1 then k:=k+1;
end;
up:=l;
end;
writeln(sum);
end.
0分,这什么情况
1 条评论
-
WDS LV 9 @ 2016-01-10 15:34:13
ni cai
- 1