I am using "Airtel" company sim card, anyone know how to resolve it. I am writing this post with my friends internet connection.
I am facing this problem from today's noon.
Please help
| # | User | Rating |
|---|---|---|
| 1 | Benq | 3792 |
| 2 | VivaciousAubergine | 3647 |
| 3 | Kevin114514 | 3603 |
| 4 | jiangly | 3583 |
| 5 | turmax | 3559 |
| 6 | tourist | 3541 |
| 7 | strapple | 3515 |
| 8 | ksun48 | 3461 |
| 9 | dXqwq | 3436 |
| 10 | Otomachi_Una | 3413 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 157 |
| 2 | adamant | 153 |
| 3 | Um_nik | 147 |
| 3 | Proof_by_QED | 147 |
| 5 | Dominater069 | 145 |
| 6 | errorgorn | 142 |
| 7 | cry | 139 |
| 8 | YuukiS | 135 |
| 9 | TheScrasse | 134 |
| 10 | chromate00 | 133 |
I am using "Airtel" company sim card, anyone know how to resolve it. I am writing this post with my friends internet connection.
I am facing this problem from today's noon.
Please help
Make a Power of Two In this problem, I wrote the code and it gives me TLE on test case-3 without any reason because my code runs in worst-case (269*11) = 2959 and the time limit for this problem is "one second" but still it gives me TLE why? I don't have any Idea anyone help me
// This function is working in O(max(s1.length(), s2.length())
int recur(string s1, string s2, int x, int y)
{
if (x >= s1.length() || y >= s2.length())
return 0;
int t1 = 0, t2 = 0;
if (s1[x] == s2[y])
t1 = 1 + recur(s1, s2, x + 1, y + 1);
else
t2 = recur(s1, s2, x, y + 1);
return max(t1, t2);
}
// storing the power to 2 from 0-40
vector<string> make_power_of_2()
{
vector<string> vs;
vs.pb("1");
int ans = 1;
for (int i = 1; i <= 40; i++)
{
ans = ans * 2;
vs.pb(to_string(ans));
}
return vs;
}
void solve()
{
vector<string> vs = make_power_of_2();
int n;
cin >> n;
string str = to_string(n);
int ans = INT_MAX;
int flag = 0;
for (int i = 0; i < vs.size(); i++)
{
int z = recur(vs[i], str, 0, 0);
ans = min(ans, (vs[i].length() + str.length() - 2 * z));
}
cout << min(ans, (int)(str.length() + 1)) << endl;
}
Which value we have to choose such that it will give the maximum count. 
Hello Everyone I have a question related to Dynamic Programming. Whenever you are trying to solve DP question in the ongoing contest you first think recursive or you directly write the code in tabulation format.
| Name |
|---|


