Description Edward has established a company with n staffs. He is such a kind man that he did Q times salary increasing for his staffs. Each salary increasing was described by three integers (l, r, c). That means Edward will add c units money for the…
题目 注意题目中的,引用绝望的乐园中的进一步解释如下: 这是一道浙大月赛的题,一如既往的坑爹,好好一道水题,被搞成一道坑题!!! //注意:r(i) < l(i+1) !细节啊细节! #include<stdio.h> #include<string.h> #include<iostream> #include<algorithm> using namespace std; ];//这里必须是long long,不然还是wa int main() {…
OJ Problem Set - 3745 Salary Increasing Time Limit: 2 Seconds      Memory Limit: 65536 KB Edward has established a company with n staffs. He is such a kind man that he did Q times salary increasing for his staffs. Each salary increasing was described…
D. Ability To Convert time limit per test 1 second Cmemory limit per test 256 megabytes input standard input output standard output Alexander is learning how to convert numbers from the decimal system to any other, however, he doesn't know English le…
主要还是细节分析:线段树作为工具 Description 我们常常会说这样的话:“X年是自Y年以来降雨量最多的”.它的含义是X年的降雨量不超过Y年,且对于任意Y<Z<X,Z年的降雨量严格小于X年.例如2002,2003,2004和2005年的降雨量分别为4920,5901,2832和3890,则可以说“2005年是自2003年以来最多的”,但不能说“2005年是自2002年以来最多的”由于有些年份的降雨量未知,有的说法是可能正确也可以不正确的. Input 输入仅一行包含一个正整数n,为已知的…
 A - 无耻的出题人 Time Limit: 2000/1000 MS (Java/Others)      Memory Limit: 65536/32768 KB (Java/Others)  Submit Status Problem Description 听到X神要參加比赛,仅仅会Fibnacci数的出题人被吓得哭晕在厕所.为了防止X神AK(ALL KILL)比赛题目,无耻的出题人仅仅好在题面上做些手脚(加密).当中一道题的题目描写叙述例如以下: hjxh dwh v vxxpd…
第一次做交互真有趣……:挺好的细节思维题 This is an interactive problem. In good old times dwarves tried to develop extrasensory abilities: Exactly n dwarves entered completely dark cave. Each dwarf received a hat — white or black. While in cave, none of the dwarves was…
题目描述 我们常常会说这样的话:"X年是自Y年以来降雨量最多的".它的含义是X年的降雨量不超过Y年,且对于任意\(Y<Z<X\),Z年的降雨量严格小于X年.例如2002,2003,2004和2005年的降雨量分别为4920,5901,2832和3890,则可以说"2005年是自2003年以来最多的",但不能说"2005年是自2002年以来最多的"由于有些年份的降雨量未知,有的说法是可能正确也可以不正确的. 输入输出格式 输入格式: 输…
Codeforces 题目传送门 & 洛谷题目传送门 u1s1 感觉此题思维难度不太大,不过大概是细节多得到了精神污染的地步所以才放到 D1E 的罢((( 首先我们对所有 \(a_i,b_i\) 分解质因数并将它们全部质因子拎出来编个号 \(1,2,3,\cdots,m\)--这样的质因子个数肯定不会超过 \(2n\omega(a_i)\).我们记 \(ap_{i,j}\) 表示 \(a_i\) 中标号为 \(j\) 的质因子出现的次数,\(bp_{i,j}\) 表示 \(b_i\) 中标号为…
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=5374 思路:题目的意思是求树上的两点,使得树上其余的点到其中一个点的最长距离最小.可以想到这题与树直径有关,我们可以这样做,首先求出树的直径,然后取出树的中点以及与该中点相邻,并且是直径上的一个点,这样就把这棵树划分为两颗子树,然后分别求出这两棵树的直径,最后要选择的两个点分别就是这两棵树的直径上的中点. 一开始是用dfs写的,结果爆栈了,改成bfs就过了. #in…