1129
来源:互联网 发布:linux 网卡驱动 编辑:程序博客网 时间:2024/04/29 18:07
模拟水过...
#include <cstdio>#include <set>using namespace std;int main(){int n;set<int> color[26];while(scanf("%d", &n), n){for(int i = 0; i < n; ++i){color[i].clear();}int col = 0;for(int i = 0; i < n; ++i){char tmp[30], * const p = &tmp[2];scanf("%s", tmp);int check = 0;for(set<int>::iterator bgn = color[i].begin(); check < col && bgn != color[i].end() && *bgn == check; ++check, ++bgn);if(check == col){++col;}for(int j = 0; p[j]; ++j){color[p[j] - 'A'].insert(check);}}if(1 == col){printf("1 channel needed.\n");}else{printf("%d channels needed.\n", col);}}return 0;}
- 1129
- 1129
- 1129
- 1129
- 1129
- 1129
- 1129
- 1129 WSADATA
- 1129: Divisibility
- POJ 1129
- sicily 1129
- HDOJ 1129
- POJ 1129
- poj 1129
- poj--1129
- POJ 1129
- POJ 1129
- PKU 1129
- 优化算法-寻找最优解
- 测试工具 LoadRunner
- Iterator(迭代器)的一般用法
- Oracle数据库创建表ID字段的自动递增
- 大学毕业后,留在北京的人,要坚强!
- 1129
- Ubuntu10.10上配置安装LAMP
- iconv 的技巧
- 第一次当审稿人
- win7下myeclipse/eclipse使用subclipse进行checkout时自动关闭问题
- Ckeditor编辑器在JAVA中的使用与配置
- 用汇编的眼光看C++(之虚函数)
- linux学习笔记(十) linux下查找文件、字符串
- res/ 资源(Resource)目录简介