Playrix Codescapes Cup (Codeforces Round #413, rated, Div. 1 + Div. 2) A题
来源:互联网 发布:swot矩阵分析图 编辑:程序博客网 时间:2024/05/18 02:46
其实这个题就是考虑 某一炉烧烤的始末时间可能会跨越第二个炉形成的时间,
那么就要考虑 是烤完这一炉再用新炉还是不烤等新炉好了再用,,
我是分情况讨论的,看了拖爷的代码感觉神奇的不行
#include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>#include <cmath>#include <set>#include <map>#include <stack>#include <queue>#include <ctype.h>#include <vector>#include <algorithm>// cout << " === " << endl;using namespace std;typedef long long ll;const int maxn = 200 + 7, INF = 0x3f3f3f3f, mod = 1e9+7;int n, t, k, d;int main() { scanf("%d %d %d %d", &n, &t, &k, &d); int cnt = n / k; if(n % k != 0) cnt++; int ans1 = cnt * t; int tt = 0; int n1 = d / t; int n2 = d / t + (d % t == 0 ? 0 : 1); int ans2 = ((cnt-n1) / 2 + ((cnt-n1) % 2 == 1 ? 1 : 0)) * t +d; int ans3 = n2 * t + ((cnt-n2) / 2 + ((cnt-n2) % 2 == 1 ? 1 : 0)) * t; if(ans2 < ans1 || ans3 < ans1) puts("YES"); else puts("NO"); return 0;}
阅读全文
1 0
- Playrix Codescapes Cup (Codeforces Round #413, rated, Div. 1 + Div. 2) A题
- Playrix Codescapes Cup (Codeforces Round #413, rated, Div. 1 + Div. 2) A. Carrot Cakes
- Playrix Codescapes Cup (Codeforces Round #413, rated, Div. 1 + Div. 2) C. Fountains(树状数组)
- Playrix Codescapes Cup (Codeforces Round #413, rated, Div. 1 + Div. 2) C Fountains 乱搞
- Playrix Codescapes Cup (Codeforces Round #413, rated, Div. 1 + Div. 2) C Fountains
- Playrix Codescapes Cup (Codeforces Round #413, rated, Div. 1 + Div. 2) B. T-shirt buying
- [Updating] Playrix Codescapes Cup (Codeforces Round #413, rated, Div. 1 + Div. 2) 解题报告
- Playrix Codescapes Cup (Codeforces Round #413, rated, Div. 1 + Div. 2) B
- codeforcesPlayrix Codescapes Cup (Codeforces Round #413, rated, Div. 1 + Div. 2)A题
- CodeforcesPlayrix Codescapes Cup (Codeforces Round #413, rated, Div. 1 + Div. 2)C题C. Fountains
- codeforcesPlayrix Codescapes Cup (Codeforces Round #413, rated, Div. 1 + Div. 2)B题B. T-shirt buying
- (Codeforces Round #413, rated, Div. 1 + Div. 2)(A+B)
- Codeforces Round #409 (rated, Div. 2, based on VK Cup 2017 Round 2) A -- D
- Codeforces Round #409 (rated, Div. 2, based on VK Cup 2017 Round 2) A. Vicious Keyboard
- Codeforces Round #423 (Div. 1, rated, based on VK Cup Finals) A 题目忘了
- Codeforces Round #405 (rated, Div. 2, based on VK Cup 2017 Round 1)
- Codeforces Round #405 (rated, Div. 2, based on VK Cup 2017 Round 1) 菜鸡只会ABC!
- Codeforces Round #405 (rated, Div. 2, based on VK Cup 2017 Round 1)
- 第八篇:Java垃圾收集机制
- 性能测试知多少 --并发用户数与TPS之间的关系
- webpack构建VUE项目使用jquery及其插件 expose-loader
- Redis核心概念
- SQLServer数据库性能优化
- Playrix Codescapes Cup (Codeforces Round #413, rated, Div. 1 + Div. 2) A题
- Mysql查询
- vs 设置combobox 下拉框高度
- C# WinForm窗体及其控件自适应各种屏幕分辨率
- codis dashboard无法启动
- PHP中this,self,parent的区别
- 求二叉树的先序遍历
- HDU 1029 Ignatius and the Princess IV(水题)
- Sweet alert