hackerrank

MIS.W新歓コンテスト2020 Random Card Battle ~floatの精度は低い~

Quiz https://www.hackerrank.com/contests/misw-welcomecontest2020/challenges/random-card-battle/problem 解法 A>BならX=0で勝てるので勝率100% それ以外ならX=Aで全力で範囲を広げるのが最適 落とし穴(?) 小数点以下、有効数字5桁、四捨五入で出力す…

Bananas Multiplier (Easy/Hard)

Quiz https://www.hackerrank.com/contests/yfkpo3-2/challenges/bananas-multiplier-easy https://www.hackerrank.com/contests/yfkpo3-2/challenges/bananas-multiplier-hard (hardも通る)解法 (0-indexedとする) 頂点0からの最短距離(辺の本数)を各頂点…

grundy数を初めて使ってみた Day 1: Game of Stones

Quiz https://www.hackerrank.com/contests/5-days-of-game-theory/challenges/a-game-of-stones/problem Submit https://www.hackerrank.com/contests/5-days-of-game-theory/challenges/a-game-of-stones/submissions/code/1314174009 grundy数とは https:…