hiho week 97 register

Ended

Participants:296

Verdict:Accepted
Score:100 / 100
Submitted:2016-05-14 09:47:12

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 <iostream>
#include <algorithm>
#include <vector>
typedef long long ll;
using namespace std;
int gcd(ll a,ll b){
    if( b == 0) return a;
    return gcd(b,a%b);
}
int extgcd(ll a,ll b,ll& x,ll& y){
    ll d = a;
    if(b != 0){
        d = extgcd(b,a%b,y,x);
        y -= (a/b)*x;
    }else{
        x = 1;
        y = 0;
    }
    return d;
}
int mod_inverse(ll a , ll m){
    ll x,y;
    extgcd(a,m,x,y);
    return (m + x % m) % m;
}
pair<ll , ll> linear_congruence(const vector<ll>& A, const vector<ll>& B,
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX