Skip to main content

New answers tagged

1 vote

backward induction algorithm computation

Your typehints are incorrect: current_reward etc. are np.ndarray (the actual runtime type), not ...
Reinderien's user avatar
  • 70.3k
2 votes

Tarjan's Strongly Connected Components finding algorithm

Please point out any ... code style issues. Certainly. Layout The code could use some breathing space in terms of blank lines between functions. The black program can be used to automatically ...
toolic's user avatar
  • 13.4k
1 vote

N queen problem-like (+rooks and a different goal)

Try to avoid using namespace std; using namespace std pollutes global namespace and leads to possible conflicts with other functions. Why is "using namespace ...
JimmyHu's user avatar
  • 7,014
4 votes

N queen problem-like (+rooks and a different goal)

Why your program can be considered too slow by a 'judge' program When I execute your program on my Pi 5 (Debian bookworm), because of these lines in your main: ...
bruno's user avatar
  • 212
7 votes

N queen problem-like (+rooks and a different goal)

The code is almost unreadable I'm guessing this is one of the problems from a site like HackerRank or LeetCode, and the goal is to solve the problem in as little time as possible. However, single-...
G. Sliepen's user avatar
  • 68.1k

Top 50 recent answers are included