签到题

因为一个小细节考虑不到wa了两次

// 一开始没这个if wa了。因为数据中存在同一帧(frame)一个相同的值出现多次,这样子同一个i 后面的同样的特征会把len重置为1

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int t;
int n;
struct val
{
int last;
int len;
void update(int t)
{
if (t == last + 1)
++len;
else if (t > last + 1) // 一开始没这个if wa了。因为数据中存在同一帧(frame)一个相同的值出现多次,这样子同一个i 后面的同样的特征会把len重置为1
len = 1;
last = t;
}
}; void work()
{
cin >> n;
map<pair<ll,ll>, val> m;
int k;
ll x,y;
int ans = 0;
for (int i = 1; i <= n; ++i)
{
cin >> k;
for (int j = 0; j < k; ++j)
{
cin >> x >> y;
auto it = m.find(pair<ll,ll>(x,y));
if (it == m.end())
{
m[pair<ll,ll>(x,y)] = val{i,1};
ans = max(ans,1);
}
else
{
it->second.update(i);
ans = max(ans,it->second.len);
}
}
}
cout << ans << endl;
} int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cin >> t;
while (t--)
work();
return 0;
}

ACM-ICPC 2018 徐州赛区网络预赛 Features Track的更多相关文章

  1. ACM-ICPC 2018 徐州赛区网络预赛 F. Features Track

    262144K   Morgana is learning computer vision, and he likes cats, too. One day he wants to find the ...

  2. ACM-ICPC 2018 徐州赛区网络预赛 G. Trace (思维,贪心)

    ACM-ICPC 2018 徐州赛区网络预赛 G. Trace (思维,贪心) Trace 问答问题反馈 只看题面 35.78% 1000ms 262144K There's a beach in t ...

  3. ACM-ICPC 2018 徐州赛区网络预赛 J. Maze Designer (最大生成树+LCA求节点距离)

    ACM-ICPC 2018 徐州赛区网络预赛 J. Maze Designer J. Maze Designer After the long vacation, the maze designer ...

  4. ACM-ICPC 2018 徐州赛区网络预赛(8/11)

    ACM-ICPC 2018 徐州赛区网络预赛 A.Hard to prepare 枚举第一个选的,接下来的那个不能取前一个的取反 \(DP[i][0]\)表示选和第一个相同的 \(DP[i][1]\) ...

  5. 计蒜客 1460.Ryuji doesn't want to study-树状数组 or 线段树 (ACM-ICPC 2018 徐州赛区网络预赛 H)

    H.Ryuji doesn't want to study 27.34% 1000ms 262144K   Ryuji is not a good student, and he doesn't wa ...

  6. ACM-ICPC 2018 徐州赛区网络预赛 B(dp || 博弈(未完成)

    传送门 题面: In a world where ordinary people cannot reach, a boy named "Koutarou" and a girl n ...

  7. ACM-ICPC 2018 徐州赛区网络预赛 B. BE, GE or NE

    In a world where ordinary people cannot reach, a boy named "Koutarou" and a girl named &qu ...

  8. ACM-ICPC 2018 徐州赛区网络预赛 H. Ryuji doesn't want to study

    262144K   Ryuji is not a good student, and he doesn't want to study. But there are n books he should ...

  9. ACM-ICPC 2018 徐州赛区网络预赛 I. Characters with Hash

    Mur loves hash algorithm, and he sometimes encrypt another one's name, and call him with that encryp ...

随机推荐

  1. 4.【Spring Cloud Alibaba】服务容错-sentinel

    雪崩效应 常见容错方案 超时 限流 仓壁模式 断路器模式 断路器三态转换 使用Sentinel实现容错 什么是Sentinel https://github.com/alibaba/Sentinel ...

  2. .net代码实现上千次ping的实现

    先上代码: 多线程实现ping校验: public void PingCameraNew(List<CameraMongoDto> assetlist) { ThreadPool.SetM ...

  3. OBS使用教程

    OBS使用教程 OBS使用教程:录屏热键的设置 视频:基础画布分辨率1920/1080 1366,768输出缩放分辨率常用FPS值 30或者60 输出:输出模式:高级录像:编码器x264码率控制 CB ...

  4. FIB表中 Next Hop 的几种状态码(drop/receive/attached/no route)的含义

    以一个例子来说明,假设有如下两个路由器R1,R2,且均配置了到达彼此环回地址的静态路由. (1.1.1.1/24)R1(Gig0/0)(.1)——12.0.0.0/24——(.2)(Gig0/0)R2 ...

  5. 剑指offer-面试题64-求1+2+...+n-发散思维

    /* 题目: 求1+2+3+...+n,要求不能使用乘除法.for.while.if.else.switch.case等关键字及条件判断语句(A?B:C) */ /* 思路: 递归. */ #incl ...

  6. tomcat下载页面多个版本区别

  7. CVE-2020-1938/CNVD-2020-10487 幽灵猫漏洞

    漏洞描述(后期跟进漏洞分析) Tomcat是由Apache软件基金会属下Jakarta项目开发的Servlet容器,按照Sun Microsystems提供的技术规范,实现了对Servlet和Java ...

  8. egg 提交数据 防csrf 攻击 配置

    await ctx.render('from',{csrf:this.ctx.csrf}); 或者 使用中间件 ctx.state.csrf = ctx.csrf;

  9. cf1176D

    题意简述:数组a经过一系列操作之后获得数组b,给你数组b,构造出一个满足条件的数组a 操作如下从左到右扫描数组a,如果是一个素数,那么把第这个素数的素数加到数组a中,例如a[1]=2那么加3到数组a当 ...

  10. 面试题32 - III. 从上到下打印二叉树 III

    面试题32 - III. 从上到下打印二叉树 III 请实现一个函数按照之字形顺序打印二叉树,即第一行按照从左到右的顺序打印,第二层按照从右到左的顺序打印,第三行再按照从左到右的顺序打印,其他行以此类 ...