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 | tourist | 4009 |
2 | jiangly | 3831 |
3 | Radewoosh | 3646 |
4 | jqdai0815 | 3620 |
4 | Benq | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | gamegame | 3386 |
10 | ksun48 | 3373 |
# | User | Contrib. |
---|---|---|
1 | cry | 164 |
1 | maomao90 | 164 |
3 | Um_nik | 163 |
4 | atcoder_official | 160 |
5 | -is-this-fft- | 158 |
6 | awoo | 157 |
7 | adamant | 156 |
8 | TheScrasse | 154 |
8 | nor | 154 |
10 | Dominater069 | 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.
Name |
---|