Skip to content

Commit

Permalink
[auto-verifier] docs commit 67e5a17
Browse files Browse the repository at this point in the history
  • Loading branch information
web-flow authored Feb 10, 2024
1 parent 0d4a771 commit 9d1c927
Show file tree
Hide file tree
Showing 25 changed files with 1,896 additions and 1,617 deletions.
64 changes: 31 additions & 33 deletions cp-algo/algebra/common.hpp.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,40 @@ data:
path: verify/algebra/matrix_pow.test.cpp
title: Pow of Matrix
- icon: ':heavy_check_mark:'
path: verify/data_structures/range_affine_range_sum.test.cpp
path: verify/data_structures/segment_tree/range_affine_range_sum.test.cpp
title: Range Affine Range Sum
_isVerificationFailed: false
_pathExtension: hpp
_verificationStatusIcon: ':heavy_check_mark:'
attributes:
links: []
bundledCode: "#line 1 \"cp-algo/algebra/common.hpp\"\n\n\n#include <chrono>\n#include\
\ <random>\nnamespace algebra {\n const int maxn = 1 << 20;\n const int\
\ magic = 250; // threshold for sizes to run the naive algo\n std::mt19937\
\ rng(std::chrono::steady_clock::now().time_since_epoch().count()); \n\n auto\
\ bpow(auto x, int64_t n, auto ans) {\n for(; n; n /= 2, x = x * x) {\n\
\ if(n % 2) {\n ans = ans * x;\n }\n \
\ }\n return ans;\n }\n template<typename T>\n T bpow(T const&\
\ x, int64_t n) {\n return bpow(x, n, T(1));\n }\n\n template<typename\
bundledCode: "#line 1 \"cp-algo/algebra/common.hpp\"\n\n\n#include <cstdint>\nnamespace\
\ cp_algo::algebra {\n const int maxn = 1 << 20;\n const int magic = 250;\
\ // threshold for sizes to run the naive algo\n\n auto bpow(auto x, int64_t\
\ n, auto ans) {\n for(; n; n /= 2, x = x * x) {\n if(n % 2)\
\ {\n ans = ans * x;\n }\n }\n return\
\ ans;\n }\n template<typename T>\n T bpow(T const& x, int64_t n) {\n\
\ return bpow(x, n, T(1));\n }\n\n template<typename T>\n T fact(int\
\ n) {\n static T F[maxn];\n static bool init = false;\n \
\ if(!init) {\n F[0] = T(1);\n for(int i = 1; i < maxn;\
\ i++) {\n F[i] = F[i - 1] * T(i);\n }\n \
\ init = true;\n }\n return F[n];\n }\n \n template<typename\
\ T>\n T rfact(int n) {\n static T F[maxn];\n static bool init\
\ = false;\n if(!init) {\n F[maxn - 1] = T(1) / fact<T>(maxn\
\ - 1);\n for(int i = maxn - 2; i >= 0; i--) {\n F[i]\
\ = F[i + 1] * T(i + 1);\n }\n init = true;\n }\n\
\ return F[n];\n }\n\n template<typename T>\n T small_inv(int\
\ n) {\n static T F[maxn];\n static bool init = false;\n \
\ if(!init) {\n for(int i = 1; i < maxn; i++) {\n F[i]\
\ = rfact<T>(i) * fact<T>(i - 1);\n }\n init = true;\n \
\ }\n return F[n];\n }\n}\n\n"
code: "#ifndef CP_ALGO_ALGEBRA_COMMON_HPP\n#define CP_ALGO_ALGEBRA_COMMON_HPP\n\
#include <cstdint>\nnamespace cp_algo::algebra {\n const int maxn = 1 << 20;\n\
\ const int magic = 250; // threshold for sizes to run the naive algo\n\n \
\ auto bpow(auto x, int64_t n, auto ans) {\n for(; n; n /= 2, x = x *\
\ x) {\n if(n % 2) {\n ans = ans * x;\n }\n\
\ }\n return ans;\n }\n template<typename T>\n T bpow(T\
\ const& x, int64_t n) {\n return bpow(x, n, T(1));\n }\n\n template<typename\
\ T>\n T fact(int n) {\n static T F[maxn];\n static bool init\
\ = false;\n if(!init) {\n F[0] = T(1);\n for(int\
\ i = 1; i < maxn; i++) {\n F[i] = F[i - 1] * T(i);\n \
Expand All @@ -49,28 +68,7 @@ data:
\ T small_inv(int n) {\n static T F[maxn];\n static bool init\
\ = false;\n if(!init) {\n for(int i = 1; i < maxn; i++) {\n\
\ F[i] = rfact<T>(i) * fact<T>(i - 1);\n }\n \
\ init = true;\n }\n return F[n];\n }\n}\n\n"
code: "#ifndef ALGEBRA_COMMON_HPP\n#define ALGEBRA_COMMON_HPP\n#include <chrono>\n\
#include <random>\nnamespace algebra {\n const int maxn = 1 << 20;\n const\
\ int magic = 250; // threshold for sizes to run the naive algo\n std::mt19937\
\ rng(std::chrono::steady_clock::now().time_since_epoch().count()); \n\n auto\
\ bpow(auto x, int64_t n, auto ans) {\n for(; n; n /= 2, x = x * x) {\n\
\ if(n % 2) {\n ans = ans * x;\n }\n \
\ }\n return ans;\n }\n template<typename T>\n T bpow(T const&\
\ x, int64_t n) {\n return bpow(x, n, T(1));\n }\n\n template<typename\
\ T>\n T fact(int n) {\n static T F[maxn];\n static bool init\
\ = false;\n if(!init) {\n F[0] = T(1);\n for(int\
\ i = 1; i < maxn; i++) {\n F[i] = F[i - 1] * T(i);\n \
\ }\n init = true;\n }\n return F[n];\n }\n \n\
\ template<typename T>\n T rfact(int n) {\n static T F[maxn];\n \
\ static bool init = false;\n if(!init) {\n F[maxn - 1]\
\ = T(1) / fact<T>(maxn - 1);\n for(int i = maxn - 2; i >= 0; i--)\
\ {\n F[i] = F[i + 1] * T(i + 1);\n }\n init\
\ = true;\n }\n return F[n];\n }\n\n template<typename T>\n\
\ T small_inv(int n) {\n static T F[maxn];\n static bool init\
\ = false;\n if(!init) {\n for(int i = 1; i < maxn; i++) {\n\
\ F[i] = rfact<T>(i) * fact<T>(i - 1);\n }\n \
\ init = true;\n }\n return F[n];\n }\n}\n#endif // ALGEBRA_COMMON_HPP\n"
\ init = true;\n }\n return F[n];\n }\n}\n#endif // CP_ALGO_ALGEBRA_COMMON_HPP\n"
dependsOn: []
isVerificationFile: false
path: cp-algo/algebra/common.hpp
Expand All @@ -79,10 +77,10 @@ data:
- cp-algo/algebra/polynomial.hpp
- cp-algo/algebra/modular.hpp
- cp-algo/algebra/fft.hpp
timestamp: '2024-02-10 20:45:15+01:00'
timestamp: '2024-02-10 22:44:24+01:00'
verificationStatus: LIBRARY_ALL_AC
verifiedWith:
- verify/data_structures/range_affine_range_sum.test.cpp
- verify/data_structures/segment_tree/range_affine_range_sum.test.cpp
- verify/algebra/matrix_pow.test.cpp
- verify/algebra/convolution107.test.cpp
documentation_of: cp-algo/algebra/common.hpp
Expand Down
Loading

0 comments on commit 9d1c927

Please sign in to comment.