CodeForces 10A Power Consumption Calculation
来源:互联网 发布:nginx 与 php fpm集成 编辑:程序博客网 时间:2024/09/21 09:23
思路:水题
#include<bits/stdc++.h>using namespace std;#define LL long longconst int maxn = 105;int n,p1,p2,p3,t1,t2;struct Node{int s;int t;}nodes[maxn];int vis[3000];int main(){ scanf("%d%d%d%d%d%d",&n,&p1,&p2,&p3,&t1,&t2);for (int i = 1;i<=n;i++)scanf("%d%d",&nodes[i].s,&nodes[i].t);for (int i = 1;i<=n;i++)for (int j = nodes[i].s;j<=nodes[i].t;j++)vis[j]=1; LL ans = 0; int now = 0; for (int i = nodes[1].s;i<nodes[n].t;i++) { if (vis[i]==1) now=0,ans+=p1; else if (now>=t1+t2) ans+=p3; else if (now>=t1) ans+=p2; else ans+=p1; now++; } printf("%lld\n",ans);}
0 0
- Codeforces 10A-Power Consumption Calculation(模拟)
- CodeForces 10A Power Consumption Calculation
- CodeForces 10A - Power Consumption Calculation
- CodeForces 10A Power Consumption Calculation
- 10A - Power Consumption Calculation
- Codeforces Beta Round #10 / 10A Power Consumption Calculation (模拟)
- Codeforces Beta Round #10 A. Power Consumption Calculation (模拟)
- A. Power Consumption Calculation
- codefore 10A . Power Consumption Calculation
- CF 10A Power Consumption Calculation
- cf 10a Power Consumption Calculation
- 【水分段函数】#10 A.Power Consumption Calculation
- Optimizing IO Power Consumption
- 【Topics Power】Reduce Power Consumption
- Android audio codec power consumption
- power consumption/capacity unit 耗电 /电池容量
- 【分享】UCI_Individual household electric power consumption Data Set
- the power of IT (it’s not all in energy consumption
- Hessian通信基础
- epoll模型
- 搭建linux环境问题总结
- 数据归一化和两种常用的归一化方法
- reinterpret_cast类型转换运算符的理解
- CodeForces 10A Power Consumption Calculation
- 利用python程序浪漫安慰失恋妹纸
- CodeForces 10B Cinema Cashier
- 微分
- admob 测试ID
- golang注记
- android 重写GridView,让子View能够按指定的大小展示
- 北京林业大学“计蒜客”杯程序设计竞赛 网络赛 C-Candy【模拟】
- hdoj2010(java)水仙花数 格式格式!!!!!!!!!!!!!!