[PE484]Arithmetic Derivative】的更多相关文章

题意:对整数定义求导因子$'$:$p'=1,(ab)'=a'b+ab'$,求$\sum\limits_{i=2}^n(i,i')$ 这个求导定义得比较妙:$(p^e)'=ep^{e-1}$ 推一下就可以知道$w(i)=(i,i')$是个积性函数,并且$w(p^e)=p^{e-[e\ne0\pmod p]}$ 因为$w(p)=1$,考虑构造$q=w*\mu$,那么$q(p)=0$,又因为$w=q*I$,所以答案为$\sum\limits_{i=1}^nq(i)\left\lfloor\frac n…
题目:Problem A. Arithmetic DerivativeInput file: standard inputOutput file: standard inputTime limit: 1 secondMemory limit: 256 mebibytesLets define an arithmetic derivative:• if p = 1 then p0 = 0;• if p is prime then p0 = 1;• if p is not prime then n0…
假设一个数有n个质因子a1,a2,..,an,那么n'=Σ(a1*a2*...*an)/ai. 打个表出来,发现一个数x,如果x'=Kx,那么x一定由K个“基础因子”组成. 这些基础因子是2^2,3^3,5^5,7^7,11^11,13^13.只有6个,K不超过30,于是可以dfs. 要注意搜索顺序(每次枚举的时候,都从大于等于前项的开始搜)和可行性剪枝(如果超过r则剪枝,虽说有可能爆long long,但其实整除就可以判,而且没有精度误差). #include<cstdio> //#incl…
A. Arithmetic Derivative 形如$p^p(p是质数)$的数的比值为$1$,用$k$个这种数相乘得到的数的比值为$k$,爆搜即可. #include<cstdio> #include<algorithm> typedef unsigned long long ll; int K,cnt,all;ll n,i,q[100000],ans[1000000]; ll po(ll a,ll b){ ll t=1; while(b--){ if(t>n/a)retu…
A sequence of numbers is called arithmetic if it consists of at least three elements and if the difference between any two consecutive elements is the same. For example, these are arithmetic sequences: 1, 3, 5, 7, 9 7, 7, 7, 7 3, -1, -5, -9 The follo…
A sequence of number is called arithmetic if it consists of at least three elements and if the difference between any two consecutive elements is the same. For example, these are arithmetic sequence: 1, 3, 5, 7, 9 7, 7, 7, 7 3, -1, -5, -9 The followi…
[本文链接] http://www.cnblogs.com/hellogiser/p/add-two-numbers-without-arithmetic.html [题目] 写一个函数,求两个整数的之和,要求在函数体内不得使用+.-.×.÷. [分析] 这是一道考察发散思维的很有意思的题目.当我们习以为常的东西被限制使用的时候,如何突破常规去思考,就是解决这个问题的关键所在. 普通四则运算都不能用,那还能用什么啊?我们会想到位运算,因为四则运算本质上都可以通过位运算实现. 举个例子: 首先我们…
传送门 Description Vitya is studying in the third grade. During the last math lesson all the pupils wrote on arithmetic quiz. Vitya is a clever boy, so he managed to finish all the tasks pretty fast and Oksana Fillipovna gave him a new one, that is much…
Back-propagation in a nerual network with a Softmax classifier, which uses the Softmax function: \[\hat y_i=\frac{\exp(o_i)}{\sum_j \exp(o_j)}\] This is used in a loss function of the form: \[\mathcal{L}=-\sum_j{y_j\log \hat y_j}\] where \(o\) is a v…
题目 Source http://vjudge.net/problem/142058 Description Given N integers A1, A2, …. AN, Dexter wants to know how many ways he can choose three numbers such that they are three consecutive terms of an arithmetic progression. Meaning that, how many trip…