随笔分类 - 08.数学
摘要:蛮有意思的一个关于二进制的题,建立在plus和xor的关系上的题, 由于 A=X+Y,B=XxorY,那么 A=B+((XandY)<<1)。 因此 $X \; \mathrm{and} \; Y
阅读全文
摘要:题目链接:https://codeforces.com/problemset/problem/1136/C 题意: 给出 n×m 的矩阵 A,B,你可以对其中任意某个 k×k 的子矩阵进行转置操作。 问你是否能将 A 变成 B。 题解: 不管我们如何进
阅读全文
摘要:题目链接:http://codeforces.com/gym/101981/attachments The use of the triangle in the New Age practices seems to be very important as it represents the unh
阅读全文
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5954 Problem DescriptionYou have got a cylindrical cup. Its bottom diameter is 2 units and its height i
阅读全文
摘要:0101 a^b 题目链接:传送门 描述 求 a 的 b 次方对 p 取模的值,其中 1≤a,b,p≤10^9 输入格式 三个用空格隔开的整数 a,b 和 p。 输出格式 一个整数,表示 a^b mod p 的值。 样例输入 2 3 9 样例输出 8 题解: 快速幂。 AC代码: 0102 64位整
阅读全文
摘要:题目链接:传送门 描述石头游戏在一个 n 行 m 列 (1≤n,m≤8) 的网格上进行,每个格子对应一种操作序列,操作序列至多有 10 种,分别用 0∼9 这 10 个数字指明。操作序列是一个长度不超过 6 且循环执行、每秒执行一个字符的字符串。
阅读全文
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5950 Farmer John likes to play mathematics games with his N cows. Recently, they are attracted by recur
阅读全文
摘要:题目链接: http://codeforces.com/gym/101194/attachments https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&prob
阅读全文
摘要:题目链接: http://codeforces.com/gym/101194/attachments https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&prob
阅读全文
摘要:题目链接:http://codeforces.com/gym/101775/problem/A It is said that a dormitory with 6 persons has 7 chat groups ^_^. But the number can be even larger: s
阅读全文
摘要:题目链接:https://www.lydsy.com/JudgeOnline/problem.php?id=1002 Description 轮状病毒有很多变种,所有轮状病毒的变种都是从一个轮状基产生的。一个N轮状基由圆环上N个不同的基原子和圆心处一个核原子构成的,2个原子之间的边表示这2个原子之间
阅读全文
摘要:题目链接:https://www.nowcoder.com/acm/contest/207/D 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5985 时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288K
阅读全文
摘要:题目链接:https://nanti.jisuanke.com/t/31453 After Incident, a feast is usually held in Hakurei Shrine. This time Reimu asked Kokoro to deliver a Nogaku sh
阅读全文
摘要:题目链接:https://nanti.jisuanke.com/t/31452 A prime number (or a prime) is a natural number greater than 1 that cannot be formed by multiplying two smal
阅读全文
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6441 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Problem Descripti
阅读全文
摘要:题目链接:https://nanti.jisuanke.com/t/30990 Alice, a student of grade 6, is thinking about an Olympian Math problem, but she feels so despair that she cri
阅读全文
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6343 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others) Problem Descrip
阅读全文
摘要:题目链接:https://www.nowcoder.com/acm/contest/143/F 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 262144K,其他语言524288K 64bit IO Format: %lld 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/
阅读全文
摘要:题目链接:https://ac.2333.moe/Problem/view.xhtml?id=1643 问题描述 输入两个正整数 n, m,输出 n!/m!,其中阶乘定义为 n!= 1*2*3*...*n (n>=1)。 比如,若 n=6, m=3,则 n!/m!=6!/3!=720/6=120。
阅读全文
摘要:题目链接:https://cn.vjudge.net/problem/CodeForces-894C In a dream Marco met an elderly man with a pair of black glasses. The man told him the key to immor
阅读全文