HDU 5268 ZYB loves Score (简单模拟,水)
题意:计算Bestcoder四题的得分。
思路:直接模拟,4项分数直接计算后输出。注意不要低于百分之40的分。
//#include <bits/stdc++.h>
#include <iostream>
#include <cstdio>
#define LL long long
using namespace std;
const int N=;
int a[N];
int b[N]; int cal()
{
int ans=;
ans=(/*(-a[])-b[]* >*0.4? /*(-a[])-b[]*: *0.4 );
ans+=(/*(-a[])-b[]*>*0.4? /*(-a[])-b[]*: *0.4);
ans+=(/*(-a[])-b[]*>*0.4? /*(-a[])-b[]*: *0.4);
ans+=(/*(-a[])-b[]*>*0.4? /*(-a[])-b[]*: *0.4);
return ans;
}
int main()
{
// freopen("input.txt", "r", stdin);
int t, j=;
cin>>t;
while(t--)
{
scanf("%d%d",&a[],&b[]);
scanf("%d%d",&a[],&b[]);
scanf("%d%d",&a[],&b[]);
scanf("%d%d",&a[],&b[]);
printf("Case #%d: %d\n",++j,cal());
}
return ;
}
AC代码
HDU 5268 ZYB loves Score (简单模拟,水)的更多相关文章
- hdu 5268 ZYB loves Score 水题
ZYB loves Score Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?p ...
- 【HDU 4452 Running Rabbits】简单模拟
两只兔子Tom和Jerry在一个n*n的格子区域跑,分别起始于(1,1)和(n,n),有各自的速度speed(格/小时).初始方向dir(E.N.W.S)和左转周期turn(小时/次). 各自每小时往 ...
- HDU 5805 NanoApe Loves Sequence (模拟)
NanoApe Loves Sequence 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5805 Description NanoApe, the ...
- hdu 4414 Finding crosses【简单模拟】
题目:http://acm.hdu.edu.cn/showproblem.php?pid=4414 CSUST:点击打开链接 Finding crosses Time Limit: 2000/1000 ...
- HDOJ 1008. Elevator 简单模拟水题
Elevator Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Su ...
- HDU 5806 NanoApe Loves Sequence Ⅱ (模拟)
NanoApe Loves Sequence Ⅱ 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5806 Description NanoApe, t ...
- HDU 5995 Kblack loves flag (模拟)
题目链接 Problem Description Kblack loves flags, so he has infinite flags in his pocket. One day, Kblack ...
- hdu 1200 To and Fro(简单模拟或DP)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1200 To and Fro Time Limit: 2000/1000 MS (Java/Others ...
- hdu 5269 ZYB loves Xor I
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission( ...
随机推荐
- iOS导航栏-导航栏透明
设置一张透明图片:nav_bargound.png //导航栏背景 [self.navigationController.navigationBar setBackgroundImage:[ ...
- java集合之ArrayList的实现原理
1. ArrayList概述: ArrayList是List接口的可变数组的实现.实现了所有可选列表操作,并允许包括 null 在内的所有元素.除了实现 List 接口外,此类还提供一些方法来操作内部 ...
- procedure can't return a result set in the given context
调用存储过程失败!出现如下错误:PROCEDURE ipbx.qu_ery can't return a result set in the given context, ipbx是数据库, qu_e ...
- editplus的各式插件
C/C++, Java, JSP, C#, .NET, SQL, Pascal, Python, Assembly, Basic files http://www.editplus.com/javac ...
- 多线程系列 线程池ThreadPool
上一篇文章我们总结了多线程最基础的知识点Thread,我们知道了如何开启一个新的异步线程去做一些事情.可是当我们要开启很多线程的时候,如果仍然使用Thread我们需要去管理每一个线程的启动,挂起和终止 ...
- SSH开发实践part3:hibernate继承映射
0 大家好.上次讲了关于hibernate中双向1-N的映射配置,可以参考:http://www.cnblogs.com/souvenir/p/3784510.html 实际项目中,对象间的关系比较复 ...
- C#网页采集
/// <summary> /// 返回提取数组 /// </summary> /// <param name="rex">正则</par ...
- JLINK V8 升级5.12E 在MDK5.20不变砖
转载:只是用了新的固件,步骤跟原子提供的方法 是一模一样的.这边也把步骤写了上来. 使用 SAM-PROG 更新 JLINK 固件一 :安装软件 安装 Install AT91-ISP v1.13.e ...
- WordPress主题制作教程5:循环
wordpress循环分两种,一种是自定义循环,一种是默认循环. 自定义循环:根据指定参数进行实例化 调用所有页面,post_type值:page对应页面,post对应文章 <?php $arg ...
- Largest Rectangle in Histogram-最大长方形
题目描述: 给定n个非负整数height[n],分别代表直方图条的高,每个条的宽设为1,求直方图中面积最大的矩形的面积 题目来源: http://oj.leetcode.com/problems/la ...