Here we discuss DSA, Competitive Programming (hence the title), practice and study material, etc.
To participate you must commit to participate in at elast one contest every week regardless of result
>https://leetcode.com/problem-list/22fmu8yh/https://leetcode.com/problem-list/22fmu8yh/>https://leetcode.com/problem-list/rabvlt31/https://leetcode.com/problem-list/rabvlt31/
of course smaller more focused versions of these exists. I found the original blind75 to be useful. filter by is not premium and you should be fine
>>367
let's fix some rules. post your rating, how many you solved in recent contest, any interesting problem you solved etc
>401 (literally gave 1 contest and got 1 problem)>all 4 in biweekly contest leetcode>only first in weekly leetcode
i could've done more but got stuck in the wrong approach when dfs with greedy base case would've worked
maybe we can discuss problems from new contests? i give leetcode and sometimes codeforces (if this general works i will commit for all codeforces) and we can help each other improve
no spoilers till t+1 days (codeforces comtests are evening 8pm so not an issue, leetcode weekly is morning so yeah)
examples -
>Q3 was hard>simple brute force and dfs fails for Q3
=xor of the same number gives 0
<Q3 is Kadane's algo with some modifications
sometimes mentioning the algo is a spoiler so avoid. ofc next day everything is allowed so take the embargo to self improve. aim for 1 question per contest after with no time limit + reading solutions for all
post resources, progress, interesting problems, help for non contest problems (this is not to facilitate cheating, violation will be reported, hopefully admins collaborate)
1 was smooth, struggled through 2. for 3 i read the question and had an idea. then i realized it was count the number of reachable and not is it reachable. anyways i have an idea for how to solve problem 3 I'll do it tomorrow
https://codeforces.com/blog/entry/155047https://codeforces.com/blog/entry/155047
tutorials btw. i was solve C as predicted but I couldn't make the observation for D. i will read E and F
>>368
i feel, i should also start giving contest now. i am just left with graphs(Ongoing) and DP. i havent solved many problems, would be around 250 if i include all platforms.
>>381
isn't atcoder more difficult and calculus involved? LC and CF are more approachable for beginners from what i understand
>>380
yeah i give contest. actually i am the only person in the genral. like of the 21 posts im probably 15
>>397
its almost over, 3rd problem, i couldnt understand how this will work like i couldnt understand working in itself and format too. so i need to see if this is something asked in atcoder. also 4th problem, i have though up logic but since time is over like 1 min left, i am done with it. i would upsolve 3 and 4, rest 5 and 6, anyone can pick it up. if i feel i will.
>>401
i feel only way to git gud is giving contests, i have tried to solve medium and hard by giving time and i feell it doesnt really help that much. contests for some reason stay in memory
>>401
1 and 2. i feel like 3 was really easy and if i was better at the reviewer i could have done better. it was completely new workflow for me because usually i have a few test cases to try out before, now i was one shotting every submission
>>402
ofc. I am following n+1 every contest and solution for rest but i think i will get used to the reviewer agent and try more for this one specifically
>>408
from what i have read, you are only given n and you will be then input i, j and you have to check if i,j returns a string yes or no, if yes then that means you have to calculate the pairs but i am still a little confused. will read more on it.
>>410
no that is not what i understood. it was basically this -
>given n
this translates to
<[1, 2, 3, 4, 5 ... n] in that order, but it is better to think as 1-based index as we will not be using these values
now preserving this order there is a secret array
<[1s, 2s, 3s ... ns]
both are in ascending order.
>valid pair
choose an i, j from the given array (this means select i,j such that 1 <= i < j <= n). The pair is valid if the reviewer says it is.
>how to ask reviewer
print('?', i, j)
response = input()
this is how
output -
number of valid pairs
>>413
if you want to ask if 2s,3s is valid you would do
```print('?', 2, 3)
response = input()```
then if you want to ask if 1,5 is valid
```print('?', 1, 5)
response = input()```
etc
>>418
prewriten. it will be executed by the atcoder after submission. you do not need to write it unless you want to execute locally and test for errors
>>420
Yeah it was easy i think. Maybe a two pointer like approach as if 5 is in range with 10 then every number between 5 and 10 is also in range with 10. so left and right iterates only once (meaning N+N) and we use PnC to count
i have concepts of a plan for 3. essentially if you have on trivial path (top row and last column) and want to add another path (first column and last row), we can just push it in and make it the next available index. i hate that i didn't discover this earlier, i first saw constraints as 10x10x4 and thought i can just brute force, then i started seeing if factorization would help because every row multiplies to next, i just had to add one to the previous column
I have not submitted yet so idk if it works but i would hate it if it works
>>429
great, we were discussing today's contest in case you don't understand the context. if you are just starting, leetcode shows that graph of how fast your algorithm was, so to study you can see samples of what a faster algorigthm is. sometimes cheaters are fastest as you can just write to a file where time is stored and sometimes it is some one liner magic that is incomprehensible so it isn't always good. in solutions tab you can also see answers with explaination but they are user generated and i personally do not find them to be very useful. if you are following neetcode list his YT has video explainations too. striver also has a list but i am not too familiar with that and i was told it is easier. i will add all this to the next general
so it looks like
>leetcode
saturday 8:00pm
alternate sunday 8:00am
>atcoder
saturday, sunday 5:30pm
>codeforces
random days 8:00pm
that is like 4 a week. i don't think we need more.
>>418
thanks anon i will set up. does it notify with time also?
REMINDER to everyone -
Codeforces Div 3 today. it is easier than the previous Div 2 contests we have given before. Div 4 is easiest so not that much but easier nonetheless