计算机学院大学生程序设计竞赛(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> ...
随机推荐
- VG、LV、rezise2fs、lvresize、fuer使用说明
南沙节点改变LV大小,参考鸟哥第 570页 1.# resize2fs /dev/mapper/vg_niotsvr3-lv_home 150G resize2fs 1.41.12 (17-May-2 ...
- 宏定义重写NSLog
只需要 在ProjectName_Prefix.pch 中追加你对应的宏定义,不用import 就可以直接使用了. #define DEBUG //宏输出函数 #ifdef DEBUG #define ...
- ActiveMQ-CPP编译
1.activemq-cpp下载地址: http://activemq.apache.org/cms/download.html 2.相关依赖库 http://mirrors.hust.edu.cn/ ...
- 最佳死链接href= "#" VS href= "javascript:void(0);"
href= "#" 熟悉hash跳转的同学都知道,只是一个hash跳转,跳转到页面的顶部,可以发现地址栏多了一个#,点击返回会返回本页面. href= "javascri ...
- oracle递归查询子节点
通过子节点向根节点追朔. select * from persons.dept start with deptid=76 connect by prior paredeptid=deptid 通过根节 ...
- EditText的一点深入的了解
最近在开发android下的记事本程序时,频繁的使用EditText控件,折腾来折腾去,算是对其的了解更深入了一些.特将这些收获记录如下: 一.几个属性的介绍 android:gravity=&quo ...
- JUST SORT
We define B is a Divisor of one number A if A is divisible by B. So, the divisors of 12 are 1, 2, 3, ...
- linux内核移植到S5pv210
make s5pv210_defconfig 1.System Type ---> (0) S3C UART to use for low-level messages 2.Kernel ha ...
- 使用runloop阻塞线程的正确写法
使用runloop阻塞线程的正确写法 runloop可以阻塞线程,等待其他线程执行后再执行. 比如: @implementation ViewController{ BOOL end;}…– ( ...
- Unity3D项目优化(转)
前言: 刚开始写这篇文章的时候选了一个很土的题目...<Unity3D优化全解析>.因为这是一篇临时起意才写的文章,而且陈述的都是既有的事实,因而给自己“文(dou)学(bi)”加工留下的 ...