数学知识
文章平均质量分 59
wwt9b15bs
这个作者很懒,什么都没留下…
展开
-
【题解】sdoj3735函数(2018-08-07集训T1)简单数学知识
问题描述对于一个整数,定义 f(x)为他的每个数位的阶乘的乘积。例如 f(135)=1! * 3! * 5! = 720。给出一个数 a(可以包含前缀零), a 满足他的至少一个数位大于 1。我们要求出最 大 的整数 x,其中 x 不含 0 或 1,并且满足 f(a) = f(x)。输入第一行一个整数 n,表示 a 的长度。 接下来一个整数 a。输出一行一个整数 x 表示答...原创 2018-08-09 19:34:30 · 209 阅读 · 0 评论 -
【题解】zoj3203 Light Bulb(同LibreOJ10016)数学知识
题目链接 输入格式输入文件的第一行包含一个整数 T ,表示测试数据的组数。对于每组测试数据,仅一行,包含三个实数 H,h和 D,H 表示灯泡的高度,h 表示 mildleopard 的身高,D 表示灯泡和墙的水平距离。输出格式输出文件共 T行,每组数据占一行表示影子的最大长度,保留三位小数。样例样例输入 3 2 1 0.5 2 0.5 3 4 3 4 样...原创 2018-09-16 11:55:49 · 225 阅读 · 0 评论 -
【题解】LibreOJ10199[USACO 2008 Dec. Silver]轻拍牛头 数学知识
题目链接题目描述原题来自:USACO 2008 Dec. Silver今天是贝茜的生日,为了庆祝自己的生日,贝茜邀你来玩一个游戏。贝茜让 NNN 头奶牛坐成一个圈。除了 111 号与 NNN 号奶牛外,iii 号奶牛与 i−1i−1i−1 号和 i+1i+1i+1 号奶牛相邻,NNN 号奶牛与 111 号奶牛相邻。农夫约翰用很多纸条装满了一个桶,每一张包含了一个 111 到 10610^6...原创 2018-09-20 14:00:12 · 631 阅读 · 0 评论 -
【题解】洛谷P1414又是毕业季Ⅱ 数学知识
题目链接题目背景“叮铃铃铃”,随着高考最后一科结考铃声的敲响,三年青春时光顿时凝固于此刻。毕业的欣喜怎敌那离别的不舍,憧憬着未来仍毋忘逝去的歌。1000多个日夜的欢笑和泪水,全凝聚在毕业晚会上,相信,这一定是一生最难忘的时刻!题目描述彩排了一次,老师不太满意。当然啦,取每位同学的号数来找最大公约数显然不太合理。于是老师给每位同学评了一个能力值。于是现在问题变为,从n个学生中挑出k个人使得他...原创 2018-09-21 09:19:33 · 160 阅读 · 0 评论 -
【题解】洛谷P1134[USACO Training Section 3.2]阶乘问题 数学知识
题目链接题目描述也许你早就知道阶乘的含义,N阶乘是由1到N相乘而产生,如:12!=1×2×3×4×5×6×7×8×9×10×11×12=479,001,60012!= 1 \times 2 \times 3 \times 4 \times 5 \times 6 \times 7 \times 8 \times 9 \times 10 \times 11 \times 12 = 479,001...原创 2018-09-21 11:55:19 · 708 阅读 · 0 评论 -
【题解】codeforces1058B[Codeforces Round #512 Div.2 B]B.Vasya and Cornfield 数学知识
DescriptionVasya owns a cornfield which can be defined with two integers n and d. The cornfield can be represented as rectangle with vertices having Cartesian coordinates (0,d),(d,0),(n,n−d) and (n−d...原创 2018-09-26 20:52:36 · 256 阅读 · 0 评论 -
【题解】洛谷T48566[提高测试TG4]A.yyy点餐 数学知识
题目链接简单的数论题,手推一下答案为 2n−1∗∑i=1nai2^{n-1}*\sum_{i=1}^na_i2n−1∗∑i=1nai#include<cstdio>typedef long long ll;const ll mod=998244353;ll sum=0;int n,a;inline int read(){ int s=0,t=1;char c...原创 2018-10-04 21:26:41 · 237 阅读 · 0 评论 -
【题解】洛谷P3951[NOIP2017]小凯的疑惑 数学知识
题目链接来了,传说中的 a∗b−a−ba*b-a-ba∗b−a−b problemproblemproblem……一道玄学的结论题(我也不会证)#include<cstdio>typedef unsigned long long ull;int main(){ ull a,b; scanf("%llu%llu",&a,&b); printf("%l...原创 2018-10-05 21:40:30 · 456 阅读 · 0 评论 -
【题解】洛谷P4984[%%GodFly专题赛&&NOIP2018模拟]A.GodFly求解法向量 数学知识
题目链接题目背景“遇到函数无脑求导,遇到几何无脑建系。”是铁头娃的公共特征。作为喜欢建系的一个铁头娃,GodFlyGodFlyGodFly经常需要计算法向量。题目描述定义平面α\alphaα内有两相交向量a→=(x1,y1,z1)\overrightarrow a=(x_1,y_1,z_1)a=(x1,y1,z1) ,b→=(x2,y2,z2)\overrightarrow b=(...原创 2018-09-22 22:19:21 · 202 阅读 · 0 评论 -
【题解】codeforces1058G[Codeforces Round #512 Div.2]G.Linear Congruential Generator LCM+数学知识
DescriptionYou are given a tuple generator f(k)=(f1(k),f2(k),⋯&amp;ThinSpace;,fn(k))f^{(k)}=(f^{(k)}_1,f^{(k)}_2,\cdots,f^{(k)}_n)f(k)=(f1(k),f2(k),⋯,fn(k)), where fi(k)=(ai⋅fi(k−1)+bi)mod&amp;Thi...转载 2018-09-27 21:27:57 · 400 阅读 · 0 评论 -
【题解】codeforces235A[AHSOFNU codeforces训练赛2 by hzwer]B.LCM Challenge 数学知识
题目链接DescriptionSome days ago, I learned the concept of LCM (least common multiple). I’ve played with it for several times and I want to make a big number with it.But I also don’t want to use many n...转载 2018-09-29 17:26:33 · 205 阅读 · 0 评论 -
【题解】codeforces1047A[Codeforces Round #511 (Div. 2)]A.Little C Loves 3 I 数学知识
题目链接DescriptionLittle C loves number «3» very much. He loves all things about it.Now he has a positive integer n. He wants to split n into 3 positive integers a,b,c, such that a+b+c=n and none of t...原创 2018-09-30 13:44:43 · 174 阅读 · 0 评论 -
【题解】codeforces1047B[Codeforces Round #511 (Div. 2)]B.Cover Points 数学知识
题目链接DescriptionThere are nnn points on the plane, (x1,y1),(x2,y2),…,(xn,yn)(x_1,y_1),(x_2,y_2),…,(x_n,y_n)(x1,y1),(x2,y2),…,(xn,yn).You need to place an isosceles triangle with two sides on t...原创 2018-09-30 13:56:57 · 164 阅读 · 0 评论 -
【题解】codeforces1047D[Codeforces Round #511 (Div. 2)]D.Little C Loves 3 II 数学知识
题目链接DescriptionLittle C loves number «3» very much. He loves all things about it.Now he is playing a game on a chessboard of size n×m. The cell in the x-th row and in the y-th column is called (x,y...原创 2018-09-30 15:42:13 · 333 阅读 · 0 评论 -
【题解】codeforces987BHigh School: Become Human 数学知识
取对数乘出来比较(同学的一道考试题……这题1分钟就没了吧)#include<cstdio>#include<iostream>#include<cmath>using namespace std;const double eps=1e-6;long double a,b,x,y;int main(){ cin>>x>>...原创 2018-10-28 22:07:06 · 151 阅读 · 0 评论 -
【题解】LibreOJ10193 序列的第k个数 数学知识+快速幂
题目链接题目描述BSNY 在学等差数列和等比数列,当已知前三项时,就可以知道是等差数列还是等比数列。现在给你序列的前三项,这个序列要么是等差序列,要么是等比序列,你能求出第 kkk 项的值吗。 如果第 kkk 项的值太大,对 200907200907200907 取模。输入格式第一行一个整数 TTT,表示有 TTT 组测试数据;对于每组测试数据,输入前三项 a,b,ca,b,ca,b,c...原创 2018-09-20 07:23:24 · 454 阅读 · 0 评论 -
【题解】洛谷P1075(LibreOJ10198)[NOIP2012普及T1]质因数分解 数学知识
题目描述已知正整数nnn是两个不同的质数的乘积,试求出两者中较大的那个质数。输入输出格式输入格式:一个正整数nnn。输出格式:一个正整数ppp,即较大的那个质数。输入输出样例输入样例#1:21输出样例#1:7说明n≤2×109n\le 2\times 10^9n≤2×109NOIP 2012 普及组 第一题#include&lt;cstdio&gt;int mai...原创 2018-09-19 16:39:08 · 222 阅读 · 0 评论 -
【题解】洛谷P1014Cantor表 枚举+简单数学知识
题目链接 将这张表看做一个坐标系,观察可得n的编号即n的坐标。设n(x,y),则横纵坐标的和为x+y。通过观察发现和为a的斜线上有a-1个点,于是n点之前的斜线共有(1+2+..+x+y-2)=(x+y-2)*(x+y-1)/2个点; 而由对称性n点与前一斜线的差值可直接等于x(或y)所以问题变成找到一组x,y,使得n=(x+y-2)*(x+y-1)/2+x; 移项可得2*n=(x+y-2)...原创 2018-08-29 07:11:07 · 271 阅读 · 0 评论 -
【题解】LightOJ1163 Bank Robbery 枚举+数学知识
题目链接DescriptionIn one very cold morning, Mark decides to rob a bank. But while trying hacking into the security system, he found that it is locked by some random value. He also found a pattern o...原创 2018-09-16 16:57:27 · 132 阅读 · 0 评论 -
【题解】LightOJ1245 Harmonic Number (II) 数学知识
题目链接 InputInput starts with an integer T (≤ 1000), denoting the number of test cases.Each case starts with a line containing an integer n (1 ≤ n &lt; 231).OutputFor each case, print the...原创 2018-09-17 09:23:22 · 224 阅读 · 0 评论 -
【题解】洛谷P1403[AHOI2005]约数研究(同bzoj1968) 数学知识
题目链接题目描述科学家们在Samuel星球上的探险得到了丰富的能源储备,这使得空间站中大型计算机“Samuel II”的长时间运算成为了可能。由于在去年一年的辛苦工作取得了不错的成绩,小联被允许用“Samuel II”进行数学研究。小联最近在研究和约数有关的问题,他统计每个正数N的约数的个数,并以f(N)来表示。例如12的约数有1、2、3、4、6、12。因此f(12)=6。下表给出...原创 2018-09-17 09:23:47 · 296 阅读 · 0 评论 -
【题解】洛谷P1372又是毕业季Ⅰ 数学知识
题目链接题目背景“叮铃铃铃”,随着高考最后一科结考铃声的敲响,三年青春时光顿时凝固于此刻。毕业的欣喜怎敌那离别的不舍,憧憬着未来仍毋忘逝去的歌。1000多个日夜的欢笑和泪水,全凝聚在毕业晚会上,相信,这一定是一生最难忘的时刻!题目描述为了把毕业晚会办得更好,老师想要挑出默契程度最大的k个人参与毕业晚会彩排。可是如何挑呢?老师列出全班同学的号数1,2,……,n,并且相信k个人...原创 2018-09-18 10:44:35 · 189 阅读 · 0 评论 -
【题解】洛谷P1338末日的传说 数学知识
题目链接题目描述只要是参加jsoi活动的同学一定都听说过Hanoi塔的传说:三根柱子上的金片每天被移动一次,当所有的金片都被移完之后,世界末日也就随之降临了。在古老东方的幻想乡,人们都采用一种奇特的方式记录日期:他们用一些特殊的符号来表示从1开始的连续整数,1表示最小而N表示最大。创世纪的第一天,日历就被赋予了生命,它自动地开始计数,就像排列不断地增加。我们用1-N来表示日历的...原创 2018-09-18 10:44:40 · 158 阅读 · 0 评论 -
【题解】洛谷P2261(同bzoj1257)[CQOI2007]余数求和 构造+数学知识
题目链接题目描述给出正整数n和k,计算G(n, k)=k mod 1 + k mod 2 + k mod 3 + … + k mod n的值,其中k mod i表示k除以i的余数。例如G(10, 5)=5 mod 1 + 5 mod 2 + 5 mod 3 + 5 mod 4 + 5 mod 5 …… + 5 mod 10=0+1+2+1+0+5+5+5+5+5=29输入输出格式...原创 2018-09-11 13:37:36 · 225 阅读 · 1 评论 -
【题解】LightOJ1090 Trailing Zeroes (II) 前缀和+数学知识
题目链接 预处理出阶乘的因子2和5的个数的前缀和#include&lt;cstdio&gt;#include&lt;algorithm&gt;using namespace std;typedef long long ll;const int N=1e6;ll sum2[N+10],sum5[N+10];void Init(){ for(int i=2;i&...原创 2018-09-14 06:39:42 · 171 阅读 · 0 评论 -
【题解】LightOJ1098(同UVA10830)A New Function 数学知识
题目链接 看到这个数据范围就发愁了……O(n)扫都不行。 其实写到根号n就可以了。#include&lt;cstdio&gt;#include&lt;cmath&gt;using namespace std;typedef long long ll;int t,ca;ll ans,n;int main(){ //freopen("in.txt","r原创 2018-09-15 06:34:30 · 202 阅读 · 0 评论 -
【题解】LightOJ1109 打表+数学知识
题目链接DescriptionWe define b is a Divisor of a number a if a is divisible by b . So, the divisors of 12 are 1, 2, 3, 4, 6, 12. So, 12 has 6 divisors.Now you have to order all the integers from 1...原创 2018-09-15 06:34:33 · 149 阅读 · 0 评论 -
【题解】洛谷U32670[NOIP2018原创模拟赛DAY1T1]小凯的数字 数学知识
题目链接题目背景NOIP2018 原创模拟题T1NOIP DAY1 T1 or DAY 2 T1 难度是否发现与NOIP2017 DAY1 T1 有异曲同工之妙说明:#10,bug已修复题目描述小凯有一天突发奇想,写下了一串数字:l(l+1)(l+2)...(r−1)rl(l+1)(l+2)...(r−1)rl(l+1)(l+2)...(r-1)rl(l+1)(l+2)...(r−1...原创 2018-09-23 17:38:46 · 706 阅读 · 0 评论 -
【题解】LightOJ1138 Trailing Zeroes (III) 二分+数学知识
题目链接DescriptionYou task is to find minimal natural number N, so that N! contains exactly Q zeroes on the trail in decimal notation. As you know N! = 1*2*…*N. For example, 5! = 120, 120 contains ...原创 2018-09-15 06:34:37 · 153 阅读 · 0 评论 -
【题解】LightOJ1214 Large Division 数学知识
题目链接DescriptionGiven two integers, a and b, you should check whether a is divisible by b or not. We know that an integer a is divisible by an integer b if and only if there exists an integer c s...原创 2018-09-15 06:34:50 · 127 阅读 · 0 评论 -
【题解】LightOJ1234 Harmonic Number 数学知识+打表
题目链接 InputInput starts with an integer T (≤ 10000), denoting the number of test cases.Each case starts with a line containing an integer n (1 ≤ n ≤ 108).OutputFor each case, print the c...原创 2018-09-15 06:34:58 · 154 阅读 · 0 评论 -
【题解】洛谷P2312[NOIP2014]解方程 枚举+数学知识
题目链接枚举答案x,计算上面那个式子的值,可以选择边算边模(某个八位质数),免得打高精,一般不会死。#include<cstdio>#include<vector>using namespace std;const int mod=19260817,M=1e6+10;typedef long long ll;template<typename tp...原创 2018-11-07 07:50:46 · 291 阅读 · 1 评论