MSBOP 2015 Round2B register

Ended

Participants:6187

Verdict:AC | TLE
Submitted:2015-04-26 14:35:31

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<cstdio>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<algorithm>
#define maxn 111
using namespace std;
int test,n,ans,num,hsh[maxn];
char a[maxn],d[maxn]
;
char c1,c2,c;
void dfs(int x)
{
    if (x>num)
    {
        ans++;
        return;
    }
    for (int i=1;i<=num;i++)
    {
        if (hsh[i]==0)
        {
            hsh[i]=1;
            d[x]=i;
            if (x==1 || (a[d[x-1]]!=a[i])) dfs(x+1);
            hsh[i]=0;
        }
    }
}
int main()
{
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX