Writing a C++ version of the algebra game 24

前端 未结 7 1612
离开以前
离开以前 2021-01-02 12:48

I am trying to write a C++ program that works like the game 24. For those who don\'t know how it is played, basically you try to find any way that 4 numbers can total 24 th

7条回答
  •  梦毁少年i
    2021-01-02 13:26

    One thing that might make this faster than normal is parallelisation. Check out OpenMP. Using this, more than one check is carried out at once (your "alg" function) thus if you have a dual/quad core cpu, your program should be faster.

    That said, if as suggested above the problem is NP-complete, it'll be faster, not necessarily fast.

提交回复
热议问题