Dijkstra.'s blog

By Dijkstra., history, 4 weeks ago, In English,

The 2018 Egyptian Collegiate Programming Contest was held yesterday this was a problem from it where he asks for

Where n<=10^5 and a[i]<=10^5 answer should be printed %10^9+7

I would appreciate any help in solving this problem and thanks in advance

 
 
 
 
  • Vote: I like it  
  • +30
  • Vote: I do not like it  

»
4 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by Dijkstra. (previous revision, new revision, compare).

»
4 weeks ago, # |
Rev. 2   Vote: I like it +33 Vote: I do not like it
hint
solution idea
code
»
4 weeks ago, # |
  Vote: I like it +25 Vote: I do not like it

Mhm... nice problem. Do you agree, mnbvmar?

  • »
    »
    4 weeks ago, # ^ |
    Rev. 3   Vote: I like it +27 Vote: I do not like it

    <3

    Story: We proposed this exact task (under a tiny bit different constraints, though) to our high school students back in 2015. I was quite surprised that apparently it has never appeared anywhere even though the statement feels really natural and obvious. So it seems it eventually did!

    I think e-pluszak came up with another solution, involving...

    Spoiler

    I can't remember any details, though. Mind sharing (if you still remember it)?

    • »
      »
      »
      4 weeks ago, # ^ |
      Rev. 2   Vote: I like it +14 Vote: I do not like it
      Solution