Блог пользователя fofao_funk

Автор fofao_funk, история, 8 лет назад, По-английски

Hey, all.

I think that from time to time all of us stumble upon a solution for a problem that make we go 'holy shit, this is beautiful'. So, I'd like to ask you guys to post the most beautiful/creative/out of the box solutions you've ever seen/created in the programming competitions world, so we can all see how cool some of them are and get a little bit inspired.

  • Проголосовать: нравится
  • +77
  • Проголосовать: не нравится

»
8 лет назад, скрыть # |
 
Проголосовать: нравится -20 Проголосовать: не нравится
»
8 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

https://www.spoj.com/problems/ADACOINS/ A lot of you would've seen this problem, but the first time I solved this, it felt amazing.

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +27 Проголосовать: не нравится

I remember that all other solutions for this where Max Flow/Matching but mine was a simple nested for loop it felt amazing to solve it that way.

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +106 Проголосовать: не нравится

This div2A 31086095 from round 439, AC in 5 characters

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +29 Проголосовать: не нравится
»
8 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

I solved this problem before with this 42353615 and It was beautiful solution for me, but seeing this blog, I've just improved the code to be 45168777, what do you think about it :)?

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +9 Проголосовать: не нравится

It is the most beautiful, greedy solution that I've ever seen.

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +49 Проголосовать: не нравится

IOI 2006 joining points: Solution

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +21 Проголосовать: не нравится

this 22059230.

»
8 лет назад, скрыть # |
← Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

The following queue-based solution of this recent problem 999C - Алфавитное удаление is among the most elegant solutions I have ever written.

45174979

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

How about the easiest problem ever?)

»
8 лет назад, скрыть # |
← Rev. 2  
Проголосовать: нравится +6 Проголосовать: не нравится

I had the reaction that you described when I saw the solution for an problem from the JOI Spring Camp. The solution was so elegant and simple that I decided to write a blog about it.

»
8 лет назад, скрыть # |
← Rev. 3  
Проголосовать: нравится +73 Проголосовать: не нравится

I don't know from where this problem is, but it's beautiful. There is no need to know complex algorithms (just basic), it's all about thinking. Thanks to kostka for showing it to us.

You are given a connected graph with n ≤ 200, m ≤ 10000. Each edge has two weights — 1 ≤ ai, bi < 256. We say that cost of spanning tree of this graph is equal to over picked edges. Find the spanning tree with minimum cost.

Tip
»
8 лет назад, скрыть # |
 
Проголосовать: нравится -63 Проголосовать: не нравится

Would like to hear from tourist mnbvmar TLE FizzyDavid and other legends XD