Mr Potato is the BestCoder. One night, an amazing sequence appeared in his dream. Length of this sequence is odd, the median number is M, and he named this sequence as Bestcoder Sequence. As the ...
Mr Potato is the BestCoder. One night, an amazing sequence appeared in his dream. Length of this sequence is odd, the median number is M, and he named this sequence as Bestcoder Sequence. As the ...
hdu5615-Jam’s math problem 枚举a的因子p和q,c的因子k和m,只需要到sqrt(a)和sqrt(c),然后计算一下qk+mp或者qm+kp是否和b相等。hdu5616-Jam’s balance 01背包,先计算一遍正常的01背包,即只考虑砝码放在右边...
题目链接:BestCoder Round #81 (div.2) 1003 String题意 中文题,上有链接, 就不贴了。 思路 枚举起点i,计算可以达到k个不同 字母的最小下标j,则此时有子串len-j个。 将所有起点的值加起来即是结果。 代码#...
HDU 5672 String(尺取法)——BestCoder Round #81(div.1 div.2)
BC div2
BestCoder Round #88A. 5907 Find Q B. 5908 Abelian Period C. 5909 Tree Cutting D. 5910 Advanced Traffic System
题意: 给一个序列,3种操作,一个区间全部赋值为xxx,一个区间内的每个aiaia_i 变成 phi(ai)phi(ai)phi(a_i),询问一个区间的和 ...怎么说呢,这种每个数变成他的 phi()phi()phi() , 开根什么的,一般来说都是...
GCD is Funny Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 250 Accepted Submission(s): 50 Problem Description Alex has invente
zhx's submissions Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 858 Accepted Submission(s): 233 Problem Description As one o
以下吐槽时间请无视:woc你TM再给我两分钟!!再给我两分钟!!我就可以A了T4了。。。赛后交oj真的是1A啊。。。... 题意:已知一个字符串相邻两个后缀(指下标相邻)的最长共同前缀,求可行的字符串个数。
A problem of sorting Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) 问题描述 给出一张许多人的年龄和生日表。...第一行包含一个正整数T(T \leq 5)T(T≤5
计数排序 +高精度加法不太擅长这种题做个标记#include #include #include #include #include #include #include #include #include #include #include<cs
BestCoder Round #65 HDU 5590 - 5594 通过数:2 1001: 水题,一个个判断即可。#include #include #include #include #include #include #include using
bestcoder 63#
Problem Description The military parade will last for n days. There is a aerobatic flight shows everyday during the parade. On the ith day , Pi pilots are required. But the pilots are not willing to ...
这次BC大家好像都比较反感,哎,其实没必要计较太多的,小渣个人觉得还好,过了两题,所以写下博客,总结一下,以免到时候忘了1001.Fxx and string题目意思非常简单,就是给个字符串找出三个下标满足等比数列的字符...
链接:戳这里 Bellovin Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) ...Peter has a sequence a1,a2,...,an and he define a function o
LCIS的模板来着的,时间复杂度是O(n),比较简单,直接设f,g分别为a和b以i结尾的lis长度,转移怎么暴力怎么来。。亏我以前还天天log求lis之后辛辛苦苦再求lcs。。。。#include #include #include ...
N bulbs 我们注意到总的操作次数是跟nn奇偶的。这个很重要,也就是如果11的数量和nn不同奇偶,那么一定无解。 那么现在问题是11和nn同奇偶的情况下,是不是一定有解?...因为11和nn同奇偶,所以00的个数是偶数,...
Gunner Accepts: 391 Submissions: 1397 Time Limit: 8000/4000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) 问题描述 很久很久以前,有一个叫Jack的枪手。...第i 只鸟站在第
题目链接:点击打开链接 1001-Find Q Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/131072 K (Java/Others) ...Total Submission(s): 342 Accepted Submission(s): 190 ...
利用第一个单减函数和第二个单增函数的性质 从头到尾扫一遍设立一个维护此时最大最小值之间可以用的变量一次次累乘就行了#include #include #define LL long long #define mod 998244353 using namespace std;...
第一个,尺取法的简单题,但是就是一开始想用阶乘的,但是想了想,怕爆long long 然后就放弃了#include #include #include using namespace std; const int MaxN = 1e5 + 10;char a[MaxN];int main() ...
题意:t组数据,每组数据给个m,问m最少能由几项形如3*n*(n-1)+1的数表示 eg 7=1(n=1)+1(n=1)+1(n=1)+1(n=1)+1(n=1)+1(n=1)+1(n=1); 7=7(n=2); 所以7最少能由1个数表示 ...分析:3*n*(n-1)+1可以转换为6*(n*(n-...
第一次打bestcoder,发挥的不是一般烂,下了个
模拟+Trie+桶排(归并?)+容斥 A 模(shou)拟(su)题= =感觉好像见... 1 //BestCoder #44 A 2 #include<vector> 3 #include<cstdio> 4 #include<cstring> 5 #include<cstdlib&g...
HDU 5427 A problem of sorting(字符串处理+排序)——BestCoder Round #54(div.2)
Primes Problem Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 817 Accepted Submission(s): 382 Problem Description ...Given a numbe
BC的幕后
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5104 #include using namespace std; const int N=10005; int prime[N]={0}; bool notPrime[N]; int len=0; int dp[N*3]={0};...void get_p