The 9th Zhejiang Provincial Collegiate Programming Contest->Problem D:D - Draw Something Cheat
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3603
题意:在给出的字符串中找出每行都出现的字母按字典序排序。
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin>>t;
while(t--) {
int num[107],num1[107];
char s[107];
int n;
cin>>n;
memset(num,0x3f3f3f3f,sizeof(num));
memset(num1,0,sizeof(num1));
for(int i=0; i<n; i++) {
scanf("%s",s);
memset(num1,0,sizeof(num1));
for(int j=0; j<12; j++)
num1[s[j]-'A']++;//记录字母出现的次数
for(int k=0; k<26; k++)
num[k]=min(num[k],num1[k]);//每次去记录的字符串中每个字母出现的最少的次数
}
for(int k=0; k<26; k++)
for(int j=0; j<num[k]; j++)
printf("%c",k+'A');
printf("\n");
}
return 0;
}
The 9th Zhejiang Provincial Collegiate Programming Contest->Problem D:D - Draw Something Cheat的更多相关文章
- zoj The 12th Zhejiang Provincial Collegiate Programming Contest Capture the Flag
http://acm.zju.edu.cn/onlinejudge/showContestProblem.do?problemId=5503 The 12th Zhejiang Provincial ...
- zoj The 12th Zhejiang Provincial Collegiate Programming Contest Team Formation
http://acm.zju.edu.cn/onlinejudge/showContestProblem.do?problemId=5494 The 12th Zhejiang Provincial ...
- zoj The 12th Zhejiang Provincial Collegiate Programming Contest Beauty of Array
http://acm.zju.edu.cn/onlinejudge/showContestProblem.do?problemId=5496 The 12th Zhejiang Provincial ...
- zoj The 12th Zhejiang Provincial Collegiate Programming Contest Lunch Time
http://acm.zju.edu.cn/onlinejudge/showContestProblem.do?problemId=5499 The 12th Zhejiang Provincial ...
- zoj The 12th Zhejiang Provincial Collegiate Programming Contest Convert QWERTY to Dvorak
http://acm.zju.edu.cn/onlinejudge/showContestProblem.do?problemId=5502 The 12th Zhejiang Provincial ...
- zoj The 12th Zhejiang Provincial Collegiate Programming Contest May Day Holiday
http://acm.zju.edu.cn/onlinejudge/showContestProblem.do?problemId=5500 The 12th Zhejiang Provincial ...
- zoj The 12th Zhejiang Provincial Collegiate Programming Contest Demacia of the Ancients
http://acm.zju.edu.cn/onlinejudge/showContestProblem.do?problemId=5504 The 12th Zhejiang Provincial ...
- zjuoj The 12th Zhejiang Provincial Collegiate Programming Contest Ace of Aces
http://acm.zju.edu.cn/onlinejudge/showContestProblem.do?problemId=5493 The 12th Zhejiang Provincial ...
- 140 - The 12th Zhejiang Provincial Collegiate Programming Contest(第二部分)
Floor Function Time Limit: 10 Seconds Memory Limit: 65536 KB a, b, c and d are all positive int ...
- The 15th Zhejiang Provincial Collegiate Programming Contest Sponsored by TuSimple - L Doki Doki Literature Club
Doki Doki Literature Club Time Limit: 1 Second Memory Limit: 65536 KB Doki Doki Literature Club ...
随机推荐
- Jsoup 的认识和简单使用
之前做学校软件协会APP的时候,由于自己不会在服务端写接口,所以服务端一直是由另一位Z同学完成的,但是突然Z同学被老师调到泸州帮以前的学长做一个月的临时web开发去了,所以协会APP的接口只做了一部分 ...
- AIDL简单使用
1.AIDL定义 AIDL是android interface definition language的缩写,它对android IPC组件Binder进行了封装.使用它不需理会底层IPC的实现,只需 ...
- Android 扫描蓝牙设备
Android扫描蓝牙设备是个异步的过程,核心的步骤为:调用bluetoothAdapter的startDiscovery()进行设备扫描,扫描的结果通过广播接收处理!具体如下: 1.申请相关权限 & ...
- Android之View方法
onFinishInflate() 回调方法,当应用从XML加载该组件并用它构建界面之后调用的方法 onMeasure() 检测View组件及其子组件的大小 onLayout() 当该组件需要分配其子 ...
- STL vector+sort排序和multiset/multimap排序比较
由 www.169it.com 搜集整理 在C++的STL库中,要实现排序可以通过将所有元素保存到vector中,然后通过sort算法来排序,也可以通过multimap实现在插入元素的时候进行排序.在 ...
- win2003域控制器密码遗忘如何修改
在公司遇到这么个事儿,员工搭建QC服务器,设置了域账户登陆系统.但忘记了登录密码,使用PE直接修改sam文件不好用. 1.使用PE进系统修改组登陆方式的账号administrator密码 需符合复 ...
- Contoso 大学 - 9 - 实现仓储和工作单元模式
原文 Contoso 大学 - 9 - 实现仓储和工作单元模式 By Tom Dykstra, Tom Dykstra is a Senior Programming Writer on Micros ...
- 更新Android SDK 访问谷歌等无需代理方法
最近要做ANDROID,本来是想通过找镜像网址下载,发现公司网络屏蔽了,后来网络上搜索一圈,发现如下方法 1)更改HOST 2)使用代理 使用代理在公司的环境中属于违规操作,因此不能使用 只剩更改HO ...
- get post
浅谈HTTP中Get与Post的区别 2009-03-31 14:51 by hyddd, 248341 阅读, 74 评论, 收藏, 编辑 Http定义了与服务器交互的不同方法,最基本的方法有4种, ...
- python(五)图形用户界面easyGUI入门
1.首先我们配置环境 先在网上下载一个包文件 2.然后在命令行输入安装命令 3.安装完成后看一下具体安装到了哪里 4.下面进入正题 运行程序: 如果你觉得对话框太大,可以在easygui的配置文件里修 ...