#include<iostream>
#include<map>
using namespace std;
#define rep(i,l,r) for(int i=(l);i<=(r);i++)
#define per(i,l,r) for(int i=(l);i>=(r);i--)
#define ll long long
#define pii pair<int, int>
#define mset(s,t) memset(s,t,sizeof(t))
#define mcpy(s,t) memcpy(s,t,sizeof(t))
#define fir first
#define pb push_back
#define sec second
#define sortall(x) sort((x).begin(),(x).end())
inline int read () {
int x = 0, f = 0;
char ch = getchar();
while (!isdigit(ch)) f |= (ch=='-'),ch= getchar();
while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
return f?-x:x;
}
template<typename T> void print(T x) {
if (x < 0) putchar('-'), x = -x;
if (x >= 10) print(x/10);
putchar(x % 10 + '0');
}
const int mod = 998244353;
ll x;
map<ll, ll> cnt;
void solve() {
cin >> x;
auto f = [&](auto f, ll x) -> ll {
if (cnt[x]) return cnt[x];
if (x <= 4) return x;
return cnt[x] = f(f, x / 2) * f(f, (x+ 1) / 2) %mod;
};
cout << f(f, x) << endl;
}
int main () {
int t;
t = 1;
while (t --) solve();
return 0;
}
[&]要用这个,用这个表示捕获所有外部变量这样才能给其他变量赋值
|