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( ...
随机推荐
- codeforces 463D Gargari and Permutations(dp)
题目 参考网上的代码的... //要找到所有序列中的最长的公共子序列, //定义状态dp[i]为在第一个序列中前i个数字中的最长公共子序列的长度, //状态转移方程为dp[i]=max(dp[i],d ...
- hdu 1800 Flying to the Mars(简单模拟,string,字符串)
题目 又来了string的基本用法 //less than 30 digits //等级长度甚至是超过了int64,所以要用字符串来模拟,然后注意去掉前导零 //最多重复的个数就是答案 //关于str ...
- Javascript 图片延迟加载之理论基础
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <m ...
- 机器学习之多变量线性回归(Linear Regression with multiple variables)
1. Multiple features(多维特征) 在机器学习之单变量线性回归(Linear Regression with One Variable)我们提到过的线性回归中,我们只有一个单一特征量 ...
- sessionID的本质
SessionID的本质 一.客户端用cookie保存了sessionID 客户端用cookie保存了sessionID,当我们请求服务器的时候,会把这个sessionID一起发给服务器,服务器会到内 ...
- java基本数据类型存储范围
数据类型可以分为两大类: 1)基本类型: 2)扩展类型. 先来看一下Java语言的基本数据类型.它包括 类型 描述 取值范围 Boolean 布尔型 只有两个值true.false Char ...
- Linux下面如何安装Django
首先你需要肯定你的机子上装了Python 现在ubuntu已经自带,所以不必操心 当然你可以在你的机子下测试一下,只需在 terminal 下输入 python 如果出现下面的界面就说明你机子已经装了 ...
- Java-马士兵设计模式学习笔记-观察者模式-OOD线程
一.概述 1.情景:孩子睡觉,醒后要吃东西,用java模拟此情况 2.设计:child类,Dad类,都继承Runnable,dad线程监视child线程(缺点:因为要监视,所以耗cup资源) 二.代码 ...
- IME 编程相关
以下内容摘自http://msdn.microsoft.com/zh-cn/goglobal/bb688135.aspx 在 Win32 中处理输入语言的方法 Microsoft Developer ...
- http://my.oschina.net/pangyangyang/blog/144495
http://my.oschina.net/pangyangyang/blog/144495