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. SSRS 传多值参数问题

    SSRS报表参数是可单值或者多值.之前有个小伙伴问我,如果要传多值怎么传.然后我试了在各个参数之间,放换行符放逗号分号等都未能解决问题,最后想明白这个参数接受的应该是非字符类型,很大可能是数组,然后我 ...

  2. CSS 文字溢出时的自动隐藏

    http://www.111cn.net/cssdiv/css/34050.htm 语法:overflow : visible | auto | hidden | scroll visible::不剪 ...

  3. Android的selector,背景选择器

    原文地址 http://android.blog.51cto.com/268543/564581 首先android的selector是在drawable/xxx.xml中配置的,相关图片放在同目录下 ...

  4. JavaScript 函数的执行过程

    每一个JavaScript函数都是Function对象的一个实例, 它有一个仅供JavaScript引擎存取的内部属性[[Scope]]. 这个[[Scope]]存储着一个作用域的集合, 这个集合就叫 ...

  5. 前端笔记——获取url里面的参数值

    备注 var url=window.location.href;//获取地址栏 url var index=url.indexOf('#');//获取#的位置 var paramVal=url.sub ...

  6. 函数 sort,unique,stable_sort,count_if,谓词

    bool isShorter(const string &s1,const string &s2) { return s1.size() < s2.size(); } bool ...

  7. browserify总结

    一.browserify 简介 browserify is a tool for compiling node-flavored commonjs modules for the browser. Y ...

  8. 锋利的jquery-事件和动画

    1 注册事件的触发时机 在jquery中,$(window).load(function(){}) 注册在window下的事件等待页面所有资源加载完成(包括dome树的加载和图片视频的资源的加载) $ ...

  9. linux的SVN搭建与同步

    以下的配置文件,开头都不能有空格 安装: yum install subversion 验证:svnserve --version 代码库创建:(类似,可以建立多个仓库)[repo]mkdir -p ...

  10. asp.net 点击按钮,页面没有任何变化,后台代码不触发

    asp.net 点击按钮,页面没有任何变化,后台代码不触发 和可能是 asp.net button  缺少validationGroup 导致的,需要查看页面的validation并且让他们抛出错误信 ...