题解 CF604A 【Uncowed Forces】
这题比较简单,套用公式就好了,不用转int,直接用double算就OK的,677ms,目前第3
代码:
#include <iostream>
#include <algorithm>
using namespace std;
double m[10], w[10], score[10];
double AC, WA, ans = 0;
int main()
{
for(int i = 1; i <= 5; i++)
{
score[i] = score[i - 1] + 500;//顺便初始化,第一次因为score[0] = 0,所以 + 500可以得到500的
cin >> m[i];
}
for(int i = 1; i <= 5; i++)
{
cin >> w[i];
}
cin >> AC >> WA;
for(int i = 1; i <= 5; i++)
{
ans += max(score[i] * 0.3, (1.0 - m[i] / 250) * score[i] - 50 * w[i]);//公式不说
}
ans += 100 * AC - 50 * WA;//注意这个
cout << ans << endl;
return 0;
}
分类:
题解
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· ollama系列01:轻松3步本地部署deepseek,普通电脑可用
· 25岁的心里话
· 按钮权限的设计及实现