前排吃猩猩
by Ykimna @ 2018-08-13 19:11:53
@[a2954898606](/space/show?uid=103304) 有一句话叫做“贪心只能过样例”,所以,我献上我的“暴力枚举数第一”的代码
```cpp
#include<iostream>
#include<cstdio>
using namespace std;
int m,n,k,l,d;
int x,y,p,q;
int h[1000][2];
int s[1000][2];
int t;
int flag=0;
int main(void){
cin>>m>>n>>k>>l>>d;
for(int i=0;i<=1000;i++){
h[i][0]=i;
s[i][0]=i;
}
for(int i=1;i<=d;i++){
cin>>x>>y>>p>>q;
if(x==p){
if(y-q==1){
s[q][1]++;
}else{
s[y][1]++;
}
}else{
if(x-p==1){
h[p][1]++;
}else{
h[x][1]++;
}
}
}
for(int i=0;i<m;i++){
for(int j=i;j<m;j++){
if(h[i][1]<h[j][1]){
t=h[i][0];
h[i][0]=h[j][0];
h[j][0]=t;
t=h[i][1];
h[i][1]=h[j][1];
h[j][1]=t;
}
}
}
for(int i=0;i<n;i++){
for(int j=i;j<n;j++){
if(s[i][1]<s[j][1]){
t=s[i][0];
s[i][0]=s[j][0];
s[j][0]=t;
t=s[i][1];
s[i][1]=s[j][1];
s[j][1]=t;
}
}
}
for(int i=0;i<k;i++){
for(int j=i;j<k;j++){
if(h[i][0]>h[j][0]){
t=h[i][0];
h[i][0]=h[j][0];
h[j][0]=t;
}
}
}
for(int i=0;i<l;i++){
for(int j=i;j<l;j++){
if(s[i][0]>s[j][0]){
t=s[i][0];
s[i][0]=s[j][0];
s[j][0]=t;
}
}
}
for(int i=0;i<k;i++){
if(flag==0){
cout<<h[i][0];
flag++;
}else{
cout<<" "<<h[i][0];
}
}
cout<<endl;
flag=0;
for(int i=0;i<l;i++){
if(flag==0){
cout<<s[i][0];
flag++;
}else{
cout<<" "<<s[i][0];
}
}
cout<<endl;
return 0;
}
```
by 波风水门 @ 2018-08-13 19:12:05
@[a2954898606](/space/show?uid=103304) 您好,请问为什么要强调您是-10分呢?~~虽然本蒟蒻不会这题~~(逃)
by 御坂19000号 @ 2018-08-13 19:21:59
@[御坂19000号](/space/show?uid=109181) emmm十分啊
by a2954898606 @ 2018-08-13 19:31:30
@[四代目火影](/space/show?uid=81710) %%%%%%%
by GHY。AKA。Hugh @ 2018-08-17 22:28:32