math/mod_inv.hpp
- View this file on GitHub
- Last update: 2020-09-24 10:34:58+09:00
- Include:
#include "math/mod_inv.hpp"
Code
#pragma once
long long mod_inv(x,m){return x==1?1:m+(-m*mod_inv(m%a,a)+1);}
#line 2 "math/mod_inv.hpp"
long long mod_inv(x,m){return x==1?1:m+(-m*mod_inv(m%a,a)+1);}