
离散化
文章平均质量分 80
做不完的ACM
加油,努力
展开
-
HDU 5925
#include #include #include using namespace __gnu_pbds;using namespace std;#define SZ(X) ((int)X.size())#define mp make_pair#define pb push_back#define RALL(X) X.rbegin(),X.rend()#d原创 2018-01-26 23:44:57 · 314 阅读 · 0 评论 -
POJ2528 线段树离散化
题意:在墙上贴海报,海报可以互相覆盖,问最后可以看见几张海报思路:这题数据范围很大,直接搞超时+超内存,需要离散化:离散化简单的来说就是只取我们需要的值来用,比如说区间[1000,2000],[1990,2012]我们用不到[-∞,999][1001,1989][1991,1999][2001,2011][2013,+∞]这些值,所以我只需要1000,1990,2000,2012就够了原创 2018-01-20 22:29:31 · 190 阅读 · 0 评论 -
Codeforces 915E 线段树动态开点
#include namespace fastIO { #define BUF_SIZE 10000000 //fread -> read bool IOerror = 0; inline char nc() { static char buf[BUF_SIZE], *p1 = buf + BUF_SIZE, *pend = buf + BUF_原创 2018-01-20 22:30:34 · 328 阅读 · 0 评论 -
第12届中南校赛 E(树状数组离散化,菱形查询)
题目链接:http://acm.csu.edu.cn/csuoj/problemset/problem?pid=2083【E:EZ's binoculars】题意: 给你一些点(N<1e5),然后其实是每次询问给你一个中心在( x , y )的四边相等的菱形,对角线长为d,求问多少点在菱形里。官方题解: 首先可以想到二维树状数组维护。但是显然内...原创 2018-04-24 10:16:28 · 152 阅读 · 0 评论 -
CCCP_2016四省 HDU5925
#include <bits/stdc++.h>using namespace std;using ll = long long ;const int dirx[] = {0, 0, 1, -1};const int diry[] = {1, -1, 0, 0};const int maxn = 207;bool vis[maxn*3][maxn*3]; //离散化后是图...原创 2018-04-24 20:55:33 · 167 阅读 · 0 评论