🎓 Learn from the best! TLE 11.0 offers live classes with top mentors. Join TLE 11.0 today at www.tle-eliminators.com 🚀
@pakalapaticharanraju523Ай бұрын
bro the explanation is really awesome bro yesterday when i tried to do the problem i cant even able to understand what the question is but just after the explanation i started solving it and it just got accepted thank bro thank you so much
@MATRIX-404Ай бұрын
Thanks 😊
@TLE_EliminatorsАй бұрын
Please fill the feedback form: forms.gle/fdnL3vQG2M8892qUA
@jiakai7254Ай бұрын
for B1 can i use kadane’s algorithm with two constraints: max sum is m and a[i]-min(subarr)
@akzytrАй бұрын
No because that means we want to greedily choose as a subarray, this won't work as we don't want to set the current cost to 0 as soon as we can't add more elements within budget for example: Suppose budget is 1033 and we have the following: 206 206 206 206 207 207 207 Using kadane's algorithm: Index 1: 206 Index 2: Prev + 206 = 412 Index 3: Prev + 206 = 618 Index 4: Prev + 206 = 824 Index 5: Prev + 207 = 1031 Index 6: We cannot add more since 1031 + 207 > 1033, so we have to restart and now Prev = 207 Index 7: Prev + 207 = 414 Index 8: Prev + 207 = 621 So according to Kadane's algorithm the maximum is 1031 which we can achieve within budget. It is wrong, because we can take 1033, with 2 of 206, and 3 of 207 so 206+206+207+207+207 = 1033
@jojokawai5841Ай бұрын
hey , which rating questions should i grind to get comfortable with div2 B probelms
@AB-yl5szАй бұрын
Solve div 2 b problem of last 40-50 contest
@joj0ukey31Ай бұрын
@@AB-yl5szwhere to see all past div 2 contest in sequence
@Animal-O-hub341Ай бұрын
@@joj0ukey31contest section of cf
@jojokawai5841Ай бұрын
@@AB-yl5sz where can i see them
@yashanil2818Ай бұрын
#include using namespace std; typedef long long ll; typedef vector vi; typedef vector vll; #define rep(i, a, b) for (long long int i = a; i < b; i++) void solve() { ll n, k; cin >> n >> k; map mp; rep(i, 0, n) { ll x; cin >> x; mp[x]++; } ll ans = 0; for (auto i : mp) { ll l = i.first; ll r = l + 1; if (l k) { if (r && sum - r == k) { cout t; while (t--) { solve(); cout