CSU Scientific Conference
来源:互联网 发布:洗车哪个软件好 编辑:程序博客网 时间:2024/05/21 08:51
贪心:
#include<stdio.h>#include<stdlib.h>#define MAXN 100000 + 100int Ts[MAXN], Te[MAXN], r[MAXN], n, num;int cmp(const void *_p, const void *_q){ int *p = (int *)_p; int *q = (int *)_q; return Te[*p] - Te[*q];}void init(){ while(~scanf("%d",&n)) { for(int i = 0; i < n; i ++) { scanf("%d%d",&Ts[i],&Te[i]); r[i] = i; } qsort(r,n,sizeof(r[0]),cmp); num = 1; int t = 0; for(int i = 1; i < n; i ++) { if(Ts[r[i]]>Te[r[t]]) { num ++; t = i; } } printf("%d\n",num); }}int main(){ init(); return 0;}
0 0
- CSU Scientific Conference
- CSU 1065 Scientific Conference 贪心(基本的调度问题)
- Scientific Conference
- Timus 1203. Scientific Conference
- Ural 1203. Scientific Conference
- ural 1203. Scientific Conference
- Ural 1203 Scientific Conference
- URAL 1203 Scientific Conference
- Ural 1203 Scientific Conference
- coj1065: Scientific Conference
- CSU1065-Scientific Conference-贪心
- URAL 1203 Scientific Conference (贪心)
- 1203. Scientific Conference 解题报告 URAL
- URAL 1203 Scientific Conference(贪心 || DP)
- URAL 1203Scientific Conference dp练习
- URAL 1203 Scientific Conference (贪心 + 优化)
- [贪心][DP][Ural 1203]Scientific Conference
- ural 1203. Scientific Conference(贪心or dp)
- 第一周项目3 时间程序
- UVA 10617 - Again Palindrome
- C++时间标准库时间time和系统时间的使用
- UVA 11081 - Strings
- UVA 11137 - Ingenuous Cubrency
- CSU Scientific Conference
- Linux监测日志调试利器tail命令详细使用
- g729源码分析-1-lpc分析
- UVA 567 - Risk
- UVA 10034 - Freckles
- UVA 10048 - Audiophobia
- UVA 10397 - Connect the Campus
- UVA 10369 - Arctic Network
- 每日一题 隐式图 倒水问题