-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path10227.cpp
More file actions
39 lines (38 loc) · 753 Bytes
/
Copy path10227.cpp
File metadata and controls
39 lines (38 loc) · 753 Bytes
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
// Author: btjanaka (Bryon Tjanaka)
// Problem: (UVa) 10227
#include <bits/stdc++.h>
#define GET(x) scanf("%d", &x)
#define GED(x) scanf("%lf", &x)
typedef long long ll;
using namespace std;
typedef pair<int, int> ii;
int main() {
int ca;
GET(ca);
char buf[50];
int p, t;
bool first = true;
while (ca--) {
GET(p);
GET(t);
vector<set<int>> saw(p);
getchar();
int i, j;
while (fgets(buf, 50, stdin) && buf[0] != '\n') {
sscanf(buf, "%d %d", &i, &j);
--i;
--j;
saw[i].insert(j);
}
set<set<int>> opi;
for (int i = 0; i < p; ++i) {
opi.insert(saw[i]);
}
if (first)
first = false;
else
putchar('\n');
printf("%d\n", (int)opi.size());
}
return 0;
}