题解 | #特征提取#

特征提取

http://www.nowcoder.com/practice/5afcf93c419a4aa793e9b325d01957e2

自存

//
// Created by DELL on 2021/10/16.
//
#include <bits/stdc++.h>
using namespace std;

int main(){
    int N,M;
    cin >> N;
    pair<int,int> f;
    int num;

    while (N--){
        cin >> M;
        map<pair<int,int>,int> frame;
        map<pair<int,int>,int> lastFrame;
        int max=0;
        while (M--){
            cin >> num;
            for (int i = 0; i < num; ++i) {
                cin >> f.first >> f.second;
            
            if(lastFrame.count(f)){
                frame[f] = lastFrame[f] + 1;
            }else{
                frame[f] = 1;
            }
            if(max<frame[f]){
                max = frame[f];
            }
                }
            lastFrame.clear();
            lastFrame.swap(frame);
        }
        cout << max << endl;
    }
    return 0;
}

全部评论

相关推荐

06-26 19:47
中南大学 Java
点赞 评论 收藏
分享
点赞 评论 收藏
分享
06-15 18:44
黄淮学院 Java
Lynn012:如果是居民楼还是算了吧,看着有点野呢
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务