Boxes Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://hihocoder.com/contest/acmicpc2015beijingonline/problem/7 Description There is a strange storehouse in PKU. In this storehouse there are n slots for boxes, forming a line. In each slot you can p…
[题意] 给出N个点,M条边,问这N个点形成的生成树的最大权值边-最小权值边的最小值 InputThe input consists of several test cases, separated by single blank lines. Each test case begins with aline containing the integer n (2 ≤ n ≤ 350), the number of doors in the building. The following lin…
Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring. 面DP题的考官都是神经病. .(吐槽) 貌似挺easy出回文的题,那么今天细致分析下DP的做法!! 以解我被DP问题虐成渣渣的心碎感觉.如有错误请指出…
Perun, Ult! 恶心题, 好多细节... 啊, 好恶心啊. #include<bits/stdc++.h> #define LL long long #define fi first #define se second #define mk make_pair #define PLL pair<LL, LL> #define PLI pair<LL, int> #define PII pair<int, int> #define SZ(x) ((in…
Task1 为了测试小 W 的数学水平,果果给了小 W N 个点,问他这 N 个点能构成的三角形个数. 对于 100%的数据:N<=100,保证任意两点不重合,坐标<=10000 恶心题(卡精度) #include<stdio.h> #include<stdlib.h> #include<iostream> #include<math.h> #define il inline #define re register using namespace…
目录 @description@ @solution@ @accepted code@ @details@ @description@ 给定 N 个点以及 P 条单向道路 Ai -> Bi,每条道路有 Ri 块石头(保证\(0 \le \lfloor\frac{Bi}{4}\rfloor-\lfloor\frac{Ai}{4}\rfloor\le 1\)). 接下来 D 天每天有一个询问,分为三类: (1)给定 X, Y, Z,修建一条 X -> Y 且有 Z 块石头的道路. (2)给定 X,…