hdu2600 War
来源:互联网 发布:迪克斯特拉算法的例题 编辑:程序博客网 时间:2024/05/08 01:28
#include <iostream>#include <cstring>#include <string>#include <algorithm>using namespace std;class war{ public: int starttime; int endtime; bool vis;};bool cmp(war a,war b){ if(a.endtime!=b.endtime) return b.endtime>a.endtime; else return a.starttime>b.starttime;}war tar[150];int main(){ int testcase; while(cin>>testcase) { memset(tar,0,sizeof(tar)); string tmp; int res=0; int flag=0; int stp,edp; cin>>stp>>edp; for(int i=0;i<testcase;i++) { cin>>tar[i].starttime>>tar[i].endtime; getline(cin,tmp); tar[i].vis=0; } sort(tar,tar+testcase,cmp); if(tar[0].endtime<edp) { cout<<edp<<endl; continue; } for(int i=0;i<testcase;i++) { if(tar[i].endtime>=res) { if(res>=tar[i].starttime) res=tar[i].starttime; } else { flag=1; break; } } if(flag==1) cout<<res-1<<endl; else cout<<"Badly!"<<endl; } return 0;}
- hdu2600 War
- hdu2600
- hdu2600
- hdu2600(贪心)
- War
- .war
- .war
- War
- war
- exploded war VS war
- Original War
- 做war
- jar war |
- 生成.war
- 打war
- WAR文件
- JAR WAR
- .war文件
- 局部加权回归、最小二乘的概率解释、逻辑斯蒂回归、感知器算法——斯坦福ML公开课笔记3
- c语言 输入/输出函数
- java学习笔记(5)——内部类
- Cocos2d-x IOS录音
- redhat linux 5.6下安装jdk和tomcat
- hdu2600 War
- oracle基础-表空间(一)
- 牛顿方法、指数分布族、广义线性模型、多项式分布——斯坦福ML公开课笔记4
- Java基础:Java事务处理类型/差异总结
- POJ-2262-Goldbach's Conjecture
- linux screen命令的使用
- memcache 共享
- 败者树和胜者树
- hdu 4648