Since I am a newbie. I want to know how you guys practice solving problems. Do you guys practice by solving the problemset or by participating virtual contests? Any other advices are welcome.
# | User | Rating |
---|---|---|
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 |
# | User | Contrib. |
---|---|---|
1 | cry | 166 |
2 | maomao90 | 163 |
2 | Um_nik | 163 |
4 | atcoder_official | 161 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 157 |
8 | TheScrasse | 154 |
9 | nor | 153 |
9 | Dominater069 | 153 |
Since I am a newbie. I want to know how you guys practice solving problems. Do you guys practice by solving the problemset or by participating virtual contests? Any other advices are welcome.
Hi, I was practicing solving problems from USACO and I became curious when I saw the test data. The majority of the test data have surprisingly large numbers of test data. How are these test cases made? Do the problems maker calculate the output with these unusually large numbers of inputs?(Sorry for the bad english)
I am struggling on solving the problem 1873E problem div4. I wrote the solution but few test cases are wrong and I can't find the flaw in my code. Plz Help!!!
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
#define ll long long
int main() {
ll t;
cin >> t;
while (t--) {
ll n, x;
cin >> n >> x;
vector<ll> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
sort(a.begin(), a.end());
ll left = 0, right = a[n - 1];
ll height = 0;
while (left <= right) {
ll mid = (left + right) / 2;
ll sum = 0;
for (int i = 0; i < n; i++) {
if (mid > a[i]) {
sum += mid - a[i];
}
}
if (sum <= x) {
height = mid;
left = mid + 1;
}
else {
right = mid - 1;
}
}
cout << height << '\n';
}
return 0;
}
void search(int k) {
if (k == n) {
// process subset
} else {
search(k+1);
subset.push_back(k);
search(k+1);
subset.pop_back();
}
}
I am having a really hard time understand this code. I especially don't understand how 'k' turns to 2 after 'k' reaches 3. I don't understand because there's no such code that does search(k-1) but it backtracks automatically. I think It's related to the thing backtracking. Someone plz help!!!
Should I practice CP by problems rating or by algorithm topics?
Hi, I am curious. At what age do successful competitive programmers such as IOI gold medal winners start CP?
Hey guys, I just started CP. I am able to solve 800 rated problems very easily but find 900 rated problems hard(especially number theory or math problems). I am currently in 8th grade and studying algebra 1. I am curious if the lack of my high school math skill is the reason solving 900 rated problems very hard.
Name |
---|