summaryrefslogtreecommitdiff
path: root/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'util.h')
-rw-r--r--util.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/util.h b/util.h
index 52c37ae..2142c8f 100644
--- a/util.h
+++ b/util.h
@@ -18,3 +18,10 @@ struct Idx {
inline ostream& operator<<(ostream &os, const Idx &obj) {
return os << '(' << obj.x << ',' << obj.y << ')';
}
+
+
+inline constexpr int ipow(int b, int e) {
+ int r = 1;
+ for (int i = 0; i < e; i++) r *= b;
+ return r;
+}