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( ...
随机推荐
- 只 一行显示可左右滚动的文本(UITextField中文限制)
// // ViewController.m // 一行显示可滚动的文本 // // Created by apple on 15-5-8. // Copyright (c) 2015年 apple. ...
- 深入浅出ES6(十六):模块 Modules
作者 Jason Orendorff github主页 https://github.com/jorendorff 早在2007年我刚加入Mozilla的JavaScript团队的时候广为流传一个 ...
- ***mysql中查询今天、昨天、上个月sql语句
今天 select * from 表名 where to_days(时间字段名) = to_days(now()); 昨天Select * FROM 表名 Where TO_DAYS( NOW( ) ...
- 机器学习之逻辑回归(Logistic Regression)
1. Classification 这篇文章我们来讨论分类问题(classification problems),也就是说你想预测的变量 y 是一个离散的值.我们会使用逻辑回归算法来解决分类问题. 之 ...
- C#反射Assembly 详细说明
1.对C#反射机制的理解2.概念理解后,必须找到方法去完成,给出管理的主要语法3.最终给出实用的例子,反射出来dll中的方法 反射是一个程序集发现及运行的过程,通过反射可以得到*.exe或*.dll等 ...
- 【转】Linux写时拷贝技术(copy-on-write)
http://www.cnblogs.com/biyeymyhjob/archive/2012/07/20/2601655.html 源于网上资料 COW技术初窥: 在Linux程序中,fork()会 ...
- 华为OJ:字符串合并处理
字符串合并处理 按照指定规则对输入的字符串进行处理. 详细描述: 将输入的两个字符串合并. 对合并后的字符串进行排序,要求为:下标为奇数的字符和下标为偶数的字符分别从小到大排序.这里的下标意思是字符在 ...
- iOS开发--自动布局
距离左边的: 距离顶部的: 距离右边的: 距离底部的:
- 让浏览器屏蔽js
有时候为了测试js是否做到了渐进增强,需要屏蔽下js 做法: Internet选项>>安全>>自定义级别 禁用java小程序脚本和活动脚本 有的浏览器调试器直接就有这个功能
- 307. Range Sum Query - Mutable
题目: Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclu ...