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 | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 161 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | Dominater069 | 154 |
8 | awoo | 154 |
10 | luogu_official | 150 |
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 |
---|