| 比赛 | 不平凡的世界 | 评测结果 | WAWWWWWWWW | 
    | 题目名称 | 不平凡的boss | 最终得分 | 10 | 
    | 用户昵称 | darkness | 运行时间 | 1.384 s | 
    | 代码语言 | Pascal | 内存使用 | 0.15 MiB | 
    | 提交时间 | 2015-11-05 10:51:18 | 
显示代码纯文本
var n,i,j,k,tot,t:longint;
a,b:array[1..3] of longint;
function min(x,y,z:longint):longint;
var temp:longint;
begin
if x<y then temp:=x else temp:=y;
if (temp>z) then temp:=z;
exit(temp);
end;
function min1(x,y,z:longint):longint;
var temp,tt:longint;
begin
if x<y then  begin temp:=x; tt:=1;end
 else begin temp:=y;tt:=2;end;
if (temp>z) then begin temp:=z;tt:=3;end;
exit(tt);
end;
begin
assign(input,'playwithboss.in');
assign(output,'playwithboss.out');
reset(input);
rewrite(output);
tot:=0;
readln(n);
fillchar(b,sizeof(b),0);
for i:=1 to n do
begin
readln(a[1],a[2],a[3]);
j:=min(a[1],a[2],a[3]);
k:=min1(a[1],a[2],a[3]);
if (b[k]<j) then begin
inc(tot,j-b[k]);
b[k]:=j; end;
end;
writeln(tot);
close(input);
close(output);
end.