博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
第八届河南省赛F.Distribution(水题)
阅读量:6886 次
发布时间:2019-06-27

本文共 2476 字,大约阅读时间需要 8 分钟。

10411: F.Distribution

Time Limit: 1 Sec  Memory Limit: 128 MB Submit: 11  Solved: 8 [ ][ ][ ]

Description

One day , Wang and Dong in the Dubai desert expedition, discovered an ancient castle. Fortunately, they found a map of the castle.The map marks the location of treasures.

They agreed to distribute the treasures according to the following rules:

Wang draws a horizontal line on the map and then Dong draws a vertical one so that the map is divided into 4 parts, as show below.   

II                              I

 

 

III                             IV

 

 

Wang will save the treasures in I and III ,while those situated in II and IV will be taken away by Dong. Wang first draw a horizontal line, Dong after the draw a vertical line.

They drew several pairs of  lines. For each pair, Wang wants to know the difference between their treasures.

It's guaranteed that all the reasures will lie on neither of the lines drew by them.

 

Input

One day , Wang and Dong in the Dubai desert expedition, discovered an ancient castle. Fortunately, they found a map of the castle.The map marks the location of treasures.

They agreed to distribute the treasures according to the following rules:

Wang draws a horizontal line on the map and then Dong draws a vertical one so that the map is divided into 4 parts, as show below.   

II                              I

 

 

III                             IV

 

 

Wang will save the treasures in I and III ,while those situated in II and IV will be taken away by Dong. Wang first draw a horizontal line, Dong after the draw a vertical line.

They drew several pairs of  lines. For each pair, Wang wants to know the difference between their treasures.

It's guaranteed that all the reasures will lie on neither of the lines drew by them.

 

Output

Output  contains   lines , a single line with a integer , the difference described above.

Sample Input

10 329 2217 1418 233 156 2830 274 126 78 011 212 255 1019 24

Sample Output

-644

HINT

 

Source

题解:题目乱码了,意思是给你一些点,然后两条线,分割这些点,一个人要13区域的,一个人要24区域的,让求两个人得到的点数的差

输入:两个数N,M,代表N个点,M代表x,y的值;

代码:

#include
#include
#include
#include
#include
using namespace std;#define SI(x) scanf("%d",&x)#define mem(x,y) memset(x,y,sizeof(x)) #define PI(x) printf("%d",x)#define P_ printf(" ")const int INF=0x3f3f3f3f;typedef long long LL;const int MAXN=100010;struct Node{ int x,y; Node init(){ scanf("%d%d",&x,&y); }}; Node dt[MAXN];int main(){ int N,M,x,y; while(~scanf("%d%d",&N,&M)){ for(int i=0;i
x&&dt[j].y>y)||(dt[j].x

  

转载地址:http://qetbl.baihongyu.com/

你可能感兴趣的文章
TCP连接探测中的Keepalive 和心跳包
查看>>
2015第5周三网摘
查看>>
C#系列教程——对一个对象的装箱取消转换
查看>>
RTP协议分析
查看>>
簡單SQL存儲過程實例
查看>>
有效沟通:听懂话,才能回答(转)
查看>>
整理的代码规范
查看>>
IOS之UI--小实例项目--添加商品和商品名(使用xib文件终结版) + xib相关知识点总结...
查看>>
小知识~让你的DLL类库带上注释
查看>>
Junit测试打印详细的log日志,可以看到sql
查看>>
还是畅通工程
查看>>
什么是Monad?
查看>>
vue实现数据驱动视图原理
查看>>
BeanFactory 简介以及它 和FactoryBean的区别(阿里面试)
查看>>
SpringBoot 全局统一记录日志
查看>>
mysql数据统计技巧备忘录
查看>>
Functor and Monad in Swift
查看>>
linux调试工具glibc的演示分析-core dump double free【转】
查看>>
Top 22 Free Responsive HTML5 Admin & Dashboard Templates 2018
查看>>
适合初学者的python实际例子
查看>>