摘要:http://219.244.176.199/JudgeOnline/problem.php?id=1215 这是这次微软和百度实习面试的一道题,题目大意就是:有一个n*m的矩阵,已知它每一行都是不严格递增的,而且每一列都是不严格递增。给你一个数k,请你判断k是否存在于矩阵中。 微软面试的时候没有想
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=5667 这题的关键是处理指数,因为最后结果是a^t这种的,主要是如何计算t。 发现t是一个递推式,t(n) = c*t(n-1)+t(n-2)+b。这样的话就可以使用矩阵快速幂进行计算了。 设列矩阵[t(n), t
阅读全文
摘要:题目链接:http://acm.uestc.edu.cn/#/problem/show/1226题目大意就是构造一个行列和每个角的2*2都是1234的4*4矩阵。用dfs暴力搜索,不过需要每一步进行判断是否已经出现了重复,如果最后再判断的话复杂度有点高。代码:#include #include #i...
阅读全文
摘要:题目链接:http://acm.uestc.edu.cn/#/problem/show/1215题目大意就是问一个2*2的矩阵能否通过旋转得到另一个。代码:#include #include #include #include #include #include #include #include ...
阅读全文
摘要:DescriptionIn our daily life we often use 233 to express our feelings. Actually, we may say 2333, 23333, or 233333 ... in the same meaning. And here i...
阅读全文