当前位置: 首页 > news >正文

高州市荷花镇网站建设网页设计与制作教程的页数是

高州市荷花镇网站建设,网页设计与制作教程的页数是,网站建设公司的公众号,黄骅港邮编号是多少CF1692G 2^Sort 题解题目链接字面描述题面翻译题目描述输入格式输出格式样例 #1样例输入 #1样例输出 #1提示思路代码实现题目 链接 https://www.luogu.com.cn/problem/CF1692G 字面描述 题面翻译 给你一个长度为 n(∑n2⋅105)n \ (\sum n 2\cdot 10^5)n (∑n… CF1692G 2^Sort 题解题目链接字面描述题面翻译题目描述输入格式输出格式样例 #1样例输入 #1样例输出 #1提示思路代码实现题目 链接 https://www.luogu.com.cn/problem/CF1692G 字面描述 题面翻译 给你一个长度为 n(∑n2⋅105)n \ (\sum n 2\cdot 10^5)n (∑n2⋅105) 的数组 aaa问你在这个数组中有多少个长度为 k1(1≤kn)k 1 \ (1\le k n)k1 (1≤kn) 的区间符合以下的条件 20⋅ai21⋅ai122⋅ai2⁣⋯2k⋅aik注i为这个区间开始的位置2^0 \cdot a_i 2^1 \cdot a_{i 1} 2^2 \cdot a_{i 2} \dotsi 2^k \cdot a_{i k}\\ \footnotesize{注i 为这个区间开始的位置} 20⋅ai​21⋅ai1​22⋅ai2​⋯2k⋅aik​注i为这个区间开始的位置 由tzyt翻译 题目描述 Given an array $ a $ of length $ n $ and an integer $ k $ , find the number of indices $ 1 \leq i \leq n - k $ such that the subarray $ [a_i, \dots, a_{ik}] $ with length $ k1 $ (not with length $ k $ ) has the following property: If you multiply the first element by $ 2^0 $ , the second element by $ 2^1 $ , …, and the ( $ k1 $ )-st element by $ 2^k $ , then this subarray is sorted in strictly increasing order. More formally, count the number of indices $ 1 \leq i \leq n - k $ such that $ $KaTeX parse error: Cant use function $ in math mode at position 84: …\cdot a_{ik}. $̲ $ 输入格式 The first line contains an integer $ t $ ( $ 1 \leq t \leq 1000 $ ) — the number of test cases. The first line of each test case contains two integers $ n $ , $ k $ ( $ 3 \leq n \leq 2 \cdot 10^5 $ , $ 1 \leq k n $ ) — the length of the array and the number of inequalities. The second line of each test case contains $ n $ integers $ a_1, a_2, \dots, a_n $ ( $ 1 \leq a_i \leq 10^9 $ ) — the elements of the array. The sum of $ n $ across all test cases does not exceed $ 2 \cdot 10^5 $ . 输出格式 For each test case, output a single integer — the number of indices satisfying the condition in the statement. 样例 #1 样例输入 #1 6 4 2 20 22 19 84 5 1 9 5 3 2 1 5 2 9 5 3 2 1 7 2 22 12 16 4 3 22 12 7 3 22 12 16 4 3 22 12 9 3 3 9 12 3 9 12 3 9 12样例输出 #1 2 3 2 3 1 0提示 In the first test case, both subarrays satisfy the condition: $ i1 $ : the subarray $ [a_1,a_2,a_3] [20,22,19] $ , and $ 1 \cdot 20 2 \cdot 22 4 \cdot 19 $ .$ i2 $ : the subarray $ [a_2,a_3,a_4] [22,19,84] $ , and $ 1 \cdot 22 2 \cdot 19 4 \cdot 84 $ . In the second test case, three subarrays satisfy the condition: - $ i1 $ : the subarray $ [a_1,a_2] [9,5] $ , and $ 1 \cdot 9 2 \cdot 5 $ . $ i2 $ : the subarray $ [a_2,a_3] [5,3] $ , and $ 1 \cdot 5 2 \cdot 3 $ .$ i3 $ : the subarray $ [a_3,a_4] [3,2] $ , and $ 1 \cdot 3 2 \cdot 2 $ .$ i4 $ : the subarray $ [a_4,a_5] [2,1] $ , but $ 1 \cdot 2 2 \cdot 1 $ , so this subarray doesn’t satisfy the condition. 思路 对原数组进行模拟下标x(2n)x(2~n)x(2 n) 根据题目 若ax−12⋅axa_{x-1}2\cdot a_xax−1​2⋅ax​ ∴fx1\therefore f_x1∴fx​1 否则,fx0f_x0fx​0 对f数组f数组f数组进行前缀和预处理就可以实现O(n)\Omicron(n)O(n)时间复杂度的统计了。 代码实现 #includebits/stdc.h using namespace std;const int maxn2e510; int t,n,k,ans; int a[maxn],f[maxn]; int main(){scanf(%d,t);while(t--){scanf(%d%d,n,k);int op0;ans0;memset(a,0,sizeof(a));for(int i1;in;i){int x;scanf(%d,x);if(2*xop)a[i]1;opx;}for(int i1;in;i){f[i]f[i-1]a[i];if(i-k-10)continue;if(f[i]-f[i-k]k)ans;}printf(%d\n,ans);}return 0; }
http://www.hkea.cn/news/14434348/

相关文章:

  • 自适应网站设计稿在网站上怎么做招聘信息
  • 广东建设基金管理有限公司网站棠下手机网站建设电话
  • 网上做室内设计的网站书店中文网站模板
  • 做网站素材图片如何编写一套网站模板
  • 网站主题颜色企业文化的重要性
  • 做网站 注意企业网站制作费用
  • 成全视频免费观看在线看电视剧下载长沙seo袁飞
  • 查网站备案名称wordpress无法编辑器
  • 网站建设分几个阶段网站建设这个职业是什么
  • 南京做网站的公司排名网站开发需要用到哪些资料
  • 网站怎么防止黑客攻击手机商城手机网站建设多少钱
  • 网站建设企业咨询过年做啥网站致富
  • 企业网站建设的可行性分析泰安新泰房产网
  • 项目建设网站新手如何学会做网络销售
  • 网站文字配色北京seo招聘
  • wordpress网站打开卡广告公司手机网站建设
  • 建设金融网站WordPress的分類顯示插件
  • 网站建设公司网站模板下载最新小组排名
  • 主机开通成功网站正在建设中嵌入式培训报告
  • 种子网站开发杭州品牌网站设计
  • 北辰网站建设公司太原网站制作企业网站在线留言
  • 如何用自己电脑做网站服务器吗网络工程好就业吗
  • 石家庄网站制作方案免费 成品模板网站
  • 上海网络平台网站建设怎样做网站赚钱
  • 上海网站建设联系电翻墙在线代理
  • 贸易公司网站建设方案东莞网站建设报价方案
  • 网站后台新闻不显示如何刷新织梦制作手机网站模板免费下载
  • 重庆网站开发企业广东省建设监理协会网站 - 首页
  • 响应式网站跟一般网站的区别加工平台制作
  • 单页网站制作程序南宁网站建设兼职