HDU1173
采矿
Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 3899 Accepted Submission(s): 1890
Special Judge
Problem Description
这个小岛在一个二维直角坐标系中描述。
你的任务就是帮gameboy找一个建造基地的位置,使矿工能以最快的速度采完所有矿。
Input
Output
Sample Input
Sample Output
//2016.9.22
#include <iostream>
#include <cstdio>
#include <algorithm> using namespace std; const int N = ;
double x[N], y[N]; int main()
{
int n;
while(scanf("%d", &n)!=EOF && n)
{
for(int i = ; i < n; i++)
scanf("%lf%lf", &x[i], &y[i]);
sort(x, x+n);
sort(y, y+n);
printf("%.2lf %.2lf\n", x[n/], y[n/]);
} return ;
}
HDU1173的更多相关文章
- hdu-1173(最短距离)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1173 思路:最短距离:就是现将x,y从小到大排序,然后去中间点就行了.(注意:本题答案不唯一) #in ...
随机推荐
- svn版本库通过svn://127.0.0.1/不能导出的问题解决了!!
svn:本地file:///E:/SvnServerHome没问题,但是换为svn://192.168.1.100/SvnServerHome 报异常. 配置http协议访问svn 原文:http:/ ...
- spark 文件系统Alluxio(之前名为Tachyon)
http://www.alluxio.org/documentation/v1.0.0/cn/ http://www.winseliu.com/blog/2016/04/15/alluxio-quic ...
- [iOS]C语言技术视频-06-程序循环结构(for{})
下载地址: 链接: http://pan.baidu.com/s/1dD11Zwt 密码: rke9
- Java面向对象设计
1.少了程序入口会在输出的地方报这个错: Syntax error, insert "... VariableDeclaratorId" to complete FormalPar ...
- Keil STM32调试,使用ST-Link下载程序时提示“flash timeout.reset the target and try it again”
参考: 很郁闷,买来没多久的 STM32F4-DISCOVERY 就挂了? STM32F103RB Jlink调试的时候出现flash timeout.reset the target and t ...
- STM32_IAP详解(有代码,有上位机)
Iap,全名为in applacation programming,即在应用编程,与之相对应的叫做isp,in system programming,在系统编程,两者的不同是isp需要依靠烧写器在单片 ...
- vuejs 子组件传递父组件的第一种方式
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- 安卓 handler解析
参考: 1.http://www.2cto.com/kf/201302/190591.html(安卓更新UI的两种方式,handler,Activity.runOnUIThread()) 2.http ...
- 输入计算表达式,将他们存在string【】中
#include<stdio.h>#include<string>#include<string.h>#include<stdlib.h>#includ ...
- Swift 动态创建提示框
var alert = UIAlertController(title: "", message: "", prefferedStyle: UIAlertCon ...