I believe that doing competitive programming helps you become a better software engineer. It would be interesting to hear from the community a problem in a real project that has the same flavor as competitive programming problems.
# | 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 believe that doing competitive programming helps you become a better software engineer. It would be interesting to hear from the community a problem in a real project that has the same flavor as competitive programming problems.
Name |
---|
In last semester I had a course on Software Engineering, as a course requirement a group of 7 members had to work on a project, my group had to make an automatic timetable generating system, basically, it takes in the preference of all faculty member, and as an output gives the timetable for all batches.
So I came up with an algorithm to serve this purpose, the algorithm is not very complex but it was the closest thing I did, which resembled competitive programming by far.
Project Link
You think anyone would like to go through your 1284 lines of code to actually know what is it really doing
No, please don't bother looking it's only for curious minds.
Working on a personal project right now that doesn't seem too difficult on the surface, but I'm now stuck on how to build a data structure.
Here's the problem:
I have a bunch of events with start and end times. I need to find a way to store these events so I can make a query( L, R ) so that the query function returns a list of events one at a time, with end times > L and start times < R, sorted in ascending order of end times.
Changing rows to columns in a matrix
I've made a little "game" (it's actually very boring to play for now) on C's SDL2 Library. I've had to code circunference to line collisions with speed vector bounce for this game and if it wasn't for the computational geometry that I've learnt in competitive programming, I would never have been able to do it.
Take a look at the code in question the relevant bit is the last routine at the very bottom of the page.
CODE1
,CODE2
, ...) inlog N
(instead ofN
) attempts.I think noticing the opportunity to utilize algorithmic techniques is more important than knowing the techniques themselves.
Re 1, if the sum of probabilities is always 1, wouldn't making updates to the Alias table[1] be faster? It is critical to one of the programs I'm writing, so trying to somehow get rid of the if condition with little luck.
* check out [2] for a more detailed explanation.
---
[1]: https://en.wikipedia.org/wiki/Alias_method
[2]: http://www.keithschwarz.com/darts-dice-coins/
Well,
probabilities
was very inexact term to use, perhaps I should saypriorities
. Those are integer numbers that add up to some sum S. I then generate a random number between 0 and S, and select one of the actions with probabilities proportional to their priorities. Key thing is thatpriorities
/probabilities
are frequently changing. I have looked at your links only briefly, do these methods support the updates efficiently (at most log n)?