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的更多相关文章

  1. 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 ...

  2. zoj The 12th Zhejiang Provincial Collegiate Programming Contest Team Formation

    http://acm.zju.edu.cn/onlinejudge/showContestProblem.do?problemId=5494 The 12th Zhejiang Provincial ...

  3. 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 ...

  4. zoj The 12th Zhejiang Provincial Collegiate Programming Contest Lunch Time

    http://acm.zju.edu.cn/onlinejudge/showContestProblem.do?problemId=5499 The 12th Zhejiang Provincial ...

  5. 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 ...

  6. 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 ...

  7. 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 ...

  8. 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 ...

  9. 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 ...

  10. 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 ...

随机推荐

  1. 找出文件正在被哪个windows进程使用的方法

    Ever try to delete, move, or rename a file only to get a Windows system warning with something like ...

  2. 安装程序无法初始化。请下载Adobe Support Advisor检测该问题

    adobe FLASH BUILDER 4.6在安装时出现各种各样的问题,虽然绿化版安装方便,但是平均5分钟一崩溃实在让人头大.安装时出现“安装程序无法初始化.请下载Adobe Support Adv ...

  3. Android的按钮单击事件及监听器四种常见的实现方式

    第一种:匿名内部类作为事件监听器类<ignore_js_op>大部分时候,事件处理器都没有什么利用价值(可利用代码通常都被抽象成了业务逻辑方法),因此大部分事件监听器只是临时使用一次,所以 ...

  4. TSQL基础(二)

    over() 开窗函数 排名函数必须和over()一起使用,所以先了解over(). OVER 子句定义查询结果集内的窗口或用户指定的行集. 然后,开窗函数将计算窗口中每一行的值. 您可以将 OVER ...

  5. sql语句聚合等疑难问题收集

    ------------------------------------------------------------------------------------ 除法运算 select 500 ...

  6. swift基础知识学习

    用let来声明常量,用var来声明变量   声明变量: var x = 0.0, y = 0.0, z = 0.0 var welcomeMessage: String 常量和变量的命名 你可以用任何 ...

  7. xml的生成与解析_老师笔记

    使用序列化器生成一个xml文件 //1,初始化一个xml文件的序列化器 XmlSerializer serializer = Xml.newSerializer(); //2.初始化序列器参数 Fil ...

  8. CSDN 自动评论

    转载说明 本篇文章可能已经更新,最新文章请转:http://www.sollyu.com/csdn-auto-reviews/ 说明 当打开http://download.csdn.net/my/do ...

  9. java学习笔记_GUI(3)

    如何加入自己定义的Panel import javax.swing.*; import java.awt.event.*; import java.awt.*; 5 class MyPanel ext ...

  10. web响应式之bootstrap的基础用法。

    1/首先必须在head里面引用视窗viewport,以保证之后可以响应式分布 <!--meta:vp 响应式布局--> <meta name="viewport" ...