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 ...
随机推荐
- Regsvr32注册ActiveX控件
命令:Regsvr32 XX.dll 注册ActiveX控件 Regsvr32命令参数:/u 卸载ActiveX控件/s 注册成功后不显示操作成功信息框/c 控制台输出/I 调用DllInstall安 ...
- AOJ 2200 Mr. Rito Post Office
Mr. Rito Post Office Time Limit : 8 sec, Memory Limit : 65536 KB Problem D: Mr. Rito Post Office あなた ...
- log tag
Media Player MediaPlayerService NuPlayerDecoder NuPlayer MediaFocusControl Ac ...
- 鼠标悬浮图片时弹出透明提示图层的jQuery特效
源码: <!doctype html> <html class="no-js" lang="en"> <head> < ...
- MyEclipse中新建html5中文乱码
近期刚开始入门html5 和 javascript 用MyEclipse2104创建html5时,遇到浏览器显示中文乱码的问题 [MyEclipse中设置的html5,jsp编码都采用的UTF-8] ...
- 关于Protobuf在游戏开发中的运用
最近在研究protobuf在项目中的使用,由于我们项目服务端采用的是C++,客户端是cocos2dx-cpp,客户端与服务端的消息传输是直接对象的二进制流.如果客户端一直用C++来写,问题到不大,但是 ...
- Mysql支持中文全文检索的插件mysqlcft-应用中的问题
MySQL目前版本的全文检索没有对中文很好的支持,但可以通过安装mysqlcft插件来实现,具体的安装使用方法:http://blog.s135.com/post/356/ mysqlcft的官方网站 ...
- 一个PHP加密脚本,达到一定免杀效果
<?php /**************************************** *author: L.N. *blog : [url]http://lanu.sinaapp.co ...
- CLR via C# 计算限制的异步操作读书笔记
1. 使用线程池搪行简单的计算限制操作 ThreadPool.QueueUserWorkItem(WaitCallback callback) 2.CLR默认情况下自动使初始线程的执行上下文流向辅助线 ...
- JS类库函数收集中....
实现string的substring方法 方法一:用charAt取出截取部分 String.prototype.mysubstring=function(beginIndex,endIndex){ v ...