The heat during the last few days has been really intense. Scientists from all over the Berland study how the temperatures and weather change, and they claim that this summer is abnormally hot. But any scientific claim sounds a lot more reasonable if…
今日兴趣新闻: NASA 研制最强推进器,加速度可达每秒 40 公里,飞火星全靠它 链接:https://mbd.baidu.com/newspage/data/landingsuper?context=%7B"nid"%3A"news_11707429683828231737"%7D&n_type=0&p_from=1 ------------------------------------------------题目---------------…
The heat during the last few days has been really intense. Scientists from all over the Berland study how the temperatures and weather change, and they claim that this summer is abnormally hot. But any scientific claim sounds a lot more reasonable if…
Content 给定一个长度为 \(n\) 的数列,求数列中所有长度 \(\geqslant k\) 的区间的最大平均值. 数据范围:\(1\leqslant k,n,a_i\leqslant 5000\). Solution 我们通过预处理前缀和之后,再直接暴力枚举所有长度 \(\geqslant k\) 的区间的平均值,取其最大值即可. Code int k, n, a[5007], s[5007]; double ans; int main() { //This program is wr…
想把最近几年的NOIP T4都先干掉,就大概差16年的,所以来做一做. 然后这题就浪费了我一整天QAQ...果然还是自己太弱了QAQ 点我看题 还是pa洛谷的... 题意:给m个物品,每个物品有一个不超过n的数xi. 如果存在四元组 (a,b,c,d)满足 ①        xa<xb<xc<xd ② xb-xa=2(xd-xc) ③       xb-xa<(xc-xb)/3 辣么这个四元组是有效的,问每个物品分别作为有效四元组中 a,b,c,d 几次 思路:16年是第一次参加的…
B. Nikita and string time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output One day Nikita found the string containing letters "a" and "b" only. Nikita thinks that string is beauti…
题目描述 Apojacsleam喜欢数组. 他现在有一个n个元素的数组a,而他要对a[L]-a[R]进行M次操作: 操作一:将a[L]-a[R]内的元素都加上P 操作二:将a[L]-a[R]内的元素都减去P   最后询问a[l]-a[r]内的元素之和?     请认真看题干及输入描述. 输入描述: 输入共M+3行:第一行两个数,n,M,意义如“题目描述”第二行n个数,描述数组.第3-M+2行,共M行,每行四个数,q,L,R,P,若q为1则表示执行操作2,否则为执行操作1第4行,两个正整数l,r…
A. Saitama Destroys Hotel time limit per test:1 second memory limit per test:256 megabytes input:standard input output:standard output Saitama accidentally destroyed a hotel again. To repay the hotel company, Genos has volunteered to operate an eleva…
题目链接:https://www.lydsy.com/JudgeOnline/problem.php?id=2818 题意:给定整数N,求1<=x,y<=n且Gcd(x,y)为素数的数对(x,y)有多少对 思路:先筛出n以内所有的素数顺便筛出欧拉函数,\(gcd(x,y)=k\)等价于\(gcd(\frac{x}{k},\frac{y}{k})=1\) 所以这个问题可以转化为求\(ans=\sum_{i=1}^{tot}\sum_{j=1}^{n/prime[i]}phi[j]\) ,tot为…
D. Array GCD 题目连接: http://codeforces.com/contest/624/problem/D Description You are given array ai of length n. You may consecutively apply two operations to this array: remove some subsegment (continuous subsequence) of length m < n and pay for it m·…