ural 1864
题意描述不清 而且还卡精度 ~~
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std; int a[110];
int main()
{
int n, sum = 0;
scanf("%d", &n);
for(int i = 0; i < n; i ++)
{
scanf("%d", &a[i]);
sum += a[i];
}
double k = (double)sum/(n+1), sum2 = 0;
for(int i = 0; i < n; i ++)
{
if((double)a[i] > k)
sum2 += (double)a[i]-k;
}
for(int i = 0; i < n; i ++)
{
if(i)
putchar(' ');
if((double)a[i] > k)
printf("%d", (int)(((double)a[i]-k)/sum2*100+0.00001));
else
printf("0");
}
return 0;
}
ural 1864的更多相关文章
- http://vjudge.net/contest/view.action?cid=51142#problem/C 精度转换的一道题。。。
C - Get-Together at Den's Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & ...
- 后缀数组 POJ 3974 Palindrome && URAL 1297 Palindrome
题目链接 题意:求给定的字符串的最长回文子串 分析:做法是构造一个新的字符串是原字符串+反转后的原字符串(这样方便求两边回文的后缀的最长前缀),即newS = S + '$' + revS,枚举回文串 ...
- ural 2071. Juice Cocktails
2071. Juice Cocktails Time limit: 1.0 secondMemory limit: 64 MB Once n Denchiks come to the bar and ...
- ural 2073. Log Files
2073. Log Files Time limit: 1.0 secondMemory limit: 64 MB Nikolay has decided to become the best pro ...
- ural 2070. Interesting Numbers
2070. Interesting Numbers Time limit: 2.0 secondMemory limit: 64 MB Nikolay and Asya investigate int ...
- ural 2069. Hard Rock
2069. Hard Rock Time limit: 1.0 secondMemory limit: 64 MB Ilya is a frontman of the most famous rock ...
- ural 2068. Game of Nuts
2068. Game of Nuts Time limit: 1.0 secondMemory limit: 64 MB The war for Westeros is still in proces ...
- ural 2067. Friends and Berries
2067. Friends and Berries Time limit: 2.0 secondMemory limit: 64 MB There is a group of n children. ...
- ural 2066. Simple Expression
2066. Simple Expression Time limit: 1.0 secondMemory limit: 64 MB You probably know that Alex is a v ...
随机推荐
- 20150226--WebForm中GridView
WebForm中的GridView的用法基本与winForm中的DataGridView一致, 其数据绑定的方法使用LinqDateSource 将GridView拖拽进网页中,出现以下格式: 自动套 ...
- android ListView_显示数据库数据
xml <?xml version="1.0"?> -<LinearLayout tools:context=".MainActivity" ...
- how to debug thread cpu 100%
when we write a program, cpu and memory usages are very important to indicate the stability of the p ...
- 标签控制器,UITabBarController
注意: 1.tabbar高度不可设置,可通过_tabbar.tabbar.frame设置tabbar的位置 2.tabbar不同页面添加同一个视图后其那面添加的不起作用,只有最后一个才具有所添加的仕途 ...
- mysql颠覆实战笔记(一)--设计一个项目需求,灌入一万数据先
版权声明:笔记整理者亡命小卒热爱自由,崇尚分享.但是本笔记源自www.jtthink.com(程序员在囧途)沈逸老师的<web级mysql颠覆实战课程 >.如需转载请尊重老师劳动,保留沈逸 ...
- sql简易的MRP资源分析
写了个简易的MRP根据传进来的数据,进行上下级的判断,父表,子表 构思: 3张变量表,第一张用来存传进来的成品,这边对表做了循环就是成品是一样一样进去的,取成品表的第一行,将数据做父表和子表关联,取出 ...
- 【Qt】Qt Linguist介绍【转】
简介 Qt提供了一款优秀的支持Qt C++和Qt Quick应用程序的翻译工具.发布者.翻译者和开发者可以使用这款工具来完成他们的任务. 发布者:承担了全面发布应用程序的责任.通常,他们协调开发者和翻 ...
- Android布局揭秘
前言 今天把对于布局的一些理解写下来,主要内容包括控件的属性的继承关系,控件与容器的属性的关系,以及各种类的属性的使用. 控件的属性种类 通常意义上讲,我们在对一个控件进行属性赋值的时候大体上有种类型 ...
- Redis源码研究--redis.h
------------7月3日------------ /* The redisOp structure defines a Redis Operation, that is an instance ...
- Nginx+Tomcat动静分离
需求:nginx处理用户请求的静态页面,tomcat处理用户请求jsp页面,来实现动态分离,nginx处理静态页面效率远高于tomcat,这样一来就能更好的提高并发,处理性能. 准备软件: 下载jdk ...