MM们谁能帮忙提供一下sgu 199 beautiful people 的测试数据?
来源:学生作业帮 编辑:大师作文网作业帮 分类:综合作业 时间:2024/11/10 18:55:26
MM们谁能帮忙提供一下sgu 199 beautiful people 的测试数据?
oi 竞赛,帮下忙,
oi 竞赛,帮下忙,
Const
InFile = 'p199.in';
OutFile = 'p199.out';
Limit = 100000;
Type
Tpoint = record
x , y , num , father : longint;
end;
Tdata = array[1..Limit] of Tpoint;
Tposition = array[1..Limit] of longint;
Var
data : Tdata;
position ,
num : Tposition;
N , answer : longint;
procedure init;
var
i : longint;
begin
// assign(INPUT , InFile); ReSet(INPUT);
read(N);
for i := 1 to N do
begin
read(data[i].x , data[i].y);
data[i].num := i;
end;
// Close(INPUT);
end;
procedure qk_pass(start , stop : longint; var mid : longint);
var
tmp : longint;
key : Tpoint;
begin
tmp := random(stop - start + 1) + start;
key := data[tmp]; data[tmp] := data[start];
while start < stop do
begin
while (start < stop) and ((data[stop].x > key.x) or (data[stop].x = key.x) and (data[stop].y < key.y)) do dec(stop);
data[start] := data[stop];
if start < stop then inc(start);
while (start < stop) and ((data[start].x < key.x) or (data[start].x = key.x) and (data[start].y > key.y)) do inc(start);
data[stop] := data[start];
if start < stop then dec(stop);
end;
mid := start;
data[start] := key;
end;
procedure qk_sort(start , stop : longint);
var
mid : longint;
begin
if start < stop then
begin
qk_pass(start , stop , mid);
qk_sort(start , mid - 1);
qk_sort(mid + 1 , stop);
end;
end;
function binary_search(y : longint) : longint;
var
st , ed ,
mid : longint;
begin
binary_search := 0;
st := 1; ed := answer;
while st data[i].y then
begin
num[step] := i;
position[step] := data[i].y;
end;
end;
end;
procedure out;
var
i , p : longint;
begin
// assign(OUTPUT , OutFile); ReWrite(OUTPUT);
writeln(answer);
p := num[answer];
for i := 1 to answer do
begin
write(data[p].num);
p := data[p].father;
if i = answer
then writeln
else write(' ');
end;
// Close(OUTPUT);
end;
Begin
init;
work;
out;
End.
你可以随机生成一些数据和这个程序对照
这个是AC的程序
InFile = 'p199.in';
OutFile = 'p199.out';
Limit = 100000;
Type
Tpoint = record
x , y , num , father : longint;
end;
Tdata = array[1..Limit] of Tpoint;
Tposition = array[1..Limit] of longint;
Var
data : Tdata;
position ,
num : Tposition;
N , answer : longint;
procedure init;
var
i : longint;
begin
// assign(INPUT , InFile); ReSet(INPUT);
read(N);
for i := 1 to N do
begin
read(data[i].x , data[i].y);
data[i].num := i;
end;
// Close(INPUT);
end;
procedure qk_pass(start , stop : longint; var mid : longint);
var
tmp : longint;
key : Tpoint;
begin
tmp := random(stop - start + 1) + start;
key := data[tmp]; data[tmp] := data[start];
while start < stop do
begin
while (start < stop) and ((data[stop].x > key.x) or (data[stop].x = key.x) and (data[stop].y < key.y)) do dec(stop);
data[start] := data[stop];
if start < stop then inc(start);
while (start < stop) and ((data[start].x < key.x) or (data[start].x = key.x) and (data[start].y > key.y)) do inc(start);
data[stop] := data[start];
if start < stop then dec(stop);
end;
mid := start;
data[start] := key;
end;
procedure qk_sort(start , stop : longint);
var
mid : longint;
begin
if start < stop then
begin
qk_pass(start , stop , mid);
qk_sort(start , mid - 1);
qk_sort(mid + 1 , stop);
end;
end;
function binary_search(y : longint) : longint;
var
st , ed ,
mid : longint;
begin
binary_search := 0;
st := 1; ed := answer;
while st data[i].y then
begin
num[step] := i;
position[step] := data[i].y;
end;
end;
end;
procedure out;
var
i , p : longint;
begin
// assign(OUTPUT , OutFile); ReWrite(OUTPUT);
writeln(answer);
p := num[answer];
for i := 1 to answer do
begin
write(data[p].num);
p := data[p].father;
if i = answer
then writeln
else write(' ');
end;
// Close(OUTPUT);
end;
Begin
init;
work;
out;
End.
你可以随机生成一些数据和这个程序对照
这个是AC的程序
MM们谁能帮忙提供一下sgu 199 beautiful people 的测试数据?
帮忙发一下东海的《beautiful》的mp3格式
请帮忙提供一下情侣间表示歉意的古诗词,
总图工艺外管的英文请帮忙提供一下.
帮忙计算一下热镀锌方管的重量 120mm*60mm*5mm 长度为1米,谢谢
请帮忙分析一下这个句子的成分:the beautiful garden planted with so many nic
帮忙算一下8mm的钢板,割成122mm的圆,然后中间再去掉50mm的圆,剩下的钢板是多重?
50mm厚、75mm厚、100mm厚的岩棉夹芯板分别用那种型号的自攻螺钉?请大家帮忙回答一下,谢谢
不等边直角三角形直角边长分别是6MM和3MM斜边长7MM求大神帮忙算一下另外两个角的度数谢谢
求Cher Lloyd 的beautiful people 歌词
请帮我翻译一下以下的英文:Only few people know that life is beautiful for
多组测试数据的c语言问题