420yoloswag69's blog

By 420yoloswag69, history, 9 years ago, In English

Hi any ways to check whether an array (1e5 items at most) has an arithmetic progression as a subsequence and output their positions?

for example 5

3 4 2 1 5

output 1 3 4

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By 420yoloswag69, history, 9 years ago, In English

Hi i need a bit of help !

Consider a chessboard of size NxN.

Your must find the maximum number of bishops that can be placed on the chessboard, such that no pair of bishops can attack each other. Some cells are damaged. Bishops cannot be placed on these cells, but they can attack through them. N<100

I can do a naive bruteforce but it keeps giving me timelimit. Any tip how to optimize it ?

Thanks!

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it