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

Ended

Participants:84

Verdict:Accepted
Score:100 / 100
Submitted:2016-11-11 15:45:53

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 <stdio.h>  
#include <cstdlib>  
#include <string>  
#include <algorithm>  
#include <iostream>  
#include <cmath>  
using namespace std;
const int Times = 10;
typedef long long LL;
LL multi(LL a, LL b, LL m)
{
    LL ans = 0;
    a %= m;
    while (b)
    {
        if (b & 1)
        {
            ans = (ans + a) % m;
            b--;
        }
        b >>= 1;
        a = (a + a) % m;
    }
    return ans;
}
LL quick_mod(LL a, LL b, LL m)
{
    LL ans = 1;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX