I should say **"impatience a vice", :( but it's good.**

Active In

Competitive Programming

International Olympiad in Informatics

Indian Computing Olympiad (ICO)

Computer Programming

Bitcoin and Blockchain

UI/UX Design

Artificial Intelligence

Deep Learning

TED Talks

Featured Contributions

comment in this discussion

Asif MujtabaA Guy, who loves to solve. · 2y

I should say **"impatience a vice", :( but it's good.**

Read more… (10 words)

comment in this discussion

Asif MujtabaA Guy, who loves to solve. · 2y

then selling a bull is nothing but

ans = max(ans, call(i+1, 0, cnt + 1) + a[i]);

Thank you veryyyyy much. I got AC :D , You don't believe that I was carving for the solution last couple of days. @ Hussain Kara Fallah

Read more… (34 words)

comment in this discussion

Asif MujtabaA Guy, who loves to solve. · 2y

Sorry, as you said, when we use L shaped and 2 x 1 shaped tile **before that tile we had f(n-1) or h(n-1) respectively**, or **it should be after using those tiles** **we get** **f(n-1) or h(n-1) respectively**?

☐☐☐☐☐ ☐☐ ☐☐☐☐☐☐☐☐☐☐ + ☐ --> ☐☐☐☐☐☐☐☐☐ ☐☐☐☐☐☐☐☐☐☐☐ + ☐☐ --> ☐☐☐☐

Don't know why, it was looking very odd to me before, but after your ideas now it make sense. *Garrett Irwin*

Read more… (61 words)

comment in this discussion

Asif MujtabaA Guy, who loves to solve. · 2y

In my code I used 3 state like this dp[pos][prev_value][count], which takes dp[403][403][403] size, and got run time error, can anyone please give me some hint so that state / space can be reduced ?

My code

#include <bits/stdc++.h>#include <algorithm>using namespace std;#define inf 0x3f3f3f3f#define PI acos(-1)#define eps 1e-9//#define inf 100000000#define MOD 1000000007#define mem(a,b) memset(a, b, sizeof(a) )int dx[] = {0, 0, +1, -1};int dy[] = {+1, -1, 0, 0};//int dx[] = {+1, 0, -1, 0, +1, +1, -1, -1};//int dy[] = {0, +1, 0, -1, +1, -1, +1, -1};

Read more… (37 words)

comment in this discussion

Asif MujtabaA Guy, who loves to solve. · 2y

// BISMILLAHIR RAHMANIR RAHIM#include <bits/stdc++.h>#include <algorithm>using namespace std;#define inf 0x3f3f3f3f#define PI acos(-1)#define eps 1e-9//#define inf 100000000#define MOD 1000000007#define mem(a,b) memset(a, b, sizeof(a) )int dx[] = {0, 0, +1, -1};int dy[] = {+1, -1, 0, 0};//int dx[] = {+1, 0, -1, 0, +1, +1, -1, -1};//int dy[] = {0, +1, 0, -1, +1, -1, +1, -1};#define ll long long int#define ff first#define ss second#define sc(a) scanf("%d", &a)

Read more…

comment in this discussion

Asif MujtabaA Guy, who loves to solve. · 2y

Another way to solve this problem

X X O OX O X O

Read more… (118 words)

comment in this discussion

Asif MujtabaA Guy, who loves to solve. · 2y

Sorry I don't understand. Please explain it elaborately.

here's my code. I got AC on spoj.

#include<cstdio>#include<sstream>#include<cstdlib>#include<cctype>#include<cmath>#include<algorithm>#include<set>#include<queue>#include<stack>#include<list>#include<iostream>#include<fstream>#include<numeric>#include<string>#include<vector>

Read more… (16 words)

comment in this discussion

Asif MujtabaA Guy, who loves to solve. · 2y

UPD : SOLVED (vector instead of array gives AC)

Getting WA on 7th case..

code removed after AC

Read more… (16 words)

comment in this discussion

Asif MujtabaA Guy, who loves to solve. · 2y

This is for Pro Members

We like how far you've come. Upgrade today and get access to all of CommonLounge.

Already a member? Sign in.

Read more… (28 words)

comment in this discussion

Asif MujtabaA Guy, who loves to solve. · 2y

thank you very much for you suggestion , but I have some question

- I actually want to find (k to some i) and (1 to that i). Now as you said i should call the recursive function backward , then how can i find (k to i), just calling ---> call(i) - call(k) ? where i >= k, then add call(i-1) with that?
- And as you said find for each value to the starting point , then I just loop through the value and make recursive call and memoize?

Read more… (89 words)