自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(35)
  • 收藏
  • 关注

原创 【期望】4318: OSU!

4318: OSU!Descriptionosu 是一款群众喜闻乐见的休闲软件。 我们可以把osu的规则简化与改编成以下的样子: 一共有n次操作,每次操作只有成功与失败之分,成功对应1,失败对应0,n次操作对应为1个长度为n的01串。在这个串中连续的 X个1可以贡献X^3 的分数,这x个1不能被其他连续的1所包含(也就是极长的一串1,具体见样例解释) 现在给出n,以及每个操作的...

2018-10-30 15:24:03 145

原创 【概率DP+矩阵快速幂】  POJ - 3744 Scout YYF I

Scout YYF I  POJ - 3744 YYF is a couragous scout. Now he is on a dangerous mission which is to penetrate into the enemy's base. After overcoming a series difficulties, YYF is now at the start of ene...

2018-10-29 20:12:36 200

原创 【组合数学 容斥原理】ICPC2014西安 F. Color

https://vjudge.net/contest/265252#problem/F给你n朵花,m种颜色,k  (1 ≤ n, m ≤ 10^9 , 1 ≤ k ≤ 10^6 , k ≤ n, m)花是一排,要求相邻花染色不能相同,染色数量刚好等于k,问你染色的方案数如果用<=k种颜色,那么有k*(k-1)^(n-1)   *C(k,1)  种方案               ...

2018-10-25 20:07:20 339

原创 【long double】E - Bet UVALive - 7901

https://vjudge.net/contest/262327#problem/E假设总共bet的钱为X那么每个选择的队伍bet的钱栈总钱数的P[i]所以如果要可以选必须得让P[i]*X*(1+b[i]/a[i])>=X==> P[i]>=A[i]/(A[i]+B[i])算出所有P,从小到大排到最大到第几个队伍sigma P<=1一定要用do...

2018-10-16 16:09:03 284

原创 【容斥】牛客小白月赛5——A

无关(relationship)https://www.nowcoder.com/acm/contest/135/A题目描述  若一个集合A内所有的元素都不是正整数N的因数,则称N与集合A无关。  给出一个含有k个元素的集合A={a1,a2,a3,...,ak},求区间[L,R]内与A无关的正整数的个数。  保证A内的元素都是素数。输入描述:输入数据共两行:第一行...

2018-10-15 17:14:23 129

原创 【freopen】

#include <stdio.h>#include <iostream>int main(){ int a,b; freopen("D:\\in.txt","r",stdin); //输入重定向,输入数据将从D盘根目录下的in.txt文件中读取 freopen("D:\\out.txt","w",stdout); //输出重定向,输出数据将保存在D盘根

2018-10-14 19:49:15 175 1

原创 【bfs+预处理】UVALive - 7672 E - What a Ridiculous Election

E - What a Ridiculous Election UVALive - 7672 给你一个五位数,问你12345最少变几步变成给你的数要求1、交换相邻的两个数2、把一个数+1  (<=3次)%103、把一个数变成两倍  (<=2次)%10开一个优先队列预处理出所有的情况,再o(1)判断即可#include <bits/stdc++.h&gt...

2018-10-14 19:47:16 175

原创 【三分】POJ - 3737 R - UmBasketella

POJ - 3737  R - UmBasketella In recent days, people always design new things with multifunction. For instance, you can not only use cell phone to call your friends, but you can also use your cell ph...

2018-10-14 01:34:29 193

原创 【期望 概率DP】Gym - 100554D D - Domination

https://vjudge.net/contest/261549#problem/D给你n*m的格子问你每天放一个棋子占据n行m列的期望天数是多少裸题概率DP,开三维数组dp【i】【j】【k】:用k个棋子占据i行j列的可能是多少那么接下来的每一步都会有四种可能dp[i][j][k+1]+=dp[i][j][k]*(i*j-k)/(n*m-k);dp[i+1][j]...

2018-10-13 16:15:59 225

原创 【三分入门】HDU - 4717 Q - The Moving Points

Q - The Moving Points  HDU - 4717There are N points in total. Every point moves in certain direction and certain speed. We want to know at what time that the largest distance between any two points ...

2018-10-12 21:22:02 136

原创 【二分答案+二分数据】POJ - 3579 E - Median

E - Median  POJ - 3579 Given N numbers, X1, X2, ... , XN, let us calculate the difference of every pair of numbers: ∣Xi - Xj∣ (1 ≤ i < j ≤ N). We can get C(N,2) differences through this work, and no...

2018-10-12 18:47:50 261

原创 【二分答案+01分数规划搜索】POJ - 2976 D - Dropping tests

D - Dropping tests  POJ - 2976 In a certain course, you take n tests. If you get ai out of bi questions correct on test i, your cumulative average is defined to be.Given your test scores and a p...

2018-10-12 10:46:07 375

原创 【矩阵快速幂】HDU - 5950 C - Recursive sequence

C - Recursive sequence HDU - 5950Farmer John likes to play mathematics games with his N cows. Recently, they are attracted by recursive sequences. In each turn, the cows would stand in a line, while...

2018-10-12 08:47:14 107

原创 【二分答案】POJ - 3258 C - River Hopscotch

C - River Hopscotch  POJ - 3258Every year the cows hold an event featuring a peculiar version of hopscotch that involves carefully jumping from rock to rock in a river. The excitement takes place on...

2018-10-10 21:01:34 425

原创 【二分答案】 POJ - 2456 B - Aggressive cows

B - Aggressive cows POJ - 2456 Farmer John has built a new long barn, with N (2 <= N <= 100,000) stalls. The stalls are located along a straight line at positions x1,...,xN (0 <= xi <= 1...

2018-10-10 20:40:09 168

原创 【构造】UVALive - 7269 I - Snake Carpet

I - Snake Carpet  UVALive - 7269题意:构造出一个矩阵,使得矩阵含有n条蛇,每条蛇的长度是1到n,并且奇数长度的蛇有奇数个拐弯,偶数长度的蛇有偶数个拐弯.5 5 5 3 35 4 4 3 2 5 4 4 1 25 5 5 3 3 6 65 4 4 3 2 6 6 5 4 4 1 2 6 65 5 5 3 3 6 65 4 4 3 2 6 6...

2018-10-09 23:12:48 141

原创 【二分】UVALive - 7261 A - Xiongnu's Land

A - Xiongnu's Land  UVALive - 7261 Description Wei Qing (died 106 BC) was a military general of the Western Han dynasty whose campaigns against the Xiongnu earned him great acclaim. He was a relati...

2018-10-09 20:04:37 167

原创 【二分答案】POJ - 1064 A - Cable master

A - Cable master  POJ - 1064Inhabitants of the Wonderland have decided to hold a regional programming contest. The Judging Committee has volunteered and has promised to organize the most honest cont...

2018-10-08 21:06:46 175

原创 【组合数取模 不用Lucas】 HYSBZ - 3260 I - 跳

I - 跳  HYSBZ - 3260 邪教喜欢在各种各样空间内跳。现在,邪教来到了一个二维平面。在这个平面内,如果邪教当前跳到了(x,y),那么他下一步可以选择跳到以下4个点:(x-1,y),(x+1,y),(x,y-1),(x,y+1)。而每当邪教到达一个点,他需要耗费一些体力,假设到达(x,y)需要耗费的体力用C(x,y)表示。对于C(x,y),有以下几个性质:1...

2018-10-08 19:35:46 239

原创 【扩展Lucas+中国剩余定理 模板】HYSBZ - 2142 H - 礼物

H - 礼物  HYSBZ - 2142一年一度的圣诞节快要来到了。每年的圣诞节小E都会收到许多礼物,当然他也会送出许多礼物。不同的人物在小E心目中的重要性不同,在小E心中分量越重的人,收到的礼物会越多。小E从商店中购买了n件礼物,打算送给m个人,其中送给第i个人礼物数量为wi。请你帮忙计算出送礼物的方案数(两个方案被认为是不同的,当且仅当存在某个人在这两种方案中收到的礼物不同)。...

2018-10-07 21:07:02 172

原创 【Lucas + 中国剩余定理】HDU - 5446 G - Unknown Treasure

G - Unknown Treasure  HDU - 5446 On the way to the next secret treasure hiding place, the mathematician discovered a cave unknown to the map. The mathematician entered the cave because it is there. ...

2018-10-07 20:41:28 123

原创 【组合数学 逆元打表】 HDU - 5698 F - 瞬间移动

F - 瞬间移动   HDU - 5698 有一个无限大的矩形,初始时你在左上角(即第一行第一列),每次你都可以选择一个右下方格子,并瞬移过去(如从下图中的红色格子能直接瞬移到蓝色格子),求到第nn行第mm列的格子有几种方案,答案对10000000071000000007取模。 Input多组测试数据。 两个整数n,m(2≤n,m≤100000)n,m(2≤n,m≤100000)...

2018-10-07 18:39:30 150

原创 【大组合数取模 Lucas定理 模板】HDU - 3037 A - Saving Beans

A - Saving Beans  HDU - 3037Although winter is far away, squirrels have to work day and night to save beans. They need plenty of food to get through those long cold days. After some time the squirre...

2018-10-07 13:23:46 154

原创 【凸包 最小矩形覆盖面积模板】HDU - 5251  K - 矩形面积

K - 矩形面积 HDU - 5251 小度熊有一个桌面,小度熊剪了很多矩形放在桌面上,小度熊想知道能把这些矩形包围起来的面积最小的矩形的面积是多少。Input第一行一个正整数 T,代表测试数据组数(1≤T≤201≤T≤20),接下来 T 组测试数据。 每组测试数据占若干行,第一行一个正整数 N(1≤N<≤1000)N(1≤N<≤1000),代表矩形的数量。接下来 N 行...

2018-10-06 21:38:32 286

原创 【凸包 两凸包最近点对距离】POJ - 3608 L - Bridge Across Islands

L - Bridge Across Islands POJ - 3608Thousands of thousands years ago there was a small kingdom located in the middle of the Pacific Ocean. The territory of the kingdom consists two separated islands...

2018-10-06 21:35:04 256

转载 【凸包 求上凸包路径】I - Problem G. Interstellar Travel  HDU - 6325

I - Problem G. Interstellar Travel  HDU - 6325After trying hard for many years, Little Q has finally received an astronaut license. To celebrate the fact, he intends to buy himself a spaceship and m...

2018-10-06 21:28:40 190

原创 【字符串hash模板】D - Pagodas HDU - 5512

D - Pagodas HDU - 5512 nn pagodas were standing erect in Hong Jue Si between the Niushou Mountain and the Yuntai Mountain, labelled from 11 to nn. However, only two of them (labelled aa and bb, wher...

2018-10-06 21:15:19 113

原创 【Dijkstra算法(邻接表+优先队列优化) 建立虚点】HDU - 5521 M - Meeting

M - Meeting HDU - 5521Bessie and her friend Elsie decide to have a meeting. However, after Farmer John decorated his fences they were separated into different blocks. John's farm are divided into n...

2018-10-06 20:08:24 276

原创 【最大凸多边形周长】HDU - 1392 H - Surround the Trees

HDU - 1392 H - Surround the Trees There are a lot of trees in an area. A peasant wants to buy a rope to surround all these trees. So at first he must know the minimal required length of the rope. Ho...

2018-10-05 21:20:48 303

转载 UVA 10256 The Great Divide(凸包应用 即凸包+线段相交判定+点是否在凸包内判断 模板)

UVA 10256 The Great Divide(凸包应用)https://vjudge.net/problem/UVA-10256题意:       有n个红点和m个蓝点,问你是否存在一条直线,使得任取任取一个红点和一个蓝点,都在直线的两边?这条直线不能穿过红点或蓝点.分析:       先求出红点的凸包和蓝点的凸包,则分离两个点集的充要条件是分离两个凸包.     ...

2018-10-05 20:56:34 138

原创 【最大空凸包 模板 计算几何 + DP】HDU - 6219 J - Empty Convex Polygons

J - Empty Convex Polygons HDU - 6219 Given a set of distinct points S on a plane, we define a convex hole to be a convex polygon having any of thegiven points as vertices and not containing any of t...

2018-10-05 20:31:18 314

原创 【凸包 稳定凸包问题】POJ - 1228 F - Grandpa's Estate

F - Grandpa's Estate  POJ - 1228 Being the only living descendant of his grandfather, Kamran the Believer inherited all of the grandpa's belongings. The most valuable one was a piece of convex polyg...

2018-10-05 15:46:40 122

原创 【凸多边形面积 模板】POJ - 3348 E - Cows

E - Cows  POJ - 3348 Your friend to the south is interested in building fences and turning plowshares into swords. In order to help with his overseas adventure, they are forced to save money on buyi...

2018-10-04 21:35:35 184

原创 【最小圆覆盖 模板】HDU - 3007 C - Buried memory

C - Buried memory HDU - 3007 Problem DescriptionEach person had do something foolish along with his or her growth.But,when he or she did this that time,they could not predict that this thing is a ...

2018-10-04 19:56:33 288

原创 【凸包+旋转卡壳(最远点对)】POJ - 2187 A - Beauty Contest

A - Beauty Contest POJ - 2187 Bessie, Farmer John's prize cow, has just won first place in a bovine beauty contest, earning the title 'Miss Cow World'. As a result, Bessie will make a tour of N (2 &...

2018-10-01 16:46:41 151

空空如也

空空如也

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

TA关注的人

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