开始 2024-08-22 00:00:00

8.19-8.24集训第四天

结束 2024-08-26 09:00:00
Contest is over.
当前 2024-12-22 14:32:28

1435357r3ffdgdxfwwhsywurtgtfgfg

include <bits/stdc++.h>

using namespace std; struct node{ int count,id; }x[1010],y[1010]; int m,n,k,l,d; bool CMP1(node a,node b){ return a.count>b.count; } bool CMP2(node a,node b){ return a.id<b.id; } int main(){ cin >> m >> n >> k >> l >> d; for(int i=1,x1,y1,x2,y2;i<=d; i++){

    cin >> x1 >> y1 >> x2 >> y2;
    if(x1==x2){
      y[min(y1,y2)].count++;
      y[min(y1,y2)].id=min(y1,y2);
    }
    else if(y1==y2){
      x[min(x1,x2)].count++;
      x[min(x1,x2)].id=min(x1,x2);
    }
}
sort(x+1,x+1+m,CMP1);
sort(x+1,x+1+k,CMP2);
sort(y+1,y+1+n,CMP1);
sort(y+1,y+1+l,CMP2);
for(int i=1;i<=k;i++)cout << x[i].id << " ";
cout << endl;
for(int i=1;i<=l;i++)cout << y[i].id << " ";

return 0; }


frank0706  •  4个月前

比赛已结束。