Accepted
/usr/bin/ld.bfd: warning: /out/link.res contains output sections; did you forget -T?
代码
//uses math;
var n,m,i,num,ans:longint;
ch:char;
a,b:array[1..500000]of longint;
function max(a,b:longint):longint;
begin
if a>b then exit(a)
else exit(b);
end;
begin
readln(n,m);
for i:=1 to m do begin
read(ch); readln(num);
case ch of
'+':inc(a[num]);
'-':inc(b[num]);
end;
end;
ans:=0;
for i:=1 to n do
ans:=ans+max(a[i],b[i]);
writeln(ans);
close(input);
close(output)
end.