hdu5023--A Corrupt Mayor's Performance Art】的更多相关文章

A Corrupt Mayor's Performance Art Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 100000/100000 K (Java/Others)Total Submission(s): 33    Accepted Submission(s): 11 Problem Description Corrupt governors always find ways to get dirty money. Pa…
http://acm.hdu.edu.cn/showproblem.php?pid=5023 Problem Description Corrupt governors always find ways to get dirty money. Paint something, then sell the worthless painting at a high price to someone who wants to bribe him/her on an auction, this seem…
A Corrupt Mayor's Performance Art Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 100000/100000 K (Java/Others) Problem Description Corrupt governors always find ways to get dirty money. Paint something, then sell the worthless painting at a…
A Corrupt Mayor's Performance Art Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 100000/100000 K (Java/Others) Total Submission(s): 1905    Accepted Submission(s): 668 Problem Description Corrupt governors always find ways to get dirty money…
Corrupt governors always find ways to get dirty money. Paint something, then sell the worthless painting at a high price to someone who wants to bribe him/her on an auction, this seemed a safe way for mayor X to make money. Because a lot of people pr…
Problem Description Corrupt governors always find ways to get dirty money. Paint something, then sell the worthless painting at a high price to someone who wants to bribe him/her on an auction, this seemed a safe way for mayor X to make money. Becaus…
Link:  http://acm.hdu.edu.cn/showproblem.php?pid=5023 #include <cstdio> #include <cstring> #include <iostream> #include <algorithm> #include <vector> #include <string> #include <cmath> using namespace std; typedef…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5023 解题报告:一面墙长度为n,有N个单元,每个单元编号从1到n,墙的初始的颜色是2,一共有30种颜色,有两种操作: P a b c  把区间a到b涂成c颜色 Q a b 查询区间a到b的颜色 线段树区间更新,每个节点保存的信息有,存储颜色的c,30种颜色可以压缩到一个int型里面存储,然后还有一个tot,表示这个区间一共有多少种颜色. 对于P操作,依次往下寻找,找要更新的区间,找到要更新的区间之前…
题意:给定一个1-n的墙,然后有两种操作,一种是P l ,r, a 把l-r的墙都染成a这种颜色,另一种是 Q l, r 表示,输出 l-r 区间内的颜色. 析:应该是一个线段树+状态压缩,但是我用set暴力过去了.用线段树+状态压缩,区间更新,很简单,就不说了. 代码如下: #pragma comment(linker, "/STACK:1024000000,1024000000") #include <cstdio> #include <string> #i…
#include<iostream> #include<cstring> #include<cstdio> #include<algorithm> #define N 1000005 using namespace std; ]; ];//正值表示该节点所管理的区间的颜色是纯色,-1表示的是非纯色 int n, m; void buildT(int ld, int rd, int p){ if(ld <= rd){ tree[p] = ;//初始每一个…