传送门

nc题,一直sort就过了

代码

#include <cstdio>
#include <iostream>
#include <algorithm>
#define N 2001
#define min(x, y) ((x) < (y) ? (x) : (y)) int n, m, k, l, d; struct node
{
int v, id;
}p1[N], p2[N]; inline int read()
{
int x = 0, f = 1;
char ch = getchar();
for(; !isdigit(ch); ch = getchar()) if(ch == '-') f = -1;
for(; isdigit(ch); ch = getchar()) x = (x << 1) + (x << 3) + ch - '0';
return x * f;
} inline bool cmp(node x, node y)
{
return x.v > y.v;
} inline bool cmp1(node x, node y)
{
return x.id < y.id;
} int main()
{
int i, x1, x2, y1, y2;
n = read();
m = read();
k = read();
l = read();
d = read();
for(i = 1; i < n; i++) p1[i].id = i;
for(i = 1; i < m; i++) p2[i].id = i;
for(i = 1; i <= d; i++)
{
x1 = read();
y1 = read();
x2 = read();
y2 = read();
if(x1 ^ x2) p1[min(x1, x2)].v++;
if(y1 ^ y2) p2[min(y1, y2)].v++;
}
std::sort(p1 + 1, p1 + n, cmp);
std::sort(p1 + 1, p1 + k + 1, cmp1);
for(i = 1; i <= k; i++) printf("%d ", p1[i].id);
puts("");
std::sort(p2 + 1, p2 + m, cmp);
std::sort(p2 + 1, p2 + l + 1, cmp1);
for(i = 1; i <= l; i++) printf("%d ", p2[i].id);
puts("");
return 0;
}

  

最新文章

  1. 转:大神提出来的java服务器方面面试问题(当作自己的学习目标平时得多注意)
  2. [Oracle](不会的是三炮)把状态列表作为存储过程参数这件小事
  3. EF OnModelCreating
  4. AngularJS - 快速入门
  5. Jquery手册
  6. 【转】MYSQL入门学习之十:视图的基本操作
  7. 利用smarty call函数实现无限极分类
  8. Elasticsearch学习笔记
  9. C#学习笔记(三)
  10. lightoj 1300 边双联通分量+交叉染色求奇圈
  11. CLR via C# - 基础拾遗
  12. linux定时任务访问url
  13. 关于CSS格式与布局中的基础知识的简单操作
  14. Spring / Hibernate 应用性能调优
  15. SQL server SELECT 语句的基本结构
  16. oralce 11.2.0.4手动创建EM
  17. LeetCode: Largest Rectangle in Histogram 解题报告
  18. 页面 JavaScript 存在多个同名方法的调用分析
  19. Java EE之表达式语言EL(下)
  20. Android Studio 创建/打开项目时一直处于Building“project name”Gradle project info 的解决

热门文章

  1. JAVA Android王牌教程
  2. 421 Maximum XOR of Two Numbers in an Array 数组中两个数的最大异或值
  3. jQueryUI 购物车拖放功能
  4. openmv第一次调试
  5. R in action读书笔记(13)第十章 功效分析
  6. leetcode_357. Count Numbers with Unique Digits
  7. day25-2 OSI协议和socket抽象层
  8. SpringCloud 微服务框架
  9. 在Gitlab上怎么添加ssh key
  10. Flask框架 之上下文、请求钩子与Flask_Script