Have you ever faced any problem in a technical interview with difficulty more than DIV2 D/E? I once faced a maxflow problem. Please share the most difficult/challenging problem you faced in an interview.
# | 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 | awoo | 154 |
8 | Dominater069 | 154 |
10 | luogu_official | 150 |
Have you ever faced any problem in a technical interview with difficulty more than DIV2 D/E? I once faced a maxflow problem. Please share the most difficult/challenging problem you faced in an interview.
I have a tuple T, consisting of
What can be the most efficient way to store such tuple T = < id, score1, score2, x > given that only 5 digits after the decimal are sufficient for score1 and score2.
Currently, I am storing this tuple as a long which takes 8 bytes of memory. 27 bits for id, 17 bits for score1, 17 bits for score2 (considering values upto 5 decimal digits), and 2 bits for x, Overall 63 bits.
I'm trying to optimize the memory usage as there are millions of such tuples in an array. Also, If your way can store digits more than 5 decimal places, please tell me.
Is there a way, by which we can store the tuple T using float or some other data type? given that if the tuple is hashed to float, I should be able to get back id, x accurately and score1, score2 without much errors.
Thanks for your time, have a nice day.
Hello, codeforces community
What is the most efficient way to store the such matrix, given that I'll get the queries like:
Currently I'm storing the matrix in CSR format. Which takes an integer array of size NNZ and another array of size N.
Which is taking
The overall memory to store such structure is about 3.5GB.
I want to compress it in a way such that the memory consumption is reduced and the queries can still be fast. I am looking for some kind of serialization technique or something which can reduce the memory consumption or time complexity.
Any help regarding this is most welcome.
The two Pointer algorithm is quite popular technique. Although the idea is straightforward, Its implementation is prone to bugs. Few such bugs includes:
How to write in a way such that there is less chances of bugs?
This blog is a sister blog of Binary Search Elegant Implementation. Your thoughts and implementations are valuable to community, hence welcome.
Thanks. Have a great time ahead!
Name |
---|