当前位置:网站首页>L1-060 心理阴影面积 (5 分)
L1-060 心理阴影面积 (5 分)
2022-04-21 22:15:00 【WTXYL】

这是一幅心理阴影面积图。我们都以为自己可以匀速前进(图中蓝色直线),而拖延症晚期的我们往往执行的是最后时刻的疯狂赶工(图中的红色折线)。由红、蓝线围出的面积,就是我们在做作业时的心理阴影面积。
现给出红色拐点的坐标 (x,y),要求你算出这个心理阴影面积。
输入格式:
输入在一行中给出 2 个不超过 100 的正整数 x 和 y,并且保证有 x>y。这里假设横、纵坐标的最大值(即截止日和最终完成度)都是 100。
输出格式:
在一行中输出心理阴影面积。
友情提醒:三角形的面积 = 底边长 x 高 / 2;矩形面积 = 底边长 x 高。嫑想得太复杂,这是一道 5 分考减法的题……
输入样例:
90 10
输出样例:
4000
代码:
#include <cstdio>
int main(){
int x, y;
scanf("%d %d", &x, &y);
int ans = 5000 - x * y / 2 - (100 - x) * (100 - y) / 2 - (100 - x) * y;
printf("%d", ans);
}
版权声明
本文为[WTXYL]所创,转载请带上原文链接,感谢
https://blog.csdn.net/weixin_46891900/article/details/124221096
边栏推荐
猜你喜欢

每日练题(3)

INT 102_ TTL 09

Reading notes "autumn garden", "driftwood", "my fragrance"

Gd32f103 learning notes (8) -- use of ADC interface

Document de conception de l'architecture du système de gestion des étudiants externalisé

诚邀报名丨首期OpenHarmony开发者成长计划分享日

Vscode 插件包下载并离线安装

Oracle query execution plan

Idea operates redis on Linux through jedis; Failed to connect to any host resolved for DNS name

Kotlin crawler app, Android development, interview preparation
随机推荐
[WebGIS] Introduction to WebGIS, desktop GIS, mobile GIS and 3D GIS
Definition of software testing
Start debugging the dynamic linker of C Library-2 -- musl-c
每日练题(3)
【ES6】Generator
[ES6] iterator and forof loop
【VSCode】调试器debugger详细使用手册
微信小程序自定义tabbar
[ES6] module import and export
OpenCV中的图像处理——离散傅里叶变换实例(11)
Gd32f103 learning notes (8) -- use of ADC interface
Oracle query execution plan
Interview must brush algorithm top101 knapsack nine lectures top14
【ES6】Promise
regular expression
Windowns offline wsl2 installation
Database design and Implementation
Free your hands and recommend a low code tool open source by Alibaba, yyds~
Interview must brush algorithm top101 knapsack nine lectures Top13
Algorithm -- merge K ascending linked lists (kotlin)