1 solutions

  • 0
    @ 2026-2-4 19:45:51
    #include<bits/stdc++.h>
    using namespace std;
    typedef long long LL;
    map<LL,LL> cnt;
    LL dfs(LL u)
    {
    	if(cnt.count(u)) return cnt[u];
    	if(u==0) return 1;
    	LL t=dfs(u/3)+dfs(u/2);
    	cnt[u]=t;
    	return cnt[u];
    }
    int main()
    {
    	LL n;
    	cin>>n;
    	cout<<dfs(n);
    	return 0;
    }
    
    • 1

    Information

    ID
    2754
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    5
    Tags
    # Submissions
    10
    Accepted
    4
    Uploaded By