Homework Introduction
STL
#include<bits/stdc++.h>
using namespace std;
int main(){
set< set<int> > a;
int n;
cin >> n;
for(int i=1;i<=n;i++){
int m;
cin >> m;
set<int> s;
while(m--){
int k;
cin >> k;
s.insert(k);
}
a.insert(s);
}
cout << a.size() << endl;
set<set<int> >::iterator it1;
for(it1=a.begin();it1!=a.end();it1++){
// *it1 是set<int>类型
set<int>::iterator it2;
for(it2=(*it1).begin(); it2!=(*it1).end();it2++){
cout << *it2 <<" ";
}
cout << endl;
}
return 0;
}
Problem
Please claim the assignment to see the problems.
- Status
- Live...
- Problem
- 11
- Open Since
- 2025-6-25 0:00
- Deadline
- 2025-7-2 23:59
- Extension
- 24 hour(s)