From 9e625b89bac7e8daaf583e215f3a0df3dc250bb2 Mon Sep 17 00:00:00 2001 From: Paul Jungeblut Date: Mon, 27 Jun 2016 11:17:34 +0200 Subject: Math section rebuild, merged convinience and sonstiges section. --- math/modExp.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'math/modExp.cpp') diff --git a/math/modExp.cpp b/math/modExp.cpp index 863ff4e..cd0f982 100644 --- a/math/modExp.cpp +++ b/math/modExp.cpp @@ -1,4 +1,4 @@ -//0<=a,b <=n and n <= MAX(ll)/2 +// Laufzeit: O(log(b)) ll mult_mod(ll a, ll b, ll n) { if(a == 0 || b == 0) return 0; if(b == 1) return a % n; @@ -7,7 +7,7 @@ ll mult_mod(ll a, ll b, ll n) { else return mult_mod((a + a) % n, b / 2, n); } -//0<=a,b<=n and n <= MAX(ll)/2 +// Laufzeit: O(log(b)) ll pow_mod(ll a, ll b, ll n) { if(b == 0) return 1; if(b == 1) return a % n; -- cgit v1.2.3