3 solutions
-
-1
#include
#include
#include
#include
#include
#include
#include
typedeflonglongll;
using****namespacestd;
voidsolve14(){
** **map<ll,vector> s;
** **ll n,m;
** **s[0].push_back(0);
** **cin>>n>>m;
** **for (ll i=0; i<m; i++) {
** **ll j,l;
** **cin>>j>>l;
** **s[j].push_back(l);
** **}
** **for (ll i=1; i<=n; i++) {
** **cout<<s[i].size()<<" ";
** **sort(s[i].begin(),s[i].end());
** **for (ll j=0;j<s[i].size() ; j++) {
** **cout<<s[i][j]<<" ";
** **}
** **cout<<endl;
** **}
}
int main(){
** **int t=1;
** **//cin>>t;
** **while(t>0){
** **solve14();
** **t--;
** **}
** **return 0;
}
//用了map
Information
- ID
- 837
- Time
- 1000ms
- Memory
- 128MiB
- Difficulty
- 2
- Tags
- # Submissions
- 41
- Accepted
- 27
- Uploaded By