摘要: 分析: 题目告诉了我们一种规则由a数组变成b数组。如 A={5,1,4,2,3} ,k=2; 当我们求bi时,先到a数组找i=aj;看a1-aj中有几个数是满足ax<=i+k的,满足的数的个数即为bi的值。 求b1时,先找到1在a数组中得位置,得到1左边的数 5;有5>=1+2;所以b1=1; 求b 阅读全文
posted @ 2020-02-17 22:35 Dazzling! 阅读(164) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <algorithm> #include <cstdio> using namespace std; const int N = 500010; typedef long long ll; struct node { int to, nex; 阅读全文
posted @ 2020-02-17 21:48 Dazzling! 阅读(204) 评论(0) 推荐(0) 编辑