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

题意:

略。

思路:

略。。。。真分数。。。

= =、我今天是纠结去死了。哎,继续加油,就比如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. 用rsync命令删除大文件夹

    删除大文件夹 rsync 命令做同步文件用的命令 我们可以借助其快速的运行 来对大文件夹删除:原来就是 新建一个空文件夹 然后把这个空文件夹同步到一个大文件夹下面: 这样会删除大文件夹下面的内容 是高 ...

  2. Android 最新控件 Toolbar

    之前Android的ActionBar好像做项目从没用过.除了google自己,并没有多少人用,究其原因,主要是由于ActionBar不够灵活,不可以随心所欲的定制,后来Goole也发现了这一点,然后 ...

  3. HDU 1257 最少拦截系统(dp)

    Problem Description 某国为了防御敌国的导弹突击,发展出一种导弹拦截系统.可是这样的导弹拦截系统有一个缺陷:尽管它的第一发炮弹可以到达随意的高度,可是以后每一发炮弹都不能超过前一发的 ...

  4. webpack的安装个配置

    webpack在node下运行,首先先安装node 安装在全局:npm install webpack -g 在任何目录都可以运行 安装在局部:npm init -y npm install webp ...

  5. Android — 长按ListView 利用上下文菜单(ActionMode) 进行批量事件处理

    好久没写博客拉``````` 近期最终略微闲一点了``````` 无聊拿手机清理短信.发现批量事件的处理还是挺管用的`````` 那么自己也来山寨一记看看效果吧````` 闲话少说,首先,我们来看下手 ...

  6. 使用Microsoft Office 2007将文档转换为PDF

    点击帮助 输入关键词PDF后搜索 点击进入Save or convert to PDF or XPS 点击进入2007 Microsoft Office Add-in: Microsoft Save ...

  7. 20170228 ALV method中用E消息,会退出到初始界面;STOP 会dump;

    再回车就处理界面了, 所以,Handel_data_change 做数据检查时,如果需要报错要用到, CALL METHOD er_data_changed->add_protocol_entr ...

  8. OOalv 实现带出栏位描述

    .类定义 CLASS lcl_event_handler DEFINITION. PUBLIC SECTION. METHODS: handle_data_changed_finished FOR E ...

  9. [翻译]理解Unity的自动内存管理

    当创建对象.字符串或数组时,存储它所需的内存将从称为堆的中央池中分配.当项目不再使用时,它曾经占用的内存可以被回收并用于别的东西.在过去,通常由程序员通过适当的函数调用明确地分配和释放这些堆内存块.如 ...

  10. 迭代器模式(Iterator.hasNaxt())

    迭代器模式(Iterator Pattern)是 Java 和 .Net 编程环境中非常常用的设计模式.这种模式用于顺序访问集合对象的元素,不需要知道集合对象的底层表示. 迭代器模式属于行为型模式. ...