ACM-ICPC 2018 徐州赛区网络预赛 F. Features Track
- 262144K
Morgana is learning computer vision, and he likes cats, too. One day he wants to find the cat movement from a cat video.
To do this, he extracts cat features in each frame. A cat feature is a two-dimension vector <x, y>. If xi= xj and yi = yj, then <xi, yi> <xj, yj> are same features.
So if cat features are moving, we can think the cat is moving. If feature <a, b> is appeared in continuous frames, it will form features movement. For example,
feature <a , bb > is appeared in frame2,3,4,7,8, then it forms two features movement 2−3−4 and 7−8 .
Now given the features in each frames, the number of features may be different, Morgana wants to find the longest features movement.
Input
First line contains one integer T(1≤T≤10) , giving the test cases.
Then the first line of each cases contains one integer n (number of frames),
In The next nn lines, each line contains one integer ki ( the number of features) and 2ki intergers describe kifeatures in ith frame.(The first two integers describe the first feature, the 33rd and 44th integer describe the second feature, and so on).
In each test case the sum number of features N will satisfy N≤100000 .
Output
For each cases, output one line with one integers represents the longest length of features movement.
样例输入复制
1
8
2 1 1 2 2
2 1 1 1 4
2 1 1 2 2
2 2 2 1 4
0
0
1 1 1
1 1 1
样例输出复制
3
题目来源
#define P pair<int,int>
using namespace std;
int t,n,k;
int x,y;
map<P,int>mp[];
int main()
{
scanf("%d",&t);
while(t--)
{
scanf("%d",&n);
int maxx=;
mp[].clear();
mp[].clear();
int last=;
for(int i=;i<=n;i++)
{
last=-last;//滚动
scanf("%d",&k);
for(int j=;j<=k;j++)
{
scanf("%d%d",&x,&y);
if(!mp[-last].count({x,y}) ){//因为必须连续的才有效
mp[last][{x,y}]=;
}
else{
mp[last][{x,y}]=mp[-last][{x,y}]+;
}
maxx=max(maxx,mp[last][{x,y}]);
}
mp[-last].clear();//继续滚动
}
printf("%d\n",maxx);
}
return ;
}
ACM-ICPC 2018 徐州赛区网络预赛 F. Features Track的更多相关文章
- ACM-ICPC 2018 徐州赛区网络预赛 F Features Track(STL模拟)
https://nanti.jisuanke.com/t/31458 题意 有N个帧,每帧有K个动作特征,每个特征用一个向量表示(x,y).两个特征相同当且仅当他们在不同的帧中出现且向量的两个分量分别 ...
- 计蒜客 31458.Features Track-滚动数组+STL(map)连续计数 (ACM-ICPC 2018 徐州赛区网络预赛 F)
F. Features Track Morgana is learning computer vision, and he likes cats, too. One day he wants to f ...
- 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 徐州赛区网络预赛 G. Trace (思维,贪心)
ACM-ICPC 2018 徐州赛区网络预赛 G. Trace (思维,贪心) Trace 问答问题反馈 只看题面 35.78% 1000ms 262144K There's a beach in t ...
- 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 ...
随机推荐
- jsfiddle.net上的记录
1.JQuery: http://jsfiddle.net/uryc1908/ 2.e-chart: http://jsfiddle.net/8fq96a7s/ 3.easyUI http://jsf ...
- windows 用VMware创建linux虚拟机,安装操作系统CentOS7.2
1.按照向导创建虚拟机 以下是安装虚拟机的步骤,没有写的直接下一步 [1]主页-创建新虚拟机 [2]选择 自定义(高级) [3]选择稍后安装操作系统 [4]给虚拟机命名并指定所在位置 [5]给处理器配 ...
- HashMap与TreeMap
package com.jckb; import java.util.Map; import java.util.Set; import java.util.TreeMap; /**TreeMap * ...
- Properties-转换流-打印流-序列化和反序列化-Commons-IO工具类
一.Properties 类(java.util) 概述:Properties 是一个双列集合;Properties 属于map的特殊的孙子类;Properties 类没有泛型,propert ...
- Docker学习资料汇总
一.Docker问答录(100问) 链接:https://blog.lab99.org/post/docker-2016-07-14-faq.html 二.Windows 10 如何安装Docker ...
- 科学效法自然:微软研究人员测试AI控制的滑翔机
编者按:正如一颗苹果砸出了万有引力,自然界所有存在的事物和现象都有其科学合理的一面,小小的鸟儿也能够给科学带来丰富的灵感和启示. 最近,微软研究人员从自然出发,研究鸟类能够自由停留在空中的科学原理,并 ...
- ABC3D创客项目:风力小车
随着互联网.开源硬件.电子信息等技术成熟应用,以及创新教育的大力普及,创新正成为青少年生活中最热门的话题之一:尤其新兴的3D打印技术将创意者.生产者.消费者合三为一,成为创新教育的又一大助力,每个学生 ...
- Set、Map及数组去重
https://cloud.tencent.com/developer/article/1437254 https://blog.csdn.net/weixin_34247299/article/de ...
- BCB:WebBrowser 控件说明
控件文件:system32\shdocvw.oca shdocvw.dll 注册:regsvr32 shdocvw.dll WebBrowser 是 IE 内核做的 VB 控件, WebBrow ...
- thinkphp 为什么访问路径错误,还可以访问
在学习中访问入口文件,实际上应该访问public\index\index\ 但其实也可以访问application.admin.controller\index,同样可以在网页下显示 原理:pub ...