https://nanti.jisuanke.com/t/41383 解: 斐波那契博弈+中国剩余定理. #include <bits/stdc++.h> using namespace std; ],m[],ans; long long exgcd(long long a,long long b,long long &x,long long &y){ if (!b) {x=,y=;return a;} long long re=exgcd(b,a%b,x,y),tmp=x;…
In Complexity theory, some functions are nearly O(1)O(1), but it is greater then O(1)O(1). For example, the complexity of a typical disjoint set is O(nα(n))O(*n**α(n)). Here α(n)α(n) is Inverse Ackermann Function, which growth speed is very slow. So…
B. super_log 题意:研究一下就是求幂塔函数 %m的值. 思路:扩展欧拉降幂. AC代码: #include<bits/stdc++.h> using namespace std; typedef long long ll; ; int a, b, m; ll eular(ll n) { ll ans = n; ;i * i <= n;i++) { ) { ans -= ans / i; ) n /= i; } } ) ans -= ans / n; return ans; }…