HDU2015 School Race The country List

Source: Internet
Author: User

It's a bad feeling today. Various reading errors test instructions. Water problem ...

That means, give you a few strings. If the same length and the same position characters (no case) the number of more than two is a different string.

1#include <iostream>2#include <cstdio>3#include <cstdlib>4#include <stack>5#include <queue>6#include <vector>7#include <map>8#include <string.h>9#include <algorithm>Ten using namespacestd; One  A Charstr[ the][ the]; - intN; - intMain () the { -      while(~SCANF ("%d",&N)) -     { -         intval[ the]; +Memset (Val,0,sizeof(Val)); -         intsum=0; +          for(intI=0; i<n; i++) Ascanf"%s", Str[i]); at          for(intI=0; i<n; i++) -         { -              for(intj=i+1; j<n; J + +) -             { -                 intlen1=strlen (Str[i]); -                 intLen2=strlen (Str[j]); in                 if(len1!=len2) -                     Continue; to                 intans=0; +                  for(intk=0; k<len1; k++) -                 { the                     if(str[i][k]==str[j][k]| | str[i][k]-'a'==str[j][k]-'A'|| str[i][k]-'A'==str[j][k]-'a') *ans++; $                 }Panax Notoginseng                 if(ans>2) -                 { the //if (!val[i]) + //sum+=2; A //Else the //sum++; +val[i]=1; -val[j]=1; $                 } $             } -         } -          for(intI=0; i<n;i++) the         { -             if(Val[i])Wuyisum++; the         } -printf"%d\n", sum); Wu     } -     return 0; About}
View Code

HDU2015 School Race The country List

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.