POJ2209+水题!
#include<stdio.h>
#include<math.h>
int son[ ];
int main(){
int n,m;
while( scanf("%d%d",&n,&m)== ){
for( int i=;i<n;i++ )
scanf("%d",&son[i]);
int sum = ;
if( m%== ){
for( int i=;i<n;i++ ){
if( son[i]> ){
sum += (int)pow( 1.0*son[i],m );
}
}
}
else{
for( int i=;i<n;i++ ){
sum += (int)pow( 1.0*son[i],m );
}
}
printf("%d\n",sum);
}
return ;
}
没什么好说的。。
POJ2209+水题!的更多相关文章
- HDOJ 2317. Nasty Hacks 模拟水题
Nasty Hacks Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Tota ...
- ACM :漫漫上学路 -DP -水题
CSU 1772 漫漫上学路 Time Limit: 1000MS Memory Limit: 131072KB 64bit IO Format: %lld & %llu Submit ...
- ytu 1050:写一个函数,使给定的一个二维数组(3×3)转置,即行列互换(水题)
1050: 写一个函数,使给定的一个二维数组(3×3)转置,即行列互换 Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 154 Solved: 112[ ...
- [poj2247] Humble Numbers (DP水题)
DP 水题 Description A number whose only prime factors are 2,3,5 or 7 is called a humble number. The se ...
- gdutcode 1195: 相信我这是水题 GDUT中有个风云人物pigofzhou,是冰点奇迹队的主代码手,
1195: 相信我这是水题 Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 821 Solved: 219 Description GDUT中有个风云人 ...
- BZOJ 1303 CQOI2009 中位数图 水题
1303: [CQOI2009]中位数图 Time Limit: 1 Sec Memory Limit: 162 MBSubmit: 2340 Solved: 1464[Submit][Statu ...
- 第十一届“蓝狐网络杯”湖南省大学生计算机程序设计竞赛 B - 大还是小? 字符串水题
B - 大还是小? Time Limit:5000MS Memory Limit:65535KB 64bit IO Format: Description 输入两个实数,判断第一个数大 ...
- ACM水题
ACM小白...非常费劲儿的学习中,我觉得目前我能做出来的都可以划分在水题的范围中...不断做,不断总结,随时更新 POJ: 1004 Financial Management 求平均值 杭电OJ: ...
- CF451C Predict Outcome of the Game 水题
Codeforces Round #258 (Div. 2) Predict Outcome of the Game C. Predict Outcome of the Game time limit ...
随机推荐
- oracle拼接字段用||
① //dual相当于一个临时表.用来测量@@@@H210000000003I4R 的长度用length() select length('@@@@H210000000003I4R') from du ...
- postgresql cast转换类型
代码 CAST(aa as NUMERIC)
- 20160503-spring入门2
使用Spring需要的jar 到http://www.springsource.org/download下载spring,然后进行解压缩,在解压目录中找到下面jar文件,拷贝到类路径下 dist\sp ...
- 使用greenDao出现Property 'status' is not part of ********.NewCommentDao@717de9a
应为版本号的原因造成的,升级Schema版本号即可
- asp.net连接mysql数据库
方法一:使用MySQL推出的MySQL Connector/Net组件, 该组件是MySQL为ADO.NET访问MySQL数据库设计的.NET专用访问组件.完成该组件后,需要在项目中引用这个组件,也可 ...
- 第21条:理解Objective-C错误模型
首先要注意的是: “自动引用计数”(Automatic Reference Counting, ARC,参见第30条)在默认情况下不是“异常安全的”(exception safe).具体来说,这意味着 ...
- [记录 ]升级IOS 9 和 XCode 7 引起的问题
问题一: 升级xcode 7最低的系统配置要求 升级了ios9 后使用 xcode 6.1 已经不能用了,必须升级 xcode 7才行,原先的系统是OSX 10.10.1 版本.而xcode 7.0 ...
- Vue.js中Directive知识
近期所学的Vue.js这个MVVM前端技术缓解了我一直愁于前后端开发杂糅所带来的痛苦.今天就来说说关于Vue.js里面的Directive知识. Directive Directive看上去虽然和An ...
- JSTL 入门
JSTL--JSP Standard Tag Library--JSP标准标签函式库 当前版本 1.2.5 JSP 标准标签库(JSTL) JSP标准标签库(JSTL)是一个J ...
- OpenJudge/Poj 1661 帮助 Jimmy
1.链接地址: bailian.openjudge.cn/practice/1661 http://poj.org/problem?id=1661 2.题目: 总Time Limit: 1000ms ...