plz send the solution A-f91 below codeis not working

60 views
Skip to first unread message

Chirag Singhal

unread,
May 7, 2020, 9:43:39 AM5/7/20
to Virtual Judge
#include<bits/stdc++.h>
using namespace std;
vector<int>dp(1e6,-1);
int dfs(int n )
{   
    if(n>100)return n-10;
    if(dp[n]!=-1)return dp[n];
     
     return dp[n] = dfs(dfs(n+11));
}

int main()
{
    int t;
    cin>>t;
    dfs(1000000);
   
        int n ;
        cin>>n;
       if(n==0)return 0;
        cout<<dfs(n)<<endl;

    return 0;
}

Mohit biddu

unread,
May 7, 2020, 10:20:16 AM5/7/20
to virtua...@googlegroups.com
sorry,do i know you?
please send the complete question.


--
您收到此邮件是因为您订阅了Google网上论坛上的“Virtual Judge”群组。
要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到virtual-judg...@googlegroups.com
要在网络上查看此讨论,请访问https://groups.google.com/d/msgid/virtual-judge/64c466c6-c55b-4a7c-b52e-d327758f5b9f%40googlegroups.com
Reply all
Reply to author
Forward
0 new messages