MSBOP 2015 Round2B register

Ended

Participants:6187

Verdict:AC | TLE
Submitted:2015-04-26 14:29: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 <iostream>
#include <cstdlib>
#include <vector>
#include <stack>
#include <string>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <unordered_set>
#include <climits>
using namespace std;
unsigned long long cnt = 0;
const unsigned long long longmax = 0xffffffffffffffff;
bool isvalid(vector<string> &ans)
{
    int len = ans.size();
    for(int i = 1; i < len; i++)
    {
        if(ans[i][0] == ans[i - 1][0])
            return false;
    }
    return true;
}
void permutation(vector<string> &poker, int from, int to)
{
    if(from == to)
    {
        if(isvalid(poker))
            ++cnt;
        cnt %= longmax;
        return;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX