- 博客(49)
- 收藏
- 关注
原创 2021-06-07
PowerDesigner 基本用法创建物理模型添加表设置表的描述设置字段描述与自增设置字段默认值设置无符号数值字段生成SQL语句Database -> Generate DatabaseCTRL+G设置文本编码创建物理模型添加表设置表的描述设置字段描述与自增设置字段默认值设置无符号数值字段生成SQL语句Database -> Generate DatabaseCTRL+G设置文本编码...
2021-06-07 18:11:30
337
原创 2018 Multi-University Training Contest 8 1
hdu 6397 Character Encoding求 x1+x2+…+xm = k (0≤xi < n) 的整数解的组数。 **无上界(xi>=0) 选法 x1+x2+…+xm = k C(k+m-1, m-1); i个违法条件 容斥系数 变量选法 (-1)^i * C(m, i) * C(k-i*n+m-1, m-1)**#include <...
2018-08-16 15:43:25
231
原创 2018 Multi-University Training Contest 7 1,5,10
hdu 6386 Age of Moyu给出n个点m条边,每条边一个编号,走不同编号的边时需要花费1,求1~n最少花费。quan哥的一手(以边建图,求最短路)#include<iostream>#include<string.h>#include<stdio.h>#include<math.h>#include<...
2018-08-15 10:33:21
258
原创 2018 Multi-University Training Contest 5 B
hdu 6351 Beautiful Now给一个数n,在m次交换位置(可以自己和自己swap)之后,分别求出得到的最小值和最大值。(X)贪心:min(每次把右边最小的值与最前面比它大的值交换)max(每次把最右边最小的值与最前面比它小的值交换)最后特判右边交换到左边的值如果一样,那么交换到右边的值按小到大排列(大到小排列)太年轻ac做法:dfs+剪枝 || 根据全排列求(...
2018-08-07 10:43:30
165
原创 hdu 5875 Function
题目给出的式子就是把第l个数依次对后面到r位置的数取模直接交一发t了,想到可以用线段树写。预处理每个数字后面第一个比它小的数的下标(Next),按照Next数组去遍历#include <iostream>#include <cstdio>#include <cstring>#include <algorithm>...
2018-08-07 09:38:17
158
原创 poj 3080 Blue Jeans(kmp)
题目给出n个长为60的序列,求所有序列的最长公共子序列。枚举第一个序列的每个子序列,与其余序列匹配。#include <iostream>#include <cstdio>#include <cstring>#include <algorithm>using namespace std;const int N = 6...
2018-08-05 10:13:07
160
原创 2018 Multi-University Training Contest 4 E,J,K
Problem E. Matrix from Arrays打表得出规律,每个2*len的区域都相等。 预处理二维前缀和。 求给出的坐标左上角区域包含多少个2*len为边长的区域,多出的再处理。(calc)已经找出规律,差点容斥,没有想下去… 一点容斥,黑色+,黄色-#include &lt;iostream&gt;#include &lt;cstdio&gt;...
2018-08-02 11:13:56
158
原创 2018 Multi-University Training Contest 3 A,G,L
Problem L. Visual Cube给出长宽高(a,b,c),按照样例格式输出立方体。 签到题写成这样,服了#include &amp;amp;amp;amp;amp;amp;lt;iostream&amp;amp;amp;amp;amp;amp;gt;#include &amp;amp;amp;amp;amp;amp;lt;cstdio&amp;amp;amp;amp;amp;amp;gt;
2018-07-30 17:17:18
236
原创 hdu 1754 I Hate It(线段树模板题)
题目#include &amp;lt;iostream&amp;gt;#include &amp;lt;cstdio&amp;gt;#include &amp;lt;cstring&amp;gt;#include &amp;lt;algorithm&amp;gt;using namespace std;const int N = 1&amp
2018-07-29 11:35:38
277
原创 hdu 1166 敌兵布阵(线段树模板题)
题目第i个正整数ai代表第i个工兵营地里开始时有ai个人(1) Add i j,i和j为正整数,表示第i个营地增加j个人(j不超过30) (2)Sub i j ,i和j为正整数,表示第i个营地减少j个人(j不超过30); (3)Query i j ,i和j为正整数,i<=j,表示询问第i到第j个营地的总人数; (4)End 表示结束,这条命令在每组数据最后出现; 每组数据...
2018-07-29 11:30:53
133
转载 UVALive 7040 Color(容斥)
题目链接1链接2题意:n个格子,m种颜色,取k种颜色,恰好使用k种颜色为n个格子上色,相邻格子颜色不同,求方案数,对1e9+7取余。c(m,k)×k×(k-1)^n-1,这是少于k种颜色上色的情况,不是恰好。 假设出现p (2 &lt;= p &lt;= k-1)种颜色,从k种颜色中选p种进行涂色,方案数为C(k,p) × p × (p-1)^(n-1); 总方案数为C...
2018-07-29 11:19:53
224
转载 hdu 6304 Chiaki Sequence Revisited(找规律)
原文 题目%了dalao的博客,看了许久(菜是原罪),勉强看懂,不知是否有错,如有错欢迎指出。等差数列 如下 下标,数值,和 ///1 3 7 15 31 a[i] ///1 2 4 8 16 f[i]#include <iostream>#include <cstdio>#include <cstring>...
2018-07-25 10:42:34
250
原创 hdu 6301(标记数组)(暴力)
链接给n(1~n这个区间范围)m(给m对区间个数)保证m对区间中的数不重复 求这个区间的每一个位置的数对区间左端点排序,判断每个区间及其前一个区间是否有交集,标记数组储存交集中的数。 当前区间没有交集的部分根据标记数组中的数是否为当前标记i来决定放什么数。 用i标记,那么标记数组可以只在每次输入n,m时初始化 没有重合的区间默认从1~n赋值 没有出现过的区间都为1...
2018-07-24 09:22:26
587
转载 Gym - 101617D
题目链接转自给出n*n的图,’.’能走,’#’不能走,k为最多能跳远的距离,每次只能往右或者往下走,求左上角到右下角最短需要多少步数。#include <iostream>#include <cstdio>#include <cstring>#include <algorithm>using namespace std;const int N = 2000+5;const int inf
2017-12-18 20:32:41
216
原创 hdu 5542 Favorite Donut(字符串暴力)
Favorite DonutTime Limit: 1500/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 3762 Accepted Submission(s): 948Problem Description Lulu has a sweet tooth.
2017-12-04 21:34:34
300
原创 hdu 5444 Elven Postman(建树,遍历)
Elven PostmanTime Limit: 1500/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 2253 Accepted Submission(s): 1326Problem Description Elves are very peculiar
2017-12-04 19:13:53
244
原创 hdu 5441 Travel(并查集)
TravelTime Limit: 1500/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 4222 Accepted Submission(s): 1413Problem Description Jack likes to travel around th
2017-12-04 19:09:27
283
原创 hdu 5438 Ponds(并查集/拓扑排列)
PondsTime Limit: 1500/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 4938 Accepted Submission(s): 1418Problem Description Betty owns a lot of ponds, some
2017-12-04 19:02:26
247
原创 hdu 5437 Alisha’s Party(优先队列)
Alisha’s PartyTime Limit: 3000/2000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 6677 Accepted Submission(s): 1597Problem Description Princess Alisha invite
2017-12-04 18:49:34
224
原创 poj 1017 Packets
PacketsTime Limit: 1000MS Memory Limit: 10000K Total Submissions: 57248 Accepted: 19424 DescriptionA factory produces products packed in square packets of the same height h and of the siz
2017-11-23 20:23:21
191
原创 poj 1861 Network(并查集)
NetworkTime Limit: 1000MS Memory Limit: 30000K Total Submissions: 17376 Accepted: 6989 Special Judge DescriptionAndrew is working as system administrator and is planning to establish
2017-10-15 16:36:32
187
原创 poj 2560 Freckles(并查集)
FrecklesTime Limit: 1000MS Memory Limit: 65536K Total Submissions: 8749 Accepted: 4177 DescriptionIn an episode of the Dick Van Dyke show, little Richie connects the freckles on his Dad’s ba
2017-10-15 16:16:59
271
原创 poj 1308 Is It A Tree?(并查集)
Is It A Tree?Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 34199 Accepted: 11597 DescriptionA tree is a well-known data structure that is either empty (null, void, nothing) o
2017-09-19 20:01:32
310
原创 poj 2236 Wireless Network(并查集)(有点暴力)
Wireless NetworkTime Limit: 10000MS Memory Limit: 65536K Total Submissions: 30730 Accepted: 12787 DescriptionAn earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical t
2017-09-19 19:54:33
389
原创 poj 1703 Find them, Catch them(并查集)
Find them, Catch themTime Limit: 1000MS Memory Limit: 10000K Total Submissions: 47274 Accepted: 14570 DescriptionThe police office in Tadu City decides to say ends to the chaos, as launch
2017-09-19 19:43:01
278
原创 poj 2524 Ubiquitous Religions(并查集)
Ubiquitous ReligionsTime Limit: 5000MS Memory Limit: 65536K Total Submissions: 37330 Accepted: 17793 DescriptionThere are so many different religions in the world today that it is difficu
2017-09-19 19:38:05
341
原创 poj 2492 A Bug's Life(并查集)
A Bug’s LifeTime Limit: 10000MS Memory Limit: 65536K Total Submissions: 39319 Accepted: 12790 DescriptionBackground Professor Hopper is researching the sexual behavior of a rare species
2017-09-19 19:30:16
300
原创 poj 1611 The Suspects(并查集)
The SuspectsTime Limit: 1000MS Memory Limit: 20000K Total Submissions: 42354 Accepted: 20430 DescriptionSevere acute respiratory syndrome (SARS), an atypical pneumonia of unknown aetiolog
2017-09-19 19:20:12
323
转载 hdu 1182 食物链(并查集)
食物链Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 77793 Accepted: 23161 Description动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。 现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是
2017-09-19 19:09:51
728
原创 poj 3842 An Industrial Spy(dfs+乱搞)
An Industrial SpyTime Limit: 1000MS Memory Limit: 65536K Total Submissions: 1733 Accepted: 684 DescriptionIndustrial spying is very common for modern research labs. I am such an industrial s
2017-09-15 20:55:28
465
原创 hdu 1286 找朋友(筛选)
找新朋友Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 13833 Accepted Submission(s): 7388Problem Description 新年快到了,“猪头帮协会”准备搞一个聚会,已经知道现有会员N人,把
2017-09-12 22:07:52
475
原创 poj 2586 Y2K Accounting Bug(贪心)
Y2K Accounting BugTime Limit: 1000MS Memory Limit: 65536K Total Submissions: 15926 Accepted: 7984 DescriptionAccounting for Computer Machinists (ACM) has sufferred from the Y2K bug and lo
2017-09-09 10:50:55
192
原创 poj 1328 Radar Installation
Radar InstallationTime Limit: 1000MS Memory Limit: 10000K Total Submissions: 90543 Accepted: 20340 DescriptionAssume the coasting is an infinite straight line. Land is in one side of coas
2017-09-09 10:41:14
201
转载 hdu 1027 Ignatius and the Princess II (dfs+剪枝)?
Ignatius and the Princess IITime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 8727 Accepted Submission(s): 5135Problem Description Now our he
2017-09-09 10:09:47
196
转载 poj 1753 Flip Game(dfs)_但是
Flip GameDescriptionFlip game is played on a rectangular 4x4 field with two-sided pieces placed on each of its 16 squares. One side of each piece is white and the other one is black and each piece is l
2017-09-05 21:56:54
181
原创 CodeForces - 122C Lucky Sum
Lucky SumPetya loves lucky numbers. Everybody knows that lucky numbers are positive integers whose decimal representation contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are luc
2017-08-30 10:45:17
344
原创 位运算
& 按位与 相应为1,该位结果为1,否则为0| 按位或 相应位有一个为1,该位结果为1^ 按位异或 两个值相同则为0,否则为1~ 取反 ~对二进制数按位取反,即将0变1,将1变0<< 左移 二进制位全部左移N位,右补0>> 右移 二进制位右移N位,移到右端的低位被舍弃,对于无符号数,高位补0按位与取模//n%2 = n&1//n%4 = n&3//n%8 = n&7inline bool
2017-08-28 11:22:49
351
原创 up
///cin加速std::ios::sync_with_stdio(false);std::cin.tie(0);cout<<setiosflags(ios::fixed)<<setprecision(1)<<y;///getchar加速template <class T>inline void scan_d(T &ret){ char c; ret = 0; wh
2017-08-28 10:50:24
184
原创 hdu 2082 找单词(母函数)
找单词Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 8128 Accepted Submission(s): 5699Problem Description 假设有x1个字母A, x2个字母B,….. x26个字母Z,同时假设字
2017-08-26 14:47:35
292
转载 hdu 1085 Holding Bin-Laden Captive!(母函数)
Holding Bin-Laden Captive!Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 23120 Accepted Submission(s): 10300Problem Description We all kno
2017-08-26 11:07:48
322
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人