Codeforces Round #256 (Div. 2) D. Multiplication Table(二分查找)...
分类:
其他好文 时间:
2014-07-19 18:38:19
阅读次数:
195
UVA 847 - A Multiplication Game
题目链接
题意:一个数一开始是1,每次轮流乘2-9,谁先大于n谁就赢,问谁胜
思路:博弈,找出必胜态,2-9为stan,10-18为ollie,19-162为stan...发现都是乘2乘9交替
代码:
#include
#include
#include
long long n;
bool ju...
分类:
其他好文 时间:
2014-07-18 21:27:15
阅读次数:
194
n*m的一个乘法表,从小到大排序后,输出第k个数
(1?≤?n,?m?≤?5·10^5; 1?≤?k?≤?n·m)...
分类:
其他好文 时间:
2014-07-18 12:37:24
阅读次数:
207
刚刚开始想到一种很暴力但还行的方法,不过在和TK讨论的过程中引出了一个更好的算法#include#include#include#includeusing namespace std;long long n,m,k;long long check(long long x){ long long...
分类:
其他好文 时间:
2014-07-18 12:17:25
阅读次数:
221
先上题目:Multiplication PuzzleTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 6162Accepted: 3758DescriptionThe multiplication puzzle is played wi...
分类:
其他好文 时间:
2014-07-16 18:14:34
阅读次数:
213
Arithmetic OperatorsOperatorDescription+addition-subtraction*multiplication/division^ or ** exponentiationx %% y modulus (x mod y) 5%%2 is 1x %/% y in...
分类:
其他好文 时间:
2014-07-14 00:01:59
阅读次数:
517
Matrix Chain Multiplication
Suppose you have to evaluate an expression like A*B*C*D*E where A,B,C,D and E are matrices. Since matrix multiplication is associative, the order in which multi...
分类:
其他好文 时间:
2014-07-13 18:10:40
阅读次数:
223
/*
B - Cow Multiplication
Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u
Submit
Status
Practice
POJ 3673
Description
Bessie is tired of multiplying pairs of numbers th...
分类:
其他好文 时间:
2014-07-12 19:19:02
阅读次数:
164
Given two numbers represented as strings, return multiplication of the numbers as a string.Note: The numbers can be arbitrarily large and are non-nega...
分类:
其他好文 时间:
2014-07-12 00:15:07
阅读次数:
268
HDU 1517 A Multiplication Game (博弈-求sg)
题目大意:
Stan 和 Ollie 两个人玩游戏, 一开始数字是 1,两个人轮流,Stan 先手,每个人选择 2~9 里面的一个一直乘以起初的数字,直到某个人乘到 这个数大于等于 n 就算赢,n给定,问你谁必然赢。
解题思路:
这题我没找出SG函数(必胜必输)的规律,只能用DP的方法求出每种状态的必胜必输状态。
2~9 ,依次其实可以用 2 3 5 7 这几个数得到,因此每个状态只需要记录2 3 5 7 这几个数的...
分类:
其他好文 时间:
2014-07-06 12:16:39
阅读次数:
234