ACM-ICPC 2018 徐州赛区网络预赛 Features Track
签到题
因为一个小细节考虑不到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的更多相关文章
- ACM-ICPC 2018 徐州赛区网络预赛 F. Features Track
262144K Morgana is learning computer vision, and he likes cats, too. One day he wants to find the ...
- ACM-ICPC 2018 徐州赛区网络预赛 G. Trace (思维,贪心)
ACM-ICPC 2018 徐州赛区网络预赛 G. Trace (思维,贪心) Trace 问答问题反馈 只看题面 35.78% 1000ms 262144K There's a beach in t ...
- ACM-ICPC 2018 徐州赛区网络预赛 J. Maze Designer (最大生成树+LCA求节点距离)
ACM-ICPC 2018 徐州赛区网络预赛 J. Maze Designer J. Maze Designer After the long vacation, the maze designer ...
- ACM-ICPC 2018 徐州赛区网络预赛(8/11)
ACM-ICPC 2018 徐州赛区网络预赛 A.Hard to prepare 枚举第一个选的,接下来的那个不能取前一个的取反 \(DP[i][0]\)表示选和第一个相同的 \(DP[i][1]\) ...
- 计蒜客 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 ...
- ACM-ICPC 2018 徐州赛区网络预赛 B(dp || 博弈(未完成)
传送门 题面: In a world where ordinary people cannot reach, a boy named "Koutarou" and a girl n ...
- 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 ...
- 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 ...
- 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 ...
随机推荐
- C#模拟POST上传文件帮助类(支持https、http)
public static int PostFile(string getUrl, CookieContainer cookieContainer, HttpHeader header, string ...
- 来简单说说var,let,const,function,import,class
一.var和let var已经在JavaScript中存在很长一段时间了,但是它存在了一些不足的地方,接下来我们就来看看吧 首先var存在变量提升,这是怎么一回事呢,我们看下面代码 为什么是它呢,是因 ...
- 【mysql】索引相关的个人总结
重点参考: MySQL索引原理及慢查询优化 (美团技术分享网站):原理.示例优化都写的很好. 索引很难么?带你从头到尾捋一遍MySQL索引结构,不信你学不会!:原理写的很好. [从入门到入土]令人脱发 ...
- PR2018制作电子相册
PR2018制作电子相册 新建序列,自定义的参数 重置工作区域的面板 调节声音的大小 剪辑区域小图标的功能介绍 1,点亮状态表示可以自动对齐吸附,方便拼接视频,2,图标表示视频接音频同时选中的,不点亮 ...
- MySQL快速回顾:数据库和表操作
前提要述:参考书籍<MySQL必知必会> 利用空闲时间快速回顾一些数据库基础. 4.1 连接 在最初安装MySQL,可能会要求你输入一个管理登录(通常为root)和一个口令(密码). 连接 ...
- 数组工具Array的基本使用
/* * Arrays数组工具的基本使用 */import java.util.Arrays; public class Day02_03 { public static void main(S ...
- SPFA的优化一览
目录 序 内容 嵬 序 spfa,是一个早已没人用的算法,就像那些麻木的人, 可谁有知道,他何时槃涅 一个已死的算法 ,重生 内容 关于\(NOI2018D1T1\)的惨案,为了以防spfa被卡. 关 ...
- sqlserver数据库重启
停止:net stop mssqlserver 重启:net start mssqlserver
- Projected coordinate systems 和 wkid
Projected coordinate systems Well-known ID Name Well-known text 2000 Anguilla_1957_British_West_Indi ...
- C#效率优化(4)-- 编译器对数组遍历的优化
在平时开发过程中,数组是我们使用频率最高的类型之一,在使用定长列表时,数组可以说是最佳方案,这也是我们最熟悉的数据结构之一. 在C#中使用数组,可以获取在内存上连续的相同类型的一组变量,在连续访问时可 ...