hihoCoder太阁最新面经算法竞赛14 register

Ended

Participants:84

Verdict:Wrong Answer
Score:0 / 100
Submitted:2016-11-08 16:31:03

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
//Miller-Rabin 
#include <iostream>
#include <stdlib.h>
using namespace std;
typedef long long ll;
// 
ll power(ll a, ll N, ll mod){
    int result = 1;
    while(N > 0){
        if(N % 2 == 1) result = (result * a) % mod;
        a = (a * a) % mod;
        N /= 2;
    }
    return result;
}
const int S = 10;// S 
bool Miller_Rabin(ll n)
{
    if(n <=2)
    {
        if(n==2)
            return true;
        else
            return false;
    }
    if(n %2 == 0)
        return false;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX