253#include <tclap/CmdLine.h>
257using namespace Aleph;
261 for (
unsigned i = 0; i < s; i++)
278 printf(
"Step size must be >= 1\n");
299 TCLAP::CmdLine
cmd(
"Josephus problem",
' ',
"1.0");
301 TCLAP::ValueArg<unsigned>
numPerArg(
"n",
"num-persons",
303 false, 20,
"unsigned");
306 TCLAP::ValueArg<unsigned>
pasoArg(
"p",
"paso",
308 false, 7,
"unsigned");
317 }
catch (TCLAP::ArgException &e) {
318 std::cerr <<
"error: " << e.error() <<
" for arg " << e.argId() << std::endl;
Dynamic doubly linked list with O(1) size and bidirectional access.
T & append(const T &item)
Append a copied item at the end of the list.
T & get_first() const
Return a modifiable reference to first item in the list.
void avanceItor(DynDlist< unsigned >::Iterator &itor, unsigned s)
void orden_ejecucion(unsigned num_personas, unsigned paso)
Main namespace for Aleph-w library functions.
DynList< T > maps(const C &c, Op op)
Classic map operation.
Dynamic doubly linked list implementation.