ZOJ - 4114 第十届山东省赛 - B - Flipping Game(DP)

sample input 3 3 2 1 001 100 3 1 2 001 100 3 3 2 001 100 sample output 2 1 7 hint For the first sample test case, Little Sub can press the 1st switc...

2019-05-25 10:49:33

阅读数 0

评论数 0

小花梨判连通 并查集判断或者DFS + map标记vector运用

题目描述 小花梨给出n个点,让k位同学对这n个点任意添加无向边,构成k张图。小花梨想知道对于每个点i,存在多少个点j(包括i本身),使得i和j在这k张图中都是连通的。 输入 第一行输入两个正整数n和k,分别表示点的个数和同学数。 接下来分成k部分进行输入,每部分输入格式相同。 每部分第一行输入一个...

2019-05-23 19:06:15

阅读数 1

评论数 0

判断两个线段是否是有交点 upc 2019年第二阶段我要变强个人训练赛第三场 c题

题目描述 给定N个线段。求有交点的线段对数。 保证没有两条线段共线 输入 一行一个整数N,表示线段的个数 第2~N+1行,每行四个实数,x1,y1,x2,y2,表示线段的两个端点(x1,y1)和(x2,y2) 输出 一行一个整数,表示有交点的线段对数。 分析:https://www.cnblogs...

2019-05-22 19:26:17

阅读数 4

评论数 0

ZOJ 4123

Happy Equation 题意: 给出的那个等式,问有多少个x满足等式,就酱; 参考了几篇博客: https://blog.csdn.net/v5zsq/article/details/79325038(感觉这个比较好理解) https://www.cnblogs.com/albert-biu...

2019-05-18 08:58:23

阅读数 8

评论数 0

2019山东省省赛H题 ---zoj4120

Tokens on the Segments Sample Input 2 3 1 2 1 1 2 3 3 1 2 1 1 2 2 Sample Output 3 2 Hint For the first sample test case, one can put three tokens se...

2019-05-15 20:38:22

阅读数 58

评论数 0

ACM-ICPC 2018 沈阳赛区网络预赛-D:Made In Heaven(K短路+A*模板)

Made In Heaven One day in the jail, F·F invites Jolyne Kujo (JOJO in brief) to play tennis with her. However, Pucci the father somehow knows it and w...

2019-05-05 22:21:46

阅读数 18

评论数 0

ACM-ICPC 2018 沈阳赛区网络预赛 G.Spare Tire (容斥)

题目链接:https://nanti.jisuanke.com/t/A1995 题目大意 根据题目中所给的公式,问在1–n中与m互质的和是多少; 分析题意 通过打表会发现aia_iai​=(i+1)*i,那么原问题就可以转化成 ∑i=1ni(i+1)gcd(i,m)==1\sum_{i=1}^n...

2019-05-05 14:54:38

阅读数 68

评论数 0

Greatest Common Divisor 2018CCPC桂林站G题解 备战省赛组队训练赛第十七场

题目描述 There is an array of length n, containing only positive numbers. Now you can add all numbers by 1 many times. Please find out the minimum times ...

2019-05-03 18:06:22

阅读数 35

评论数 1

备战省赛组队训练赛第十六场 Winner Winner

题目描述 The FZU Code Carnival is a programming competetion hosted by the ACM-ICPC Training Center of Fuzhou University. The activity mainly includes the...

2019-05-03 09:00:00

阅读数 151

评论数 0

GCDLCM(数学)+Miller-Rabin模板

题目:GCDLCM——http://icpc.upc.edu.cn/problem.php?cid=1745&pid=3 题目描述 In FZU ACM team, BroterJ and Silchen are good friends, and they often p...

2019-05-02 18:20:57

阅读数 34

评论数 0

Largest Allowed Area (前缀和+二分)

题目描述 A company is looking for land to build its headquarters. It has a lot of money and can buy as many land patches as it needs. Its goal, however, ...

2019-04-29 17:52:01

阅读数 14

评论数 0

Floating-Point Hazard (数学定义QAQ)

题目描述 Given the value of low, high you will have to find the value of the following expression: If you try to find the value of the above expression ...

2019-04-29 17:35:24

阅读数 16

评论数 0

Chosen by god FZU - 2301

Chosen by god Everyone knows there is a computer game names "hearth stone", recently xzz likes this game very much. If you want to win, ...

2019-04-29 14:32:08

阅读数 39

评论数 0

ZOJ 4110 Strings in the Pocket 回文串+马拉车

BaoBao has just found two stringsandin his left pocket, whereindicates the-th character in string, andindicates the-th character in string. As BaoBa...

2019-04-29 14:09:36

阅读数 48

评论数 0

Max answer ST表

https://nanti.jisuanke.com/t/38228 Alice has a magic array. She suggests that the value of a interval is equal to the sum of the values in the inter...

2019-04-25 22:11:14

阅读数 8

评论数 0

二维前缀和

6 6 3 2 2 4 4 3 3 5 6 5 1 6 2 2 3 2 5 4 1 5 6 5

2019-04-21 22:21:42

阅读数 24

评论数 0

UPC 备战省赛第六场 Bumped!

题目描述 Peter returned from the recently held ACM ICPC World finals only to find that his return flight was overbooked and he was bumped from the fligh...

2019-04-15 21:55:36

阅读数 11

评论数 0

【Green公式】Hunter’s Apprentice(判断多边形为顺时针或逆时针)--鞋带公式

题目描述 When you were five years old, you watched in horror as a spiked devil murdered your parents. You would have died too, except you were saved by R...

2019-04-13 16:45:02

阅读数 79

评论数 0

Ground Defense (线段树维护差分数组)

下面是几组数据

2019-04-11 21:52:25

阅读数 8

评论数 0

差分数组学习笔记

题目: 来先看一道裸题,有n个数。 m个操作,每一次操作,将x~y区间的所有数增加z; 最后有q个询问,每一次询问求出x~y的区间和。 那么这就可以用差分数组去实现了 差分数组不仅仅是一个优秀的数据结构,还是一种很好的思想 差分数组的功能是修改区间,查询点 修改区间的时间复杂度是O(1),查询点的...

2019-04-09 17:08:08

阅读数 9

评论数 0

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