啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊

题意:

略。

思路:

略。。。。真分数。。。

= =、我今天是纠结去死了。哎,继续加油,就比如gfd说的还有下一场,下下场,不要烦,不要绝望,因为,这算什么?

)扔份代码跑。

#include <stdio.h>
#include <math.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <queue>
#include <stack>
using namespace std;
#define PI acos(-1.0)
#define INF 0x3f3f3f
#define MAX 100010
#define ll long long
ll a[MAX]; int main()
{
int i,j,t;
ll n;
scanf("%d",&t);
while(t--)
{
ll sum=0;
scanf("%lld",&n);
for(i=0;i<n;i++)
{
scanf("%lld",&a[i]);
a[i]=abs(a[i]);
sum+=a[i];
a[i]*=n;
}
ll ss,xx,nn;
nn=n*n;
ss=xx=0;
for(i=0;i<n;i++)
{
xx+=(a[i]-sum)*(a[i]-sum);
if(xx>nn){
ss+=xx/nn;
xx%=nn;
}
}
ll r=__gcd(xx,nn);
nn/=r;
xx/=r;
printf("%lld/%lld\n",xx+ss*nn,nn);
}
return 0;
}

2016 Multi-University Training Contest 2 A Acperience的更多相关文章

  1. 2016 Al-Baath University Training Camp Contest-1

    2016 Al-Baath University Training Camp Contest-1 A题:http://codeforces.com/gym/101028/problem/A 题意:比赛 ...

  2. 2016 Al-Baath University Training Camp Contest-1 E

    Description ACM-SCPC-2017 is approaching every university is trying to do its best in order to be th ...

  3. 2016 Al-Baath University Training Camp Contest-1 A

    Description Tourist likes competitive programming and he has his own Codeforces account. He particip ...

  4. 2016 Al-Baath University Training Camp Contest-1 J

    Description X is fighting beasts in the forest, in order to have a better chance to survive he's gon ...

  5. 2016 Al-Baath University Training Camp Contest-1 I

    Description It is raining again! Youssef really forgot that there is a chance of rain in March, so h ...

  6. 2016 Al-Baath University Training Camp Contest-1 H

     Description You've possibly heard about 'The Endless River'. However, if not, we are introducing it ...

  7. 2016 Al-Baath University Training Camp Contest-1 G

    Description The forces of evil are about to disappear since our hero is now on top on the tower of e ...

  8. 2016 Al-Baath University Training Camp Contest-1 F

    Description Zaid has two words, a of length between 4 and 1000 and b of length 4 exactly. The word a ...

  9. 2016 Al-Baath University Training Camp Contest-1 D

    Description X is well known artist, no one knows the secrete behind the beautiful paintings of X exc ...

随机推荐

  1. booth乘法器原理

    在微处理器芯片中,乘法器是进行数字信号处理的核心,同一时候也是微处理器中进行数据处理的wd=%E5%85%B3%E9%94%AE%E9%83%A8%E4%BB%B6&hl_tag=textli ...

  2. C语言知识结构之二

    C语言的知识结构整理成思维导图,例如以下图所看到的: 这张图的总体思路是: 用C敲代码.该学会什么? 要用C写的更好,改学会什么? 事实上.仅仅要是分层的知识结构,大致的思路是: 首先,研究本层的知识 ...

  3. [转载]CodeIgniter配置之URL

    应该有很多项目中会有这样的情况,通过 http://pc.local 可以访问,若通过 http://localhost/pc/public 则会出现一些图片.样式显示不到,超链接出错的情况,项目的移 ...

  4. 基于bootstrap_网站汇总页面

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  5. 使用外部 toolchain 编译 openwrt

    默认编译 openwrt 时会先编译一套 toolchain. 这个步骤耗时较长. 使用外部 toolchain 可以多个 project 共用一套 toolchain , 而且也不重再编译它了. 省 ...

  6. Express:模板引擎深入研究

    深入源码 首先,看下express模板默认配置. view:模板引擎模块,对应 require('./view'),结合 res.render(name) 更好了解些.下面会看下 view 模块. v ...

  7. Python开发【2.2 异常处理】

    1.Python常见异常类型: Exception 常规错误的基类 AttributeError 对象没有这个属性 IOError 输入/输出操作失败 IndexError 序列中没有此索引(inde ...

  8. 【健康生活】Google、百度之间的选择

    没有什么技术性的分析,仅仅是个人吐槽而已. 一般人遇到问题就会说一句"百度一下",说实话,百度在中国推广的真的非常不错,可谓是家喻户晓,搜索个八卦新闻,小文章,小电影什么的的确非常 ...

  9. 理解yarn平台,理解万岁,肤浅理解也万岁~

    从Hadoop1到Hadoop2很大程度上解放了Jobtracker资源调度的问题,这就得多亏了yarn平台了.我知道的,除了我们的大豆瓣用的是Mesos,咱们国家可以说应该是99.99%都使用的是y ...

  10. 线程安全 对StringBuilder抛出ArrayIndexOutOfBoundsException的探究

    对StringBuilder抛出ArrayIndexOutOfBoundsException的探究 - CSDN博客 https://blog.csdn.net/liu_005/article/det ...