0%

ICPC-2018 徐州网络赛 F题(stl-map)

题目链接

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <map>
using namespace std;
typedef long long ll;

const int N = 1e5 + 10;
int T;
int n, k, x, y;

struct node {
int x, y;
bool operator < (const node & aa) const {
if(x == aa.x) return y < aa.y;
return x < aa.x;
}
bool operator == (const node & aa) const {
if(x == aa.x && y == aa.y) {
return true;
}
return false;
}
};
map<node, int> mp[N];
int main() {
scanf("%d", &T);
while(T--) {
scanf("%d", &n);
int mx = -1;
for(int i = 1; i <= n; i++) {
mp[i].clear();
scanf("%d", &k);
for(int j = 1; j <= k; j++) {
node tmp;
scanf("%d%d", &tmp.x, &tmp.y);
mp[i][tmp] = mp[i-1][tmp] + 1;
if(mx < mp[i][tmp]) mx = mp[i][tmp];
}
}
printf("%d\n", mx);
}

return 0;
}
求大佬赏个饭