#include #include #include #include using namespace std; typedef long long LL; int N,M; int GetWinNum(vector>> &R) { int num=0; set PersonSet; multimap>::iterator mit; for (int j=0;j>N>>M; vector>> R(M); vector maxR(M,0); int i,j; LL r; for (i=0;i>r; if (r>maxR[j]){ if (R[j].size()>0){ R[j].erase(R[j].begin()); } R[j].insert(multimap>::value_type(r,i+1)); maxR[j]=r; }else if (r==maxR[j]){ R[j].insert(multimap>::value_type(r,i+1)); } } cout<