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

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

If you had a smart friend who liked puzzles, and you could choose one problem that you thought was accessible and interesting enough to get them curious about competitive programming, what problem would you choose?

Edit: To be clear, I’m curious about specific problems, not just general topics.

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

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

Fibonacci with Matrix Expo did it for me. Knapsack would have probably worked too.

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

geometry problems :P

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

For me, I think the most important and interest thing is that you should use computer to calculate complex processes to get final result. So give problem which is hard to describe exact answer directly, then he or she will have interest in competitive programming.

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

I agree with a previous commenter; Fibonacci with Matrix Expo similarly got me hooked.

Combi in general was something I found interesting from Math competitions, but with a computer, so many more avenues are opened and much more interesting problems can be asked.

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

I will give Number Theory problem.

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

When I started competitive programming I was absolutely thrilled by problem "Garden" from IOI 2005. You start by the trivial $$$O(N^{10})$$$, come up with smart ideas to make it $$$O(N^5)$$$, and optimize to $$$O(N^4)$$$ and finally $$$O(N^3)$$$ by discovering new optimizations that have general implications.

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

32C - Flea

Was also the problem that got me into CP

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

i really liked this problem 1092D1 - Great Vova Wall (Version 1)

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

any love for Your Ride Is Here?

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

This is an interesting question but also a strange one. Do you want a reaction like "you can solve this? This is incredible" or for a person to understand and maybe be able to solve the problem? If second — do this person know about time complexity? If yes, this is incredible, why would anyone know about time complexity outside of CP? If no, I don't believe that you can show relation to programming, it should be pure mathematical problem, which is not what you want, I suppose.

I guess there is some middle ground like being able to grasp the problem statement and think about the problem a little bit, but hardly coming up with a solution.

Anyway, my recommendations (probably too hard for someone not in CP, especially the first one, I mean tourist and Petr didn't solve that one, though my classmate did): TCO16 Semifinal2 Easy, TCO17 2C Easy. Wow, two problems from TopCoder from a person who don't like TopCoder. That's embarrassing.

Also kinda theoretical problem if they know about complexity: Given an array of length $$$n$$$, you can take a segment and reverse it. The cost of this operation is length of reversed segment. Come up with an algorithm that sorts the array spending $$$o(n^{2})$$$ (faster than bubble sort. I don't know optimal complexity, but I do have pretty good one). To all: feel free to write your algorithms in comments to this one (using spoilers, of course).

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

    People ask you for question, you give them history books !

  • »
    »
    8 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +34 Проголосовать: не нравится
    Complexity
    Solution
    tl;dr

    Nice problem!

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

    So, my intended audience would probably have some basic knowledge about time complexity (perhaps they wouldn't be able to do certain things like prove Manacher's is $$$O(n)$$$ or something, but they would probably be able to reason about some pretty simple data structure complexities). The middle ground you presented sounds accurate to what I was looking for. That said, you can interpret the question in whatever way you are comfortable with answering; I enjoyed the problems you shared.

    Also, time complexity is really not specific to CP; most algorithm and discrete math classes in the US teach about time complexity, and to be honest I would be astounded if it was not taught in Computer Science classes in Russia, which has a much better STEM education system than the US.

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

Interactive problems would be a good choice. They rarely require knowledge of algorithms.

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

    I agree; in fact, when I wrote the question, I was thinking of problem D from this year's Code Jam qualification.

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

      Really? It's not interesting, there are much better interactive problems.

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

        That's unfortunate that you didn't think it was interesting; I suppose it was probably too easy for you. It was nontrivial for me and the solution was pretty and simple enough that I could present it to my friends without much background, and still see the "Oh!" looks on their faces afterward.

        Perhaps you'd like to share some of your favorite interactive problems? Although not interactive, I enjoyed your segment reversal problem from above.

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

baseball elimination problem :D

How you solve it using Graph and Max flow out of nothing really amazed me the first time I read about it.

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

This problem from NCPC is rather interesting (realistic): you have $$$N$$$ teams, each with $$$M$$$ people, and you want to run a tournament where each pair of contestants from different teams plays exactly one game against each other, with the minimum number of rounds — $$$M(N-1)+1$$$ is enough. In one round, each player can play one game. The goal is to make a tournament table — who should play against whom in each round.

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

I like this problem a lot — Trapping Rain Water 3D , but the preferrence depends a lot on personal skill, interests, problem solving history, etc.