zoukankan      html  css  js  c++  java
  • L1-060 心理阴影面积

    xlyy.JPG

    这是一幅心理阴影面积图。我们都以为自己可以匀速前进(图中蓝色直线),而拖延症晚期的我们往往执行的是最后时刻的疯狂赶工(图中的红色折线)。由红、蓝线围出的面积,就是我们在做作业时的心理阴影面积。

    现给出红色拐点的坐标 (,要求你算出这个心理阴影面积。

    输入格式:

    输入在一行中给出 2 个不超过 100 的正整数 x 和 y,并且保证有 x>y。这里假设横、纵坐标的最大值(即截止日和最终完成度)都是 100。

    输出格式:

    在一行中输出心理阴影面积。

    友情提醒:三角形的面积 = 底边长 x 高 / 2;矩形面积 = 底边长 x 高。嫑想得太复杂,这是一道 5 分考减法的题……

    输入样例:

    90 10
    

    输出样例:

    4000
    
     
    思路:小学数学题,略水略水......
     
     1 #include<iostream>
     2 #include<cstdio>
     3 #include<cstring>
     4 #include<algorithm>
     5 #include<map>
     6 #include<set>
     7 #include<vector>
     8 using namespace std;
     9 #define ll long long 
    10 #define dd cout<<endl
    11 const int inf=99999999;
    12 const int mod=1e9+7;
    13 const int maxn=1e5+7;
    14 int main()
    15 {
    16     int x,y;
    17     cin>>x>>y;
    18     int area=100*100/2-x*y/2-(100-x)*y-(100-x)*(100-y)/2;
    19     cout<<area<<endl;
    20     return 0;
    21 }
    大佬见笑,,
  • 相关阅读:
    The Tamworth Two chapter 2.4
    USACO Controlling Companies chapter 2.3 已跪
    非递归快排
    链表二路归并
    Money Systems chapter 2.3 dp
    #pragma pack与sizeof union
    快慢指针
    12
    11
    10
  • 原文地址:https://www.cnblogs.com/xwl3109377858/p/10641997.html
Copyright © 2011-2022 走看看