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
| № | Пользователь | Рейтинг |
|---|---|---|
| 1 | jiangly | 3810 |
| 2 | Benq | 3676 |
| 3 | Kevin114514 | 3655 |
| 4 | maroonrk | 3463 |
| 5 | strapple | 3447 |
| 6 | Um_nik | 3387 |
| 7 | heuristica | 3322 |
| 8 | turmax | 3317 |
| 9 | tourist | 3307 |
| 10 | jiangbowen | 3291 |
| Страны | Города | Организации | Всё → |
| № | Пользователь | Вклад |
|---|---|---|
| 1 | Qingyu | 156 |
| 2 | nik_exists | 150 |
| 2 | maspy | 150 |
| 4 | Um_nik | 142 |
| 5 | Errichto | 139 |
| 6 | adamant | 137 |
| 7 | AmShZ | 135 |
| 8 | BledDest | 132 |
| 8 | maroonrk | 132 |
| 10 | qwexd | 129 |
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.
| Название |
|---|


