codeforces 276A Lunch Rush
来源:互联网 发布:爸爸妈妈的网络用语 编辑:程序博客网 时间:2024/06/04 00:31
点击打开链接
水题,难点全在翻译,还有就是它的最大值不一定为正。
#include <bits/stdc++.h>using namespace std;const int N = 1e4;int M=0x3f3f3f3f;int main(){ int n, k; int f[N + 5], t[N + 5]; cin >> n >> k; int ma = -M; for(int i = 0; i < n; i++) { cin >> f[i] >> t[i]; int m = -M; if(t[i]>k) m=f[i]-(t[i]-k); else m=f[i]; ma=max(ma,m); } if(ma==-M) cout<<"-1"<<endl; else cout<<ma<<endl; return 0;}
阅读全文
0 0
- codeforces 276A Lunch Rush
- A. Lunch Rush
- Lunch Rush
- 1035 Lunch Rush (水题)
- Codeforces ZeptoLab Code Rush 2015 A. King of Thieves
- Codeforces ZeptoLab Code Rush 2015
- 【codeforces】 ZeptoLab Code Rush 2015 A,B,C,D,E题解
- A failure of one rush
- 【codeforces ZeptoLab Code Rush 2015】ABCD题解
- Microservices - Not A Free Lunch!
- Why is everyone in such a rush?
- ZeptoLab Code Rush 2015 -- (A,B,C)
- lunch
- [分块] Codeforces 436F && Zepto Code Rush 2014 F. Banners
- [分块] Codeforces 436F Zepto Code Rush 2014 F. Banners
- A lunch talk带来的启发
- CF Zepto Code Rush 2014 A - Feed with Candy
- Zepto Code Rush 2014-A. Feed with Candy(HACK)
- 混合策略纳什均衡
- java鬼混笔记:用Spring的ResponseEntity和poi进行excel生成和下载
- LintCode408:二进制求和
- java中String的特点
- Unity3D学习笔记4-五子棋实战项目知识点总结
- codeforces 276A Lunch Rush
- LINQ to XML的增、删、改
- CSS--选择器
- 使用脚本一键安装个人博客
- 十月随笔
- 将序列分解为单独的变量
- FFMPEG Qt视频播放器之同步进阶篇
- 171027-函数的预习【连续第四天】
- 第八周LeetCode