点击打开链接
#include #include #include #include #include #include #include #define bug(x) printf("%d****\n",x) using namespace std; const int maxn=1e4+10; vector id_vec; map id_mp; vector tex[maxn]; struct node{ int a,b; node(int x,int y):a(x),b(y){}; bool operator<(const node& t)const{ if(a==t.a) return b is_exist; int ID(string s){//最六的操作,利用map记录和vector的存储,简直神操作 if(id_mp.count(s)) return id_mp[s]; id_vec.push_back(s); return id_mp[s]=id_vec.size()-1; } void read(int n,int m){ string str; char ch; ch=getchar();//去掉第一行的一个回车符 for(int i=0;i>n>>m){ read(n,m); solve(n,m); id_vec.clear(); id_mp.clear(); is_exist.clear(); for(int i=0;i