The 9th Zhejiang Provincial Collegiate Programming Contest->Problem D:D - Draw Something Cheat
来源:互联网 发布:java高级程序员面试题 编辑:程序博客网 时间:2024/05/03 18:56
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;}
0 0
- The 9th Zhejiang Provincial Collegiate Programming Contest->Problem D:D - Draw Something Cheat
- The 9th Zhejiang Provincial Collegiate Programming Contest->Problem D:D - Draw Something Cheat
- The 12th Zhejiang Provincial Collegiate Programming Contest - D
- The 13th Zhejiang Provincial Collegiate Programming Contest D The Lucky Week
- The 8th Zhejiang Provincial Collegiate Programming Contest / D - String Successor
- 2016 浙江省赛 The 13th Zhejiang Provincial Collegiate Programming Contest D题 循环节
- The 14th Zhejiang Provincial Collegiate Programming Contest Sponsored by TuSimple(A+B+C+D)
- ZOJ-The 14th Zhejiang Provincial Collegiate Programming Contest Sponsored by TuSimple-D
- The 9th Zhejiang Provincial Collegiate Programming Contest
- The 9th Zhejiang Provincial Collegiate Programming Contest
- The 9th Zhejiang Provincial Collegiate Programming Contest->Problem A:A - Taxi Fare
- The 9th Zhejiang Provincial Collegiate Programming Contest->Problem :K-Yet Another Story of Rock-pap
- The 9th Zhejiang Provincial Collegiate Programming Contest->Problem A:A - Taxi Fare
- The 7th Zhejiang Provincial Collegiate Programming Contest
- The 6th Zhejiang Provincial Collegiate Programming Contest
- The 8th Zhejiang Provincial Collegiate Programming Contest / L - Javabeans
- The 8th Zhejiang Provincial Collegiate Programming Contest / M - Median
- The 8th Zhejiang Provincial Collegiate Programming Contest
- leetcode--Reverse Bits
- 第一天
- 微信公众平台开发教程
- Android逆向分析(2) APK的打包与安装背后的故事
- 读《借助开源项目,学习软件开发》总结
- The 9th Zhejiang Provincial Collegiate Programming Contest->Problem D:D - Draw Something Cheat
- Retrofit源码解析
- 27-题目1019:简单计算器
- 【程序员在法国】"投资"健康,半年减13公斤
- HDU 2710 Max Factor [Ad Hoc]
- Block循环引用
- 线程
- 计算机网络名词解释
- SQL优化