- 博客(153)
- 收藏
- 关注
转载 [树状数组][2019徐州网络赛I]query
题目链接:https://nanti.jisuanke.com/t/41391思路:nlogn找出所有合法(i,j),二维偏序查询AC代码:#include<bits/stdc++.h>#define lowbit(x) x&(-x)typedef long long ll;using namespace std;ll n,m;...
2019-09-07 22:29:00
185
转载 [计算几何]Piece of Cake
题目描述Alice received a cake for her birthday! Her cake can be described by a convex polygon with n vertices. No three vertices are collinear.Alice will now choose exactly k random vertices (k≥3) ...
2019-09-05 20:33:00
288
转载 [欧拉降幂][2019南京网络赛B]super_log
题意:输入a,b,p,求(底数a的右上角有b-1个a)思路:广义欧拉定理:AC代码:#include<bits/stdc++.h>typedef long long ll;using namespace std;ll a,b,m;ll vis[1000005];ll prime[1000005],num=0;ll ph...
2019-09-01 22:25:00
176
转载 [数学学习]
数论1.数论分块https://www.cnblogs.com/0xfffe/p/9648943.html由于:1.N/i的取值至多被分成2√n块2.所以,可以在O(√n)时间内算出答案:例题:[AHOI2005]约数研究[CQOI2007]余数求和洛谷P3935 Calculating2.莫比乌斯反演https://www.lu...
2019-08-26 11:08:00
188
转载 [计算几何]The Queen’s Super-circular Patio
题目描述The queen wishes to build a patio paved with of a circular center stone surrounded by circular rings of circular stones. All the stones in a ring will be the same size with the same number ...
2019-08-13 20:32:00
145
转载 [数学、递推]Everything Is Generated In Equal Probability
http://acm.hdu.edu.cn/contests/contest_showproblem.php?pid=1005&cid=849思路:f(i)表示长度为i的随机排列作为参数的返回值期望整理得,则递推可求得f(i),最后答案为:转载于:https://www.cnblogs.com/lllxq/p/11268417.htm...
2019-07-30 10:28:00
165
转载 [构造]triples I
链接:https://ac.nowcoder.com/acm/contest/884/D?&headNav=acm&headNav=acm来源:牛客网题目描述Doctor Elephant is testing his new program: output the bitwise or of the numbers inputed....
2019-07-27 19:10:00
154
转载 2019牛客第三场
FPlanting Trees思路:枚举子矩形上下边,再尺取法+单调队列求合法的最长的宽AC代码:#include<bits/stdc++.h>typedef long long ll;using namespace std; int n,m,a[505][505];int q1[505],q2[505];int maxn[505...
2019-07-26 14:45:00
56
转载 [DP]销售
[提交] [状态] [命题人:admin]题目描述农夫 John 正在筹划从他的谷仓中售出 N 头奶牛,与此同时也有 N 个农夫想要购买奶牛。每个农夫都有刚好足够购买一头奶牛的钱并且将会把买来的这头奶牛用来挤奶。为了减少买来的牛挤不出奶的风险,农夫们每个人都将会购买两头不同的奶牛各自一半的产权,然后将获得每头牛产奶量的一半。如果将两种方案中每个农夫都购买了相同的奶牛看作是相同的销...
2019-07-08 22:13:00
159
转载 [哈夫曼树]猜球球
题目描述六一到了,为了庆祝这个节日,好多商家都推出了很多好玩的小游戏。Tongtong看到了一个猜球球的游戏,有n种除了颜色之外完全相同的球,商家从中拿出来一个球球放到了箱子里,已知第i种颜色的球出现在箱子里的概率为ai。Tongtong可以用下面这种方法来确定箱子中球的颜色:向商家提出猜测:“是第x种颜色的球球或第y种颜色的球球或...........中的一个”,商家会回答你的猜测...
2019-07-06 17:18:00
123
转载 [学习]快速傅里叶变换
快速傅里叶变换用于加速多项式的乘法,复杂度O(nlogn),例题:http://uoj.ac/problem/34详解:https://www.cnblogs.com/RabbitHu/p/FFT.html模板:#include<bits/stdc++.h>#define PI acos(-1.0)using namespace std;str...
2019-07-05 12:24:00
126
转载 [dfs枚举]个性化评测系统
“因材施教”的教育方式自古有之,互联网时代,要实现真正意义上的个性化教育,离不开大数据技术的扶持。VIPKID 英语2020多万学员每月在课前预习、课中教学、课后复习、作业、答题测评等环节会产生超过100100TB 的数据增量,在对庞大数据进行分析之后,个性化评测系统会自动生成针对每个学生的量化学习报告和个性化学习图谱。正在拿着自己的个性化学习图谱总结分析的 ...
2019-06-22 20:54:00
132
转载 [贪心+构造]撑起信息安全“保护伞”
为了给全球小学员打起信息安全“保护伞”,VIPKID 还建立了一套立体化的安全防御体系,7 \times 247×24小时持续安全监控与应急响应等多项联动,具备业界最高级别的数据安全保护标准。值得一提的是,VIPKID 也是行业业内唯一通过 ISO 国际信息安全体系认证、公安部信息安全等级保护三级认证的教育企业。现在安全防御体系就检测到了一个小问题,需要你来帮忙解决其中有关“前...
2019-06-18 17:58:00
118
转载 [线段树]小花梨的数组
题目描述小花梨得到了一个长度为n的数组a,现在要对它进行三种操作:⚫1 l r对所有的i∈[l,r],a[i]=a[i]∗minprime(a[i])⚫2 l r对所有的i∈[l,r],a[i]=a[i]/minprime(a[i])⚫3 x求a[x]的值现在给出初始数组a,对其进行m次操作,对于第三种操作输出结果。输入第一行输入两个正整数n,m,表示数组的长度以及操作...
2019-05-23 19:36:00
105
转载 [SG函数]Little Sub and Johann
题目描述Little Sub and Johann are good friends and they often play games together. Recently, they like playing with stones.They have n piles of stones initially and they should make one of followin...
2019-05-04 15:49:00
184
转载 [单调栈]Max answer
Alice has a magic array. She suggests that the value of a interval is equal to the sum of the values in the interval, multiplied by the smallest value in the interval.Now she is planning to f...
2019-04-21 12:43:00
124
转载 [贪心]T-net
题目描述T-net which is a new telecommunications company, plans to install its base stations in the city. The places where base stations must be installed have been already specified. T-net has two ...
2019-04-11 18:30:00
95
转载 [bfs]调酒壶里的酸奶
题目描述最近小w学了一手调酒的技巧,这么帅的操作,说不定能靠这个俘获女神的芳心,为了在女神面前露一手,他想在学校里建一个"pub",但是显然学校不可能让他真的建一个"pub",那么他退而求次,想建一个"Yogurt shop",不能用酒,那用酸奶也行啊!今天女神终于来光顾小w的酸奶店了!兴奋的小w拿出自己准备已久每天都仔细擦干净的装备——调酒壶、果汁机、隔冰器和计量杯、砧板、小刀...
2019-04-04 16:57:00
88
转载 [dp]Find Symmetries
题目描述Snuke has two boards, each divided into a grid with N rows and N columns. For both of these boards, the square at the i-th row from the top and the j-th column from the left is called Squar...
2019-03-25 12:07:00
129
转载 [矩阵快速幂]Gdut Count
题目描述Farmer John有n头奶牛.某天奶牛想要数一数有多少头奶牛,以一种特殊的方式:第一头奶牛为1号,第二头奶牛为2号,第三头奶牛之后,假如当前奶牛是第n头,那么他的编号就是2倍的第n-2头奶牛的编号加上第n-1头奶牛的编号再加上自己当前的n的三次方为自己的编号.现在Farmer John想知道,第n头奶牛的编号是多少,估计答案会很大,你只要输出答案对于123456789取模...
2019-03-21 17:57:00
78
转载 [dfs剪枝]球队“食物链”
某国的足球联赛中有N支参赛球队,编号从1至N。联赛采用主客场双循环赛制,参赛球队两两之间在双方主场各赛一场。联赛战罢,结果已经尘埃落定。此时,联赛主席突发奇想,希望从中找出一条包含所有球队的“食物链”,来说明联赛的精彩程度。“食物链”为一个1至N的排列{T1T2⋯TN},满足:球队T1战胜过球队T2,球队T2战胜过球队T3,⋯,球队...
2019-03-16 14:18:00
151
转载 [思维]Tree Burning
题目描述Takahashi Lake has a perimeter of L. On the circumference of the lake, there is a residence of the lake's owner, Takahashi. Each point on the circumference of the lake has a coordinate betw...
2019-03-11 12:22:00
124
转载 [位运算]签到题
题目描述作为一道签到题,自然只能包含最基本的算法。本题的任务很简单,给定一个长度为n的序列a,你要将其排序。由于出题人很菜,不会排序算法,他决定自己编一个。他想找到一个数x,使得序列中的所有数字都异或上x后序列恰好按从小到大排列。顺带,这个序列会被进行若干次修改,每次修改后你需要回答当前是否存在一个x满足序列中数字异或上x后按从小到大排列,如果有,请你给出最小的x。输入...
2019-03-11 12:02:00
391
转载 [思维]Colorful Hats
题目描述There are N cats. We number them from 1 through N.Each of the cats wears a hat. Cat i says: "there are exactly ai different colors among the N−1 hats worn by the cats except me."Determine w...
2019-03-09 11:17:00
224
转载 [思维]Ants on a Circle
题目描述There is a circle with a circumference of L. Each point on the circumference has a coordinate value, which represents the arc length from a certain reference point clockwise to the point. O...
2019-03-07 17:16:00
180
转载 [最短路]Open the Lock
题目描述Now an emergent task for you is to open a password lock. The password is consisted of four digits. Each digit is numbered from 1 to 9.Each time, you can add or minus 1 to any digit. When ad...
2019-03-07 17:10:00
261
转载 [优先队列]Mining
题目描述A mining base needs to build some robots to collect at least 10000 units of resource. Each robot will start from the base, reach the diggings in S minutes, work for W minutes, and then take...
2019-02-27 13:04:00
126
转载 [meet in the middle]String Coloring
题目描述You are given a string S of length 2N consisting of lowercase English letters.There are 22Nways to color each character in S red or blue. Among these ways, how many satisfy the following c...
2019-02-12 17:08:00
121
转载 contest 1.25
B.指引排序+贪心+set#include <iostream>#include<cstdio>#include<set>#include<algorithm>using namespace std; struct Node{int x,y;}a[100005],b[100005]; bool...
2019-01-26 14:45:00
152
转载 contest 1.24
A.Missing Runners#include <iostream>#include<cstdio>using namespace std; int vis[60005]; int main(){ int n;scanf("%d",&n); for(int i=1;i<=n-1;i++)...
2019-01-24 20:17:00
105
转载 contest 1.23
A.骰子规律#include <iostream>#include<cstdio>typedef long long ll;using namespace std;ll dp[5][100005],sum[5][100005];ll n,m;void init(){ dp[1][1]=1,dp[1][2]=5,...
2019-01-23 11:18:00
104
转载 contest 1.22
D.菱菱的旅途排序#include <iostream>#include<cstdio>#include<algorithm>typedef long long ll;using namespace std; struct Node{ ll v,id;}node[1000005]; bool c...
2019-01-22 17:37:00
128
转载 contest 1.21
A.Exchange模拟#include <iostream>#include<cstdio>typedef long long ll;using namespace std;int main(){ ll a,b,k;scanf("%lld%lld%lld",&a,&b,&k); ...
2019-01-21 10:48:00
65
转载 contest 1.20
B.矩阵快速幂等比数列二分求和#include <iostream>#include<cstdio>#include<cstring>using namespace std; int n,k,mod;const int MAXN=35;struct Mat{ int n,m; int ma...
2019-01-20 14:36:00
73
转载 contest 1.19
A.Little Sub and Pascal's Triangle求杨辉三角形第n行(n=0,1,...)的奇数个数规律:#include <iostream>#include<cstdio>#include<cstring>#include<cmath>#include<algorithm&...
2019-01-19 13:40:00
63
转载 contest 1.18
D.装饰列方程#include <iostream>#include<cstdio>#include<algorithm>typedef long long ll;using namespace std; ll a[5]; int main(){ int t;scanf("%d",&...
2019-01-18 12:03:00
90
转载 contest 1.17
C.最大公约数II分解因子+欧拉函数#include <iostream>#include<cstdio>#include<cmath>#include<cstring>#include<algorithm>typedef long long ll;using namespace std;...
2019-01-17 10:29:00
141
转载 contest 1.16
B.和数检测离散化#include <iostream>#include<cstdio>#include<cstring>#include<algorithm>typedef long long ll;using namespace std; ll a[1000005],b[1000005];...
2019-01-16 11:03:00
64
转载 contest 1.15
A.小迟的比赛最优策略永远是努力应战,dp[i][j]表示前i轮赢了j局的概率,dp[i][j]=dp[i-1][j]*(1-p[i][j])+dp[i-1][j-1]*p[i-1][j-1]#include <iostream>#include<cstdio>#include<cstring>#include<cma...
2019-01-15 11:22:00
81
转载 contest 1.14
B.数论number欧拉降幂定理#include <iostream>#include<cstdio>#include<cmath>#include<algorithm>typedef long long ll;using namespace std; ll a,b,c,p; ll qpo...
2019-01-14 21:25:00
72
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人