标签:
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 2598 Accepted Submission(s): 615
#include<stdio.h> //#include<bits/stdc++.h> #include<string.h> #include<iostream> #include<math.h> #include<sstream> #include<set> #include<queue> #include<map> #include<vector> #include<algorithm> #include<limits.h> #define inf 0x3fffffff #define INF 0x3f3f3f3f #define lson l,m,rt<<1 #define rson m+1,r,rt<<1|1 #define LL long long #define ULL unsigned long long using namespace std; int n; string ss[100]; set<string> q; int main () { while(cin>>n) { int i,j; for(i=0; i<n; i++) { cin>>ss[i]; } for(i=0; i<n; i++) { for(j=0; j<n; j++) { int sum=0; if(i==j) continue; if(ss[i].length()==ss[j].length()) { for(int z=0; z<ss[i].length(); z++) { if(ss[i][z]==ss[j][z]||abs(ss[i][z]-ss[j][z])==32) { sum++; } } if(sum>2) { // cout<<ss[i]<<" "<<ss[j]<<endl; q.insert(ss[j]); } } } } cout<<q.size()<<endl; q.clear(); } return 0; }
HDU计算机学院大学生程序设计竞赛(2015’12)The Country List
标签:
原文地址:http://www.cnblogs.com/yinghualuowu/p/5087064.html