
ACM_数学
DATELOST
I'm curious.
展开
-
P2261 [CQOI2007]余数求和 --- 整除分块
题目a%b = a - b * ⌊a / b⌋O(√n)求 ∑ ⌊n / i⌋求 ∑ i*⌊n / i⌋,只用多乘个 (l+r)/2#include<bits/stdc++.h>using namespace std;typedef long long ll;int main(){ ll n,k; cin>>n>>k; ll ans=n*k;...原创 2020-01-10 21:20:12 · 139 阅读 · 0 评论 -
HDU-3400 三分套三分
Problem DescriptionIn a two-dimensional plane there are two line belts, there are two segments AB and CD, lxhgww’s speed on AB is P and on CD is Q, he can move with the speed R on other area on the p...原创 2019-10-07 23:18:29 · 174 阅读 · 0 评论 -
cf-650A unordered_map
A. Watchmentime limit per test 3 secondsmemory limit per test 256 megabytesinputstandard inputoutputstandard outputWatchmen are in a danger and Doctor Manhattan together with his friend Daniel Dr...原创 2019-10-02 16:55:35 · 180 阅读 · 0 评论 -
CF 670C 离散化
C. CinemaMoscow is hosting a major international conference, which is attended by n scientists from different countries. Each of the scientists knows exactly one language. For convenience, we enumera...原创 2019-05-29 23:33:48 · 435 阅读 · 0 评论 -
UVA-12879 FFT
题目Problem Description:Do you like golf? I hate it. I hate golf so much that Idecided to build the ultimate golf robot, a robot thatwill never miss a shot. I simply place it over the ball,choose t...原创 2019-05-20 12:39:02 · 263 阅读 · 0 评论 -
HDU-1402 FFT
Problem DescriptionCalculate A * B.InputEach line will contain two integers A and B. Process to end of file.Note: the length of each integer will not exceed 50000.OutputFor each case, output A *...原创 2019-05-19 22:41:10 · 135 阅读 · 0 评论 -
HDU-3949 线性基Kth
Problem DescriptionXOR is a kind of bit operator, we define that as follow: for two binary base number A and B, let C=A XOR B, then for each bit of C, we can get its value by check the digit of corre...原创 2019-04-30 22:32:09 · 228 阅读 · 0 评论 -
牛客寒假1 补题
链接:https://ac.nowcoder.com/acm/contest/317/C来源:牛客网题目描述小a正在玩一款星际探索游戏,小a需要驾驶着飞船从1号星球出发前往n号星球。其中每个星球有一个能量指数p。星球i能到达星球j当且仅当pi>pj。同时小a的飞船还有一个耐久度t,初始时为1号点的能量指数,若小a前往星球j,那么飞船的耐久度会变为t⊕pj(即t异或pj,关于其...原创 2019-04-29 22:13:44 · 349 阅读 · 3 评论 -
HDU-6460 矩阵快速幂 含幂项 二项展开
Problem DescriptionFarmer John有n头奶牛.某天奶牛想要数一数有多少头奶牛,以一种特殊的方式:第一头奶牛为1号,第二头奶牛为2号,第三头奶牛之后,假如当前奶牛是第n头,那么他的编号就是2倍的第n-2头奶牛的编号加上第n-1头奶牛的编号再加上自己当前的n的三次方为自己的编号.现在Farmer John想知道,第n头奶牛的编号是多少,估计答案会很大,你只要输出答案对...原创 2019-03-17 13:54:13 · 632 阅读 · 0 评论 -
矩阵快速幂 斐波那契数列
Description小G下定决心要帮助摆脱家乡贫困,为此,他决定利用家乡得天独厚的地理条件大力发展养殖业。经过慎重的思考,他决定选择养殖一种繁殖速度很快的小精灵。因为启动资金不足,小G只购买了一只小精灵幼崽,小精灵需要一天的时间成长为成年体,此后,每天都能产下一只新的小精灵幼崽。那么,第一天有1只小精灵,第二天有1一只小精灵,第三天有2只,第四天有3只,第五天有5只,第六天有8只……按照...原创 2019-03-15 21:35:21 · 441 阅读 · 0 评论 -
二维hash
DescriptionDDF从旧书店淘到一副好画,他想鉴别这幅画是不是失传的大师的真迹。我们可以把这幅画抽象为N行M列的01矩阵(0代表该点没有墨水,1代表该点有墨水)。鉴别方法是这样的:根据专家的研究我们得知这幅画有多处细节,当我们能在原画上找到这些细节则这幅画是真的,否则肯定为赝品。具体来说我们得知多个A行B列的细节01矩阵,如果这些细节01矩阵都能在原01矩阵找到对应的子矩阵,那么输出...原创 2019-03-08 22:51:56 · 437 阅读 · 0 评论 -
HDU-1715 大数 矩阵快速幂
Problem DescriptionFibonacci数列,定义如下:f(1)=f(2)=1f(n)=f(n-1)+f(n-2) n&gt;=3计算第n项Fibonacci数值。Input输入第一行为一个整数N,接下来N行为整数Pi(1&lt;=Pi&lt;=1000)Output输出为N行,每行为对应的f(Pi)。Sample Input512345Sampl...原创 2019-03-02 12:28:44 · 207 阅读 · 0 评论 -
HDU-1061 快速幂求模||打表
Problem DescriptionGiven a positive integer N, you should output the most right digit of N^N.InputThe input contains several test cases. The first line of the input is a single integer T which is t...原创 2019-03-01 11:10:01 · 106 阅读 · 0 评论 -
HDU-1724 Simpson公式
Problem DescriptionMath is important!! Many students failed in 2+2’s mathematical test, so let’s AC this problem to mourn for our lost youth…Look this sample picture:A ellipses in the plane and ce...原创 2019-02-23 18:48:13 · 224 阅读 · 0 评论