hihoCoder Challenge 4 register

Ended

Participants:542

Verdict:Accepted
Submitted:2014-11-02 20:06:49

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 <cmath>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <string>
#include <cstring>
#include <vector>
#include <map>
using namespace std;
int n,k,o,i,ANS[1005],p[1005],ANSS[1005];
long long ans;
double MAX;
const int MOD=1000000007;
bool prime(int x)
{
    for (int i=2; i<=int(sqrt(x)+0.0000000001); i++)
      if (x%i==0) return false;
    return true;
}
void dfs(int x,int y,double z)
{
    if (y==k+1)
    {
        for (int i=1; i<y; i++) ANSS[i]=ANS[i];
        MAX=max(MAX,z);
    }
    if (z+log(x)*(k-y+1)<MAX) return;
    if (y==k+1 || x==p[o]-1) return;
    dfs(x-1,y,z);
    bool FLAG=true;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX