编译错误求助
  • 板块灌水区
  • 楼主XingnoYi
  • 当前回复5
  • 已保存回复5
  • 发布时间2023/9/4 21:43
  • 上次更新2023/11/2 22:43:18
查看原帖
编译错误求助
735797
XingnoYi楼主2023/9/4 21:43
#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')
2023/9/4 21:43
加载中...