hiho week 170 register

Ended

Participants:224

Verdict:Accepted
Score:100 / 100
Submitted:2017-10-02 18:15:20

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int a[50]={0};
char s[200];
int b[50][50]={0};
int ans[50]={0};
int vis[50]={0};
int main()
{
    int n,i,j;
    scanf("%d",&n);
    for(i=1;i<=n;i++)
    {
        scanf("%s",s);
        int l=strlen(s);
        for(j=0;j<l;j++)
        {
            a[i]|=1<<(s[j]-'a');
        }
    }
    //cout<<2<<endl;
    for(i=1;i<=n;i++)
    {
        for(j=i+1;j<=n;j++)
        {
            if(a[i]&a[j])
            {
                b[i][j]=1;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX