签到题

因为一个小细节考虑不到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. Linux 邮件服务

    三个要点 1.smtp协议 2.搭建本地邮件服务器 3.使用外部邮件服务器 实现邮件功能 1.smtp协议           SMTP(Simple Mail Transfer Protocol)即 ...

  2. 配置nginx代理服务器访问tomcat服务

    nginx原配置文件如下: #user nobody; worker_processes ; #error_log logs/error.log; #error_log logs/error.log ...

  3. OptaPlanner 7.32.0.Final版本彩蛋 - SolverManager之批量求解

    上一篇介绍了OptaPlanner 7.32.0.Final版本中的SolverManager接口可以实现异步求解功能.本篇将继续介绍SolverManager的另一大特性 - 批量求解. 适用场景 ...

  4. 标准 I/O 和管道

    1.标准输入和输出1>程序:指令+数据(指令服务于数据) 读入数据:input 输出数据:output 2>三种 I/O 设备 Linux 给程序提供三种 I/O 设备 标准输入(STDI ...

  5. Java @Deprecated Annotation(注解)

    在本部分的快速指南中,我们将会查看 Java 的 deprecated API 和如何在程序中使用 @Deprecated 注解. @Deprecated Annotation(注解) 作为程序的进化 ...

  6. C#设计模式学习笔记:(19)策略模式

    本笔记摘抄自:https://www.cnblogs.com/PatrickLiu/p/8057654.html,记录一下学习过程以备后续查用. 一.引言 今天我们要讲行为型设计模式的第七个模式--策 ...

  7. Python3标准库:itertools迭代器函数

    1. itertools迭代器函数 itertools包括一组用于处理序列数据集的函数.这个模块提供的函数是受函数式编程语言(如Clojure.Haskell.APL和SML)中类似特性的启发.其目的 ...

  8. Java中,一个存在了十几年的bug...

    本人免费整理了Java高级资料,涵盖了Java.Redis.MongoDB.MySQL.Zookeeper.Spring Cloud.Dubbo高并发分布式等教程,一共30G,需要自己领取.传送门:h ...

  9. 聊聊GIS数据的四个分层与GIS服务

    本篇不讨论矢量栅格数据的结构,也不讨论矢量与栅格的区别(即设定读者有这方面的基础). 版权声明:原创.博客园/B站/小专栏/知乎/CSDN @秋意正寒 转载请标注原地址并声明转载: https://w ...

  10. alpine安装telnet等工具

    alpine确实是很精简,但是对于熟悉了centos和ununtu的个人来说,实在是不习惯. 因此,记录关于alpine的一些包安装,以及操作细节(逐渐补充). 1. telnet >>& ...