计算机学院大学生程序设计竞赛(2015’12) 1001 The Country List
#include<cstdio>
#include<cstring>
#include<cmath>
#include<string>
#include<vector>
#include<map>
#include<algorithm>
using namespace std; char s[+][+];
int n;
map<string ,int>m; int main()
{
while(~scanf("%d",&n)){
for(int i=;i<n;i++) scanf("%s",s[i]);
m.clear();
for(int i=;i<n;i++)
{
int len=strlen(s[i]);
for(int j=;j<len;j++)
{
if(s[i][j]>='A'&&s[i][j]<='Z') s[i][j]=s[i][j]-'A'+'a';
}
} // for(int i=0;i<n;i++) printf("%s\n",s[i]);
int ans=;
for(int i=;i<n;i++)
{
for(int j=i+;j<n;j++)
{
if(strlen(s[i])==strlen(s[j]))
{
int len=strlen(s[i]);
int num=;
for(int k=;k<len;k++)
{
if(s[i][k]==s[j][k]) num++;
}
if(num>)
{
if(m[s[i]]==) ans++;
if(m[s[j]]==) ans++;
m[s[i]]=;
m[s[j]]=; }
}
}
}
printf("%d\n",ans);
}
return ;
}
计算机学院大学生程序设计竞赛(2015’12) 1001 The Country List的更多相关文章
- hdu 计算机学院大学生程序设计竞赛(2015’11)
搬砖 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others)Total Submissi ...
- 计算机学院大学生程序设计竞赛(2015’11)1005 ACM组队安排
1005 ACM组队安排 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Pro ...
- 计算机学院大学生程序设计竞赛(2015’12)Polygon
Polygon Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Su ...
- 计算机学院大学生程序设计竞赛(2015’12)Study Words
Study Words Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Tota ...
- 计算机学院大学生程序设计竞赛(2015’12)01 Matrix
01 Matrix Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total ...
- 计算机学院大学生程序设计竞赛(2015’12)The Country List
The Country List Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) ...
- 计算机学院大学生程序设计竞赛(2015’12) 1008 Study Words
#include<cstdio> #include<cstring> #include<map> #include<string> #include&l ...
- 计算机学院大学生程序设计竞赛(2015’12) 1009 The Magic Tower
#include<cmath> #include<cstdio> #include<cstring> #include<algorithm> using ...
- 计算机学院大学生程序设计竞赛(2015’12) 1006 01 Matrix
#include<stdio.h> #include<string.h> #include<iostream> #include<algorithm> ...
随机推荐
- java web 项目如何部署到互联网中 通过输入域名访问?
https://segmentfault.com/q/1010000000710271
- table新增空白行到首行
var str=""; str+="<tr bordercolor='#DEDEDE' bgcolor='#ffffff'>"; str+=&quo ...
- VC2010编译错误
1. cannot convert parameter 1 from 'const char [43]' to 'LPCWSTR' 我是看了这个之后解决问题的~ http://blog.163.com ...
- iOS View 模糊效果(毛玻璃)
iOS View 模糊效果(毛玻璃) 相关资料 http://stackoverflow.com/questions/18404907/using-gpuimage-to-recreate-ios ...
- 2.1 实践篇:使用ping来检测网速
1. Windows功能键+R ,打开cmd窗口 2. ping -n 200 www.baidu.com #ping网站www.baidu.com ,连续200次.验证连接. 可以ctrl+C 强制 ...
- asm: Writing Inline Assembly
A usual IA includes these parts: asm [volatile] ( AssemblerTemplate : OutputOperands [ : InputOperan ...
- Android简单逐帧动画Frame的实现(二)
Android简单逐帧动画Frame的实现 Android简单逐帧动画Frame的实现 1.逐帧动画 即是通过播放预先排序好的图片来实现动态的画面,感觉像是放电影. 2.实现步骤: 1. 在工程里 ...
- AI 人工智能 探索 (三)
三类子弹的设计 using UnityEngine; using System.Collections; public class AI : AssembleModel { private Hasht ...
- HDU1548:A strange lift
A strange lift Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other) Tota ...
- java 数组流
Example10_10.java import java.io.*; public class Example10_10 { public static void main(String args[ ...