Permutation Bo 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5753 Description There are two sequences h1∼hn and c1∼cn. h1∼hn is a permutation of 1∼n. particularly, h0=hn+1=0. We define the expression [condition] is 1 when condition is True,is 0 whe…
Stone Game II Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 531 Accepted Submission(s): 300 Problem Description Stone Game II comes. It needs two players to play this game. There are some p…
Exclusive or 题目链接: http://acm.hust.edu.cn/vjudge/contest/121336#problem/J Description Given n, find the value of Note: ♁ denotes bitwise exclusive-or. Input The input consists of several tests. For each tests: A single integer n (2≤n<10^500). Output…
Couple doubi 题目链接: http://acm.hust.edu.cn/vjudge/contest/121334#problem/D Description DouBiXp has a girlfriend named DouBiNan.One day they felt very boring and decided to play some games. The rule of this game is as following. There are k balls on th…
题目 洛谷传送门 题解 把1/21/21/2转化成0/10/10/1,所以直接可以异或. 对于长度为nnn的0/10/10/1数列,发现每变换2k(k>1)2^k(k>1)2k(k>1)时,且每个数的值就是往左和往右各走2^(k-1)步的值异或起来. 那么把mmm二进制分解一下,最后如果是奇数就多做一次. CODE #include <bits/stdc++.h> using namespace std; typedef long long LL; const int MAX…
题目传送:http://acm.hdu.edu.cn/showproblem.php?pid=2147 Problem Description Recently kiki has nothing to do. While she is bored, an idea appears in his mind, she just playes the checkerboard game.The size of the chesserboard is n*m.First of all, a coin i…
kiki's game HDU - 2147 题意:一个n*m的表格,起始位置为右上角,目标位置为左下角,甲先开始走,走的规则是可以向左,向下或者向左下(对顶的)走一格.谁先走到目标位置谁就胜利.在甲乙都采用最佳策略的时候,先走者能否获胜. 这是一个5*5的PN图 从中可以看出,只要满足行或列中的某一个为偶数就可以先手必胜 #include<iostream> #include<cstdio> using namespace std; int main(){ int n,m; ){…
kiki's game Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 40000/1000 K (Java/Others)Total Submission(s): 5094 Accepted Submission(s): 2985 Problem Description Recently kiki has nothing to do. While she is bored, an idea appears in his mi…
Recently kiki has nothing to do. While she is bored, an idea appears in his mind, she just playes the checkerboard game.The size of the chesserboard is n*m.First of all, a coin is placed in the top right corner(1,m). Each time one people can move the…
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 11740 Accepted Submission(s): 7620 Problem Description 大学英语四级考试就要来临了,你是不是在紧张的复习?也许紧张得连短学期的ACM都没工夫练习了,反正我知道的Kiki和Cici都是如此.当然,作为在考场浸润了十几载的当代大学生,K…
Nim or not Nim? Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Practice HDU 3032 Description Nim is a two-player mathematic game of strategy in which players take turns removing objects from distinct heaps.…