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 | tourist | 4009 |
2 | jiangly | 3823 |
3 | Benq | 3738 |
4 | Radewoosh | 3633 |
5 | jqdai0815 | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | ksun48 | 3390 |
10 | gamegame | 3386 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 157 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
9 | nor | 153 |
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.
Название |
---|