牛客编程巅峰赛S2第7场 - C - 分贝壳游戏
题目链接:https://ac.nowcoder.com/acm/contest/9752/C
/** * * @param n int整型 * @param p int整型 * @param q int整型 * @return int整型 */ function Gameresults( n , p , q ) { // write code here if( n<=p ) return 1; if( n==p+1 ) return -1; if( p>q ) return 1; if( q>p ) return -1; if( n%(p+1)== 0 ){ return -1; } else { return 1; } } module.exports = { Gameresults : Gameresults };