Number Game Alice and Bob are playing a game on a line of N squares. The line is initially populated with one of each of the numbers from 1 to N. Alice and Bob take turns removing a single number from the line, subject to the restriction that a numbe…
KK's Number 题目链接: http://acm.hust.edu.cn/vjudge/contest/121332#problem/K Description Our lovely KK has a funny mathematical game:This game requires two people,There are numbers,every time KK will take the numbers,first.Every time you can take any num…
UVA 1558 - Number Game 题目链接 题意:20之内的数字,每次能够选一个数字,然后它的倍数,还有其它已选数的倍数组合的数都不能再选,谁先不能选数谁就输了,问赢的方法 思路:利用dp记忆化去求解,要输出方案就枚举第一步就可以,状态转移过程中,选中一个数字,对应的变化写成一个函数,然后就是普通的博弈问题了,必胜态之后必有必败态,必败态之后全是必胜态 代码: #include <stdio.h> #include <string.h> const int N = 10…
A Gym 101194A Number Theory Problem 7 的二进制是111,2k-1 的二进制是 k 个 1.所以 k 能被 3 整除时 2k-1 才能被 7 整除. #include <bits/stdc++.h> using namespace std; int main() { int T; scanf("%d", &T); for(int ca = 1; ca <= T; ++ca) { int n; scanf("%d&q…
G. The jar of divisors time limit per test:2 seconds memory limit per test:64 megabytes input:standard input output:standard output Alice and Bob play the following game. They choose a number N to play with. The rules are as follows: - They write eac…
There are two seagulls playing a very peculiar game. First they line up N unit squares in a line, all originally colored white. Let L be the length of the longest continuous sub-segment of white unit squares. Let P be any prime that satisfies the con…