题目链接

水题,算一下就行。

  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. typedef long long ll;
  4. ll x[],y[],z[];
  5. double cal(ll x[])
  6. {
  7. ll ans1;
  8. if(x[]>=x[]&&x[]<=x[])
  9. ans1=;
  10. else if(x[]<x[])
  11. ans1=(x[]-x[])*(x[]-x[]);
  12. else if(x[]>x[])
  13. ans1=(x[]-x[])*(x[]-x[]);
  14. return ans1;
  15. }
  16. int main()
  17. {
  18. for(int i=;i<;i++)
  19. scanf("%lld%lld%lld",&x[i],&y[i],&z[i]);
  20. ll ans1=cal(x),ans2=cal(y),ans3=cal(z);
  21. printf("%lld\n",ans1+ans2+ans3);
  22. return ;
  23. }

(2016弱校联盟十一专场10.2) A.Nearest Neighbor Search的更多相关文章

  1. 2016弱校联盟十一专场10.5---As Easy As Possible(倍增)

    题目链接 https://acm.bnu.edu.cn/v3/contest_show.php?cid=8506#problem/A problem description As we know, t ...

  2. 2016弱校联盟十一专场10.3---Similarity of Subtrees(深搜+hash、映射)

    题目链接 https://acm.bnu.edu.cn/v3/problem_show.php?pid=52310 problem description Define the depth of a ...

  3. (2016弱校联盟十一专场10.3) D Parentheses

    题目链接 把左括号看成A右括号看成B,推一下就行了.好久之前写的,推到最后发现是一个有规律的序列. #include <bits/stdc++.h> using namespace std ...

  4. (2016弱校联盟十一专场10.3) B.Help the Princess!

    题目链接 宽搜一下就行. #include <iostream> #include<cstdio> #include<cstring> #include<qu ...

  5. (2016弱校联盟十一专场10.3) A.Best Matched Pair

    题目链接 #include<cstdio> #include<cstring> #include<algorithm> #include<stack> ...

  6. 2016弱校联盟十一专场10.3---We don't wanna work!(STL--set的使用)

    题目链接 https://acm.bnu.edu.cn/v3/contest_show.php?cid=8504#problem/C 代码如下: #include <iostream> # ...

  7. 2016弱校联盟十一专场10.2---Around the World(深搜+组合数、逆元)

    题目链接 https://acm.bnu.edu.cn/v3/problem_show.php?pid=52305 problem  description In ICPCCamp, there ar ...

  8. (2016弱校联盟十一专场10.2) E.Coins

    题目链接 很久之前写的了,好像是对拍打表过的,推一下就行了. #include <bits/stdc++.h> using namespace std; typedef long long ...

  9. (2016弱校联盟十一专场10.5) F. Fibonacci of Fibonacci

    题目链接 题目大意就是这个,先找出下标的循环节,再快速幂对20160519取余就行了. 找出下标循环节: #include <cstdio> #include <iostream&g ...

随机推荐

  1. [译]angularjs directive design made easy

    原文: http://seanhess.github.io/2013/10/14/angularjs-directive-design.html AngularJS directives很酷 Angu ...

  2. springMVC 缓存(入门 spring+mybaties+redis一)

    使用redis之前需要咋电脑上安装redis: 使用spring+mybaties+redis的本质是扩展类   org.apache.ibatis.cache.Cache:在我们自己扩展的Cache ...

  3. StarWind的安装配置

    将安装包拷贝到本地后,执行以下exe文件,默认下一步,直到安装完成. 需汉化版本则将language_chinese.xml文件拷贝到以下路径: C:\Program Files\StarWind S ...

  4. POJ 1905 Expanding Rods

                           Expanding Rods Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 1 ...

  5. 大数据之Ganglia安装1

    0.前期准备修改主机名.ip.iptables关闭:时间同步:ntpdate -s time.windows.com;软件准备ganglia-3.7.1.tar.gz.ganglia-web-3.7. ...

  6. Swift---TextView用法

    1.TextView放在一个NSScrollView中,作为documentView存在. @IBOutlet weak var txtScrollView: NSScrollView! 2.在Tex ...

  7. Javascript高级程序设计——函数声明与函数表达式的区别

    在Javascript中,函数是Functioin类型的实例,所以函数也具备属性和方法,因为函数是对象,所以函数名自然就是指向对象的指针啦. 函数可以通过声明语法和表达式来定义: 声明:functio ...

  8. Java Io 流(输入输出流)

    IO流,也就是输入和输出流,可分为字节流和字符流. 1. 字节流 (1). InputStream 输入流,用于读取文件 输入流常用API: inputStream.read()  读取一个字节 in ...

  9. 关于JavaScript中对象的继承实现的学习总结

    一.原型链 JavaScript 中原型链是实现继承的主要方法.其主要的思想是利用原型让一个引用类型继承另一个引用类型的属性和方法.实现原型链有一种基本模式,其代码如下. function Super ...

  10. BZOJ4411——[Usaco2016 Feb]Load balancing

    1.题意: 给出N个平面上的点.保证每一个点的坐标都是正奇数. 你要在平面上画两条线,一条是x=a,一条是y=b,且a和b都是偶数. 直线将平面划成4个部分,要求包含点数最多的那个部分点数最少. 2. ...