|
- #include <algorithm>
- #include <iostream>
- #include <cmath>
- #include <cstring>
- #include <map>
- #include <string>
- #include <vector>
- #include <queue>
- #include <stack>
- #include <cstdio>
- using namespace std;
- int m,n,k,l,d,x11,y11,x22,y22;
- struct hehe
- {
- int bian,ji;
- }a[5000],b[5000];
- bool cmp(hehe x,hehe y)
- {
- return x.ji>y.ji;
- }
- bool cmp1(hehe x,hehe y)
- {
- return x.bian<y.bian;
- }
- int main()
- {
- scanf("%d%d%d%d%d",&m,&n,&k,&l,&d);
- for(int i=1;i<=n;i++)
- b[i].bian=i;
- for(int i=1;i<=m;i++)
- a[i].bian=i;
- for(int i=1;i<=d;i++)
- {
- scanf("%d%d%d%d",&x11,&y11,&x22,&y22);
- if(x11==x22)
- b[min(y11,y22)].ji++;
- else if(y22==y11)
- a[min(x11,x22)].ji++;
- }
- sort(a+1,a+m,cmp);sort(b+1,b+n,cmp);
- sort(a+1,a+k+1,cmp1);sort(b+1,b+l+1,cmp1);
- for(int i=1;i<=k;i++)
- printf("%d ",a[i].bian);
- printf("\n");
- for(int i=1;i<=l;i++)
- printf("%d ",b[i].bian);
- return 0;
- }
复制代码 |
|