HACKING 120% {Hacking, programmazione, computer & molto altro}

Esercizio

« Older   Newer »
  Share  
view post Posted on 13/4/2012, 18:50     +1   -1
Avatar

Water can take unforseen forms.

Group:
Founder
Posts:
5,273
Reputation:
+1,147
Location:
Shabang

Status:


Giuseppe Flavio era uno storico romano di origine ebraica. Durante le guerre ebrei cotro romani del primo secolo dC, era in una caverna con i commilitoni, 40 uomini in tutto, circondato da truppe nemiche romane. Hanno deciso di suicidarsi in piedi in un anello e contando ogni terzo uomo. Ogni uomo designato a tal fine è stato quello di suicidarsi ... Giuseppe Flavio, non volendo morire, è riuscito a mettersi nella posizione di ultimo sopravvissuto.

Calcolare in quale posizione si è messo Flavio

Flavius Josephus was a roman historian of Jewish origin. During the Jewish-Roman wars of the first century AD, he was in a cave with fellow soldiers, 40 men in all, surrounded by enemy Roman troops. They decided to commit suicide by standing in a ring and counting off each third man. Each man so designated was to commit suicide…Josephus, not wanting to die, managed to place himself in the position of the last survivor.

Per le soluzioni:
http://blog.dhananjaynene.com/2008/07/perf...n-jruby-groovy/

Io cercherò di svilupparlo in python, senza usare la oop.. :)
 
Web  Top
Krypt05
view post Posted on 25/6/2012, 09:23     +1   -1




E' un po' come l'ultimo esercizio sul topic Esercizi dei bocconi:
Gli basterà mettersi in una posizione che non sia multipla di 4 o 1.
 
Top
view post Posted on 25/6/2012, 10:13     +1   -1
Avatar

Water can take unforseen forms.

Group:
Founder
Posts:
5,273
Reputation:
+1,147
Location:
Shabang

Status:


CITAZIONE
Gli basterà mettersi in una posizione che non sia multipla di 4 o 1.

Ehm... tutto è multiplo di uno :asd:
 
Web  Top
Krypt05
view post Posted on 25/6/2012, 10:50     +1   -1




Scusa mi sono espresso male, intendevo una posizione multipla di 4, oppure la posizione 1 : P
 
Top
3 replies since 13/4/2012, 18:50   105 views
  Share