/ SB域 /

记录详情

Accepted

/usr/bin/ld.bfd: warning: /out/link.res contains output sections; did you forget -T?
# 状态 耗时 内存占用
#1 Accepted 0ms 200.0 KiB
#2 Accepted 0ms 256.0 KiB
#3 Accepted 0ms 256.0 KiB
#4 Accepted 76ms 1.0 MiB
#5 Accepted 74ms 1.0 MiB
#6 Accepted 63ms 1.078 MiB
#7 Accepted 61ms 1.105 MiB
#8 Accepted 77ms 1.0 MiB
#9 Accepted 60ms 1.102 MiB
#10 Accepted 66ms 1.113 MiB

代码

//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.

信息

递交者
类型
递交
题目
最讨厌了
题目数据
下载
语言
Pascal
递交时间
2017-08-22 15:56:17
评测时间
2017-08-22 15:57:52
评测机
分数
100
总耗时
480ms
峰值内存
1.113 MiB