离散化
newhonor
可以不伟大,但不能卑微
展开
-
Keen On Everything But Triangle
http://acm.hdu.edu.cn/showproblem.php?pid=6601 #include <iostream> #include <cstring> #include <queue> #include <vector> #include <algorithm> #include <cstdio> #...原创 2019-10-17 11:46:57 · 101 阅读 · 0 评论 -
Massive
https://ac.nowcoder.com/acm/contest/700/C 题意:n个数,连续区间长度在[L,R]之间的和大于等于s的个数; 思路:前缀和离散化加树状数组;枚举起点同时更新数组数组的值(前缀和的值);每次差值的因为要满足sum[j]-sum[i-1]>=s; 所以每次找的sum[j]>=sum[i-1]+s; 反思:题解都看到老半天~,离散化也不记得了,...原创 2019-05-02 10:18:34 · 211 阅读 · 0 评论 -
Chika and Friendly Pairs
http://acm.hdu.edu.cn/showproblem.php?pid=6534 题意:给n个数的数组,m个询问L-R,k;问区间内差值不超过k的数有多少对; 思路:离散化,莫队+树状数组维护; 反思:树状数组维护每次指针移动贡献的变化。离散化没学好,离散化就是把数的相对位置处理出来,再操作。把一个离散化了的数减一个没离散的=-=。因为维护时查询R和L-1;所以还要离散化每个元素...原创 2019-05-20 19:08:55 · 607 阅读 · 0 评论 -
小石的妹子
https://ac.nowcoder.com/acm/contest/949/F 总结:虽然以前做过排序一维,另一维线段树维护,但做的少,难出思路; #include<bits/stdc++.h> using namespace std; #define sfi(i) scanf("%d",&i) #define sfs(i) scanf("%s",(i)) ...原创 2019-07-13 10:51:06 · 287 阅读 · 0 评论 -
Pizza Cutter Gym - 101908C
https://cn.vjudge.net/problem/Gym-101908C 思路:离散加逆序对; #include <iostream> #include <cstring> #include <queue> #include <vector> #include <algorithm> #include <cs...原创 2019-08-22 16:10:12 · 140 阅读 · 0 评论 -
The Preliminary Contest for ICPC Asia Xuzhou 2019so easy
https://nanti.jisuanke.com/t/41384 思路:离散化,线段树,要么自己本身,要么就是区间去掉得下一个; #include <bits/stdc++.h> #include <tr1/unordered_map> #define endl '\n' #define FAST_IO ios::sync_with_stdio(false);c...原创 2019-09-07 22:20:19 · 106 阅读 · 0 评论 -
Bishops Alliance Gym - 101147F
https://cn.vjudge.net/problem/Gym-101147F i-j>=pi^2+pj^2+C => i-pi^2>=j+pj^2+C-1; 最长上升子序列,树状数组维护; #include <iostream> #include <cstring> #include <queue> #include...原创 2019-09-22 16:09:20 · 129 阅读 · 0 评论