题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4930 Fighting the Landlords Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others) Total Submission(s): 312 Accepted Submission(s): 100 Problem Description Fighting the…
Time Limit: 5000MS Memory Limit: 65536KB 64bit IO Format: %I64d & %I64u Description Give you a sequence of N(N \leq 100, 000) integers : a_{1},...,a_{n}(0 < a_{i} \leq 1000, 000, 000). There are Q (Q \leq 100, 000) queries. For each query l,…
Hiking Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 97 Accepted Submission(s): 56 Special Judge Problem Description There are n soda conveniently labeled by 1,2,-,n. beta, their best fr…
Typesetting Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 144 Accepted Submission(s): 72 Problem Description Yellowstar is writing an article that contains N words and 1 picture, and the i-…
Problem Description Yellowstar is writing an article that contains N words and 1 picture, and the i-th word contains ai characters. The page width is fixed to W characters. In order to make the article look more beautiful, Yellowstar has made some ru…
/** 题目:Color 链接:https://oj.ejq.me/problem/23 题意:给定一颗树,将树上的点最多染成m种颜色,有些节点不可以染成某些颜色.相邻节点颜色不同.求染色方法数. 思路:树形dp,定义dp[i][j]表示以i为根,i节点染色为j时候的子树的染色方法数. */ #include<bits/stdc++.h> #define LL long long using namespace std; typedef long long ll; ; ll dp[maxn][…
D. Events 线段树区间更新查询区间历史最小值,看似很简单的题意写了两天才写出来. 题意:n个数,Q次操作,每次操作对一个区间[l,r]的数同时加上C,然后输出这段区间的历史最小值. 思路:在线段树区间更新最值查询的基础上再用一个变量表示历史最小值,每次更新只需对当前最小值更新然后用当前最小值更新历史最小值.细节问题很不好处理,可能会有重复多次更新某个区间但是其下的子节点叶节点却没有更新,而是每次重复叠加了一个add值,这样就可能将最小值覆盖.所以我们在pushdown操作的时候应该注意如…
FFF at Valentine Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1060 Accepted Submission(s): 506 Problem Description At Valentine's eve, Shylock and Lucar were enjoying their time as any oth…
Dying Light Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 513 Accepted Submission(s): 122 Problem Description LsF is visiting a local amusement park with his friends, and a mirror room su…
CSGO Time Limit: 20000/10000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 127 Accepted Submission(s): 20 Problem Description Senior Pan is crazy about CSGO and she is so skilled. She can kill every enemy she sp…
Ch’s gift Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1354 Accepted Submission(s): 496 Problem Description Mr. Cui is working off-campus and he misses his girl friend very much. After a w…
Big binary tree Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 597 Accepted Submission(s): 207 Problem Description You are given a complete binary tree with n nodes. The root node is numbere…
Balala Power! Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 2668 Accepted Submission(s): 562 Problem Description Sample Input 1 a 2 aa bb 3 a ba abc Sample Output Case #1: 25 Case #2: 132…