RT,我寻思着我 struct 里面的 operator 也没写错,可它老是给我报 CE,心态炸裂了
各位帮我看看到底是哪里出了问题吧,菜鸡实在是调不出来了
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <map>
#define F(i, a, b) for(int (i) = (a); (i) <= (b); ++(i))
#define R(i, a, b) for(int (i) = (a); (i) >= (b); --(i))
#define E for(int i = h[x]; i; i = e[i].nxt)
#define str(s) cin >> (s); int len = (s).size()
#define ll long long //No long long see your ancestor!!!
#define lll __int128 //Has long long see your ancestor!!!
using namespace std;
template<typename T>
inline T read() {
T f = 1, x = 0; char c = getchar();
while(!(c >= '0' && c <= '9')) {if(c == '-') f = -1; c = getchar();}
while(c >= '0' && c <= '9') {x = x * 10 + c - '0'; c = getchar();}
return x * f;
}
#define Rint read<int>()
#define Rll read<ll>()
#define R128 read<__int128>()
#define MT int t = Rint; while(t--)
const int N = 1e5 + 7;
struct node {
int b[7];
}ac[N];
struct bn {
int a[7], num;
bool operator < (const bn& tmp) const {
F(i, 1, 6) if(a[i] != tmp.a[i]) return a[i] < tmp.a[i];
}
}acc[N];
map<node, int> vis;
int n, cnt;
int main() {
//freopen(".in", "r", stdin);
//freopen(".out", "w", stdout);
MT {
vis.clear(); memset(ac, 0, sizeof(ac)), memset(acc, 0, sizeof(acc));
n = Rint;
F(i, 1, n) {
F(j, 1, 6) ac[i].b[j] = Rint;
if(!vis[ac[i]]) {
cnt++;
F(j, 1, 6) acc[cnt].a[j] = ac[i].b[j];
acc[cnt].num = 1; vis[ac[i]] = cnt;
} else acc[vis[ac[i]]].num++;
}
sort(acc + 1, acc + cnt + 1);
F(i, 1, cnt) {
F(j, 1, 6) printf("%d ", acc[i].a[j]);
printf("%d\n", acc[i].num);
}
puts("");
}
return 0;
}