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.
№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 3993 |
2 | jiangly | 3743 |
3 | orzdevinwang | 3707 |
4 | Radewoosh | 3627 |
5 | jqdai0815 | 3620 |
6 | Benq | 3564 |
7 | Kevin114514 | 3443 |
8 | ksun48 | 3434 |
9 | Rewinding | 3397 |
10 | Um_nik | 3396 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 156 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
9 | nor | 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.
Название |
---|
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)?