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. js限制文本框输入字数

    //js代码 <script type="text/javascript"> function checkLen(term){ document.all.termLen ...

  2. SQLite CRUD操作

    SQLite CRUD操作代码实例: 1:首先创建一个继承了SQLiteOpenHelper类的MyDatabaseHelper类.实现他的onCreate(SQLiteDatabase db) on ...

  3. 使用zipalign.exe工具优化APK安装包

    zipalign.exe是Android自带的一个档案整理工具,它可以用于优化APK安装包,从而提升Android应用与系统之间的交互效率,提升应用程序的运行速度. 操作步骤: 1.在命令行窗口输入如 ...

  4. 省市数据递归加载到TreeView

    using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...

  5. sql还原数据库时候,遇到数据库被占用的解决情况

    最近上班时候,经常要做数据库还原,时常遇到数据被占用的情况, 执行一句sql语句就可以解决, ALTER DATABASE dbname SET OFFLINE WITH ROLLBACK IMMED ...

  6. MySQL页面打捞工具使用方法

    MySQL数据打捞工具 0.1 windows版 下载 一,选择数据源与输出目录 数据源可以是分区或物理物理磁盘,如\\.\D: 或\\.\PhysicalDrive0; 二,参数设置 请设置扫描参数 ...

  7. HTML5之拖放

    - Draggable 标签  文件拖放 99年IE5开始,05后所有浏览器支持(除了opera) <li id=be draggable=true ondragstart="star ...

  8. 如何管好.net的内存(托管堆和垃圾回收)

    一:C#标准Dispose模式的实现 需要明确一下C#程序(或者说.NET)中的资源.简单的说来,C#中的每一个类型都代表一种资源,而资源又分为两类: 托管资源:由CLR管理分配和释放的资源,即由CL ...

  9. linux 硬盘相关命令学习

    summary: 查看硬盘信息:几块硬盘,品牌,容量 查看分区信息 参考资料: Linux下查看磁盘分区命令详解: http://blog.chinaunix.net/uid-26119273-id- ...

  10. 利用cglib生成动态java bean

    cglib详细学习 http://blog.csdn.net/u010150082/article/details/10901641 cglib-nodep jar报下载 http://grepcod ...