#include <iostream>
#include <map>
#define big long long
using namespace std;
struct node{
char type;
big x;
};
struct Ans{
big lst,ans;
};
map <node,Ans> m;
big n,xx,t,sum=0,maxn=-1;
char c;
int main()
{
scanf("%lld",&n);
node last;
for(big i = 1;i <= n;i++)
{
scanf("%c%lld%lld",&c,&xx,&t);
if(c == 'T' || c == 'F')
{
node now = {c,xx};
m[now] = (Ans){t-1,0};
if(m[now].lst == t-1)
{
m[now].lst++, m[now].ans++;
}
if(m[now].lst != t-1)
{
if(m[last].ans >= 3)
{
sum++, maxn = max(maxn,m[last].ans);
m[last].ans = 0;
}
m[now] = (Ans){t-1,0};
}
last = {c,xx};
}
}
printf("%lld %lld",sum,maxn);
return 0;
}
错误信息:
no match for 'operator<' (operand types are 'const node' and 'const node')