好好用map

题目链接:https://www.patest.cn/contests/pat-a-practise/1004

#include   
#include   
#include   
#include   
#include   
#include 
  
using namespace std;   
  
map >adj;
int record[101]={0};

void DFS(int id,int level){
    if(adj[id].empty()){
        ++record[level];
        return ;
    }
    vector::iterator ite = adj[id].begin();
    for(;ite!=adj[id].end();++ite){
        DFS(*ite,level+1);
    }
}

int main(){
    int n,m;
    int id,k;
    cin>>n>>m;
    int cle=n-m;
    for(int i=0;i>id>>k;
        for(int j=0;j>a;
            adj[id].push_back(a);
        }
    }
    
    DFS(1,0);
    cout<

你可能感兴趣的:(好好用map)