自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

PushyTao的博客

星星之火,可以燎原

  • 博客(15)
  • 资源 (1)
  • 收藏
  • 关注

原创 [Nowcoder] 有向无环图 | 拓扑排序简单应用

链接题目描述Bobo 有一个 n 个点,m 条边的有向无环图(即对于任意点 v,不存在从点 v 开始、点 v 结束的路径)。为了方便,点用 1,2,…,n1, 2, \dots, n1,2,…,n编号。设 count(x,y)\mathrm{count}(x, y)count(x,y) 表示点 x 到点 y 不同的路径数量(规定 count(x,x)=0\mathrm{count}(x, x) = 0count(x,x)=0,Bobo 想知道∑i=1n∑j=1ncount(i,j)⋅ai⋅bj\s

2021-09-30 13:00:56 13

原创 [Nowcoder / POJ2728] 最优比率生成树 | 二分 + prim

Nowcoder链接题目描述David the Great has just become the king of a desert country. To win the respect of his people, he decided to build channels all over his country to bring water to every village. Villages which are connected to his capital village will be w

2021-09-28 21:08:54 14

原创 [UPC] Postfix Evaluation 后缀表达式求值 | 栈的简单应用

题目描述In a postfix expression, operators follow their operands. For example, [ 5 2 * ] is interpreted as 5 * 2. If there are multiple operators, each operator appears after its last operand. Here are more examples, showing how postfix compares to parenthesi

2021-09-26 10:14:02 8

原创 [Luogu] P1438 无聊的数列 | 线段树简单题

题目背景无聊的 YYB 总喜欢搞出一些正常人无法搞出的东西。有一天,无聊的 YYB 想出了一道无聊的题:无聊的数列。。。(K峰:这题不是傻X题吗)题目描述维护一个数列 aia_iai​ ,支持两种操作:1 l r K D:给出一个长度等于 r−l+1r-l+1r−l+1 的等差数列,首项为 KKK,公差为 DDD,并将它对应加到 [l,r][l,r][l,r] 范围中的每一个数上。即:令 al=al+K,al+1=al+1+K+D…ar=ar+K+(r−l)×Da_l=a_l+K,a_{l+1}=a

2021-09-23 14:02:12 19

原创 [UCF HSPT 2021] Sharon’s Sausages | 思维 暴力

DescriptionSharon is a food-loving individual, and recently he has discovered that he loves the taste of different types of sausages!When he was invited to the HSPT potluck, he decided that he would contribute 4 sausages for the cause in order to spread

2021-09-16 00:40:58 36

原创 [UPC] 山东省第九届省赛 Games | dp

题目描述Alice and Bob are playing a stone game. There are n piles of stones. In each turn, a player can remove some stones from a pile (the number must be positive and not greater than the number of remaining stones in the pile). One player wins if he or she

2021-09-14 16:28:34 20

原创 [Nowcoder | UPC] 2021年度训练联盟热身训练赛第六场 Hopscotch | 最短路 bfs

题目描述There’s a new art installation in town, and it inspires you… to play a childish game. The art installation consists of a floor with an n×n matrix of square tiles. Each tile holds a single number from 1 to k. You want to play hopscotch on it. You want t

2021-09-14 15:58:03 32

原创 [Nowcoder] 2021年度训练联盟热身训练赛第六场 Mini Battleship | 深搜 回溯 乱搞

题目链接题目描述Battleship is a game played by two players. Each player has their own grid, which is hidden from their opponent. Each player secretly places some ships on their grid. Each ship covers a horizontal or vertical straight line of one or more contingu

2021-09-14 14:36:48 73

原创 [CCPC] 2017秦皇岛 NumbersI | Java BigInteger | 贪心

题目描述DreamGrid has a nonnegative integer n. He would like to divide n into m nonnegative integers a1,a2,…,am and minimizes their bitwise or (i.e. n=a1+a2+…+am and a1 OR a2 OR … OR am should be as small as possible).inputThere are multiple test cases. The

2021-09-14 13:50:44 16

原创 有关Java大浮点数BigDecimal的简单使用[连续更新]

Java大浮点数BigDecimal的精度可以认为是无限的BigDecimal 里面的pow()的复杂度是快速幂的复杂度logBigDecimal.pow() 里面的参数是一个整数,BigDecimal的构造方式和BigInteger 类似BigDecimal 保留小数的方法比较多,一般情况下下保留到小数点后x(int)位的情况下,可以调用方法setScale在多次操作之后,数据的长度可能比较大,所以说运算起来就会减慢速度,所以说可能会导致TLE某示例代码如下:import java.ma.

2021-09-14 09:45:36 78 3

原创 [CCPC] 2017秦皇岛H Prime Set | 二分图最大匹配 [据说是个金牌题]

题目链接 or 题目链接题目描述Given an array of n integers a1,a2,…,an, we say a set {i,j} is a prime set of the given array, if i≠j and ai+aj is prime.BaoBao has just found an array of n integers a1,a2,…,an in his pocket. He would like to select at most k prime set

2021-09-12 22:14:29 45 4

原创 [Codeforces] 1557 C Moamen and XOR(组合数学)

Moamen and Ezzat are playing a game. They create an array a of n non-negative integers where every element is less than 2k.Moamen wins if a1&a2&a3&…&an≥a1⊕a2⊕a3⊕…⊕an.Here & denotes the bitwise AND operation, and ⊕ denotes the bitwise

2021-09-06 21:10:07 26

原创 [洛谷 P3376] 网络最大流 | 模板 (ISAP 算法) 入门

题目链接题目描述如题,给出一个网络图,以及其源点和汇点,求出其网络最大流。输入格式第一行包含四个正整数 nnn,mmm,sss,ttt,分别表示点的个数、有向边的个数、源点序号、汇点序号。接下来M行每行包含三个正整数 ui ,vi,wi ,表示第 i 条有向边从 ui 出发,到达 vi,边权为 wi即该边最大流量为 wi)。输出格式一行,包含一个正整数,即为该网络的最大流。输入输出样例4 5 4 34 2 304 3 202 3 202 1 301 3 4050样例输入输

2021-09-04 11:40:03 28 2

原创 [洛谷 P3376] 网络最大流 | 模板 (Dinic算法) 入门

题目链接题目描述如题,给出一个网络图,以及其源点和汇点,求出其网络最大流。输入格式第一行包含四个正整数 nnn,mmm,sss,ttt,分别表示点的个数、有向边的个数、源点序号、汇点序号。接下来M行每行包含三个正整数 ui ,vi,wi ,表示第 i 条有向边从 ui 出发,到达 vi,边权为 wi即该边最大流量为 wi)。输出格式一行,包含一个正整数,即为该网络的最大流。输入输出样例4 5 4 34 2 304 3 202 3 202 1 301 3 4050样例输入输

2021-09-03 16:37:47 23

原创 浅谈online judge平台 spj [special judge] 使用 | 修改问题

浅谈oj平台 spj 使用 | 修改问题首先:参数对应返回值代码提交几种spj第一种:简单的一类特判第二种:多组输入的特判第三种:需要判断特殊情况[impossible]第四种:带有[testlib.h]的spj第五种:GCPC [German Collegiate Programming Contest] 类spj单个文件的情况*.h *.cpp的情况第六种:交互题的spj第七种..........遇见后后续更新以LDUOJ为例 goto -> githubLDUOJ 平台开发者spj开发博

2021-09-02 14:16:48 218 2

一份(不太)简短的 LATEX 2ε 介绍

英文作者: Tobias Oetiker Hubert Partl, Irene Hyna and Elisabeth Schlegl 英文版本: Version 6.2, Februrary 28, 2018 中文翻译: CTEX 开发小组 中文版本:版本 6.02,二零二零年八月

2020-10-13

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人 TA的粉丝

提示
确定要删除当前文章?
取消 删除