比赛 |
20120706 |
评测结果 |
AWAWWWWAAW |
题目名称 |
校草 |
最终得分 |
40 |
用户昵称 |
czp |
运行时间 |
0.000 s |
代码语言 |
Pascal |
内存使用 |
0.00 MiB |
提交时间 |
2012-07-06 11:14:39 |
显示代码纯文本
var
a,b,c,d,ra,rb,rc,rd,ans:array[1..100000] of longint;
i,j,m,n,t,sum,ct,l:longint;
begin
assign(input,'hjjhvf.in');reset(input);
assign(output,'hjjhvf.out');rewrite(output);
readln(n);
randomize;
for i:=1 to n do
begin
readln(a[i],b[i],c[i],d[i]);
ra[a[i]]:=i;
rb[b[i]]:=i;
rc[c[i]]:=i;
rd[d[i]]:=i;
end;
if n<=3333 then
begin
for i:=1 to n do
for j:=1 to n do
if i<>j then
begin
t:=0;
if ra[i]>ra[j] then inc(t);
if rb[i]>rb[j] then inc(t);
if rc[i]>rc[j] then inc(t);
if rd[i]>rd[j] then inc(t);
if t>=3 then begin ans[i]:=1; inc(sum); break; end;
end;
end else
begin
for i:=1 to n do
begin
for l:=1 to (10000000 div n) do
begin
j:=random(n)+1;
if i<>j then
begin
t:=0;
if ra[i]>ra[j] then inc(t);
if rb[i]>rb[j] then inc(t);
if rc[i]>rc[j] then inc(t);
if rd[i]>rd[j] then inc(t);
if t>=3 then begin ans[i]:=1; inc(sum); break; end;
end;
end;
end;
end;
writeln(sum);
for i:=1 to n do if ans[i]=1 then writeln(i);
close(input);close(output);
end.