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

题意:

略。

思路:

略。。。。真分数。。。

= =、我今天是纠结去死了。哎,继续加油,就比如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. 集成CCFlow工作流与GPM的办公系统驰骋CCOA介绍(三)

    通过组织结构能够对项目的岗位.部门.人员进行增删改操作. 加入新部门.并为新部门加入人员: 选中部门后,点击鼠标右键,能够选择加入平级部门或下属部门. 新建部门时,须要给部门设置部门编号.名称.与部门 ...

  2. winform窗体继承泛型类时,设计器无法使用解决办法

    当我们使用winform程序时,winform窗体程序和控件程序都是可以通过设计器进行控件拖拽的,但如果我们继承了一个带有泛型的form基类.那么设计器是无法使用的. 目前我没有找到根本解决的办法,但 ...

  3. IPv4与IPv6数据报格式

    IPv4: IPv4数据报中的字段: 版本号:规定了数据报的IP协议版本,通过查看版本号,路由器能够确定如何解释IP数据报的剩余部分,因为不同IP版本使用不同的数据报格式. 首部长度:IPv4数据报可 ...

  4. 【读后感】Netty 系列之 Netty 高性能之道 - 相比 Mina 怎样 ?

    [读后感]Netty 系列之 Netty 高性能之道 - 相比 Mina 怎样 ? 太阳火神的漂亮人生 (http://blog.csdn.net/opengl_es) 本文遵循"署名-非商 ...

  5. java中InputStream String

    Java 中获取输入流时,有时候须要将输入流转成String,以便获取当中的内容 ,以下总结一下 InputStream 转成String 的方式  方法1: public String conver ...

  6. (Android 即时通讯) [悬赏],不管是谁发现一个漏洞奖励人民币1000元!

    悬赏,不管是谁发现一个漏洞奖励人民币1000元! 3Q Android 手机版即时通讯系统正式推出,可与电脑版 地灵(http://im.yunxunmi.com) 即时通讯系统互通!  适用于:小米 ...

  7. BZOJ 1042: [HAOI2008]硬币购物 容斥+背包

    1042: [HAOI2008]硬币购物 Description 硬币购物一共有4种硬币.面值分别为c1,c2,c3,c4.某人去商店买东西,去了tot次.每次带di枚ci硬币,买si的价值的东西.请 ...

  8. LiberOJ#6178. 「美团 CodeM 初赛 Round B」景区路线规划 概率DP

    题意 游乐园被描述成一张 n 个点,m 条边的无向图(无重边,无自环).每个点代表一个娱乐项目,第 i 个娱乐项目需要耗费 ci 分钟的时间,会让小 y 和妹子的开心度分别增加 h1i ,h2i ,他 ...

  9. 用Java编写的http下载工具类,包含下载进度回调

    HttpDownloader.java package com.buyishi; import java.io.FileOutputStream; import java.io.IOException ...

  10. NEU 1681: The Singles

    题目描述 The Signals’ Day has passed for a few days. Numerous sales promotion campaigns on the shopping ...