自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 Codeforces Round #459 (Div. 2) - D. MADMAX (记忆化搜索)

http://codeforces.com/contest/918/problem/D题意:在一个DAG图上,每条边都有一个权值,A先走,B后走。每次走的时候,当前走的边的权值不能小于上次(A或者B都算)走的。无路可走则输。输出每一种可能的答案。POINT:dp[200][110][110];//前一条边值、【当前】先走的人所在的顶点、【当前】后

2018-01-31 14:33:51 295

原创 Codeforces Round #459 (Div. 2) - C. The Monster(贪心)

http://codeforces.com/contest/918/problem/C题意:给你一串?(),让你求有几组[l,r],l-r中的括号是匹配的。POINT:2 ≤ |s| ≤ 5000,可以遍历l,然后往前判断是否匹配。遇"(" , now++.  ")",now--.先把"?"全部当成")",然后当temp如果没有?了那就break了。

2018-01-31 14:22:24 270

原创 AtCoder Beginner Contest 087 - D People on a Line

D - People on a LineTime limit : 2sec / Memory limit : 256MBScore : 400 pointsProblem StatementThere are N people standing on the x-axis. Let the coordinate of Person i be xi.

2018-01-29 21:53:17 469

原创 2018年全国多校算法寒假训练营练习比赛(第二场)

A 吐泡泡时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 32768K,其他语言65536K64bit IO Format: %lld题目描述 小鱼儿吐泡泡,嘟嘟嘟冒出来。小鱼儿会吐出两种泡泡:大泡泡"O",小泡泡"o"。两个相邻的小泡泡会融成一个大泡泡,两个相邻的大泡泡会爆掉。(是的你没看错,小气泡和大气泡不会产生任何变化的,原因我也

2018-01-28 23:06:15 420

原创 牛客练习赛11 - B 假的字符串 (字典树+拓扑排序)

链接:https://www.nowcoder.com/acm/contest/59/B来源:牛客网题目描述给定n个字符串,互不相等,你可以任意指定字符之间的大小关系(即重定义字典序),求有多少个串可能成为字典序最小的串,并输出它们 输入描述:第一行一个数表示n之后n行每行一个字符串表示给定的字符串输出描述:第一行输出一个数x表示可行的字符串个数之后输出x行,每行输出一个可行的字符串输出的顺...

2018-01-26 23:54:20 614 2

原创 HackerRank Hiring Contest - D Array and Queries (单调栈思想)

Given an array, you are asked to perform a number of queries and divide the array into what are called, beautifulsubsequences. The array  has length . A function  is defined to be a minimal

2018-01-26 23:46:46 319

原创 HackerRank Hiring Contest - C The Simplest Sum

You are just learning to code and are finished with loops and functions. Now, you are given the following pseudocode:/* * The function has two integer parameters: k and n * The function returns

2018-01-26 23:34:27 342

原创 HackerRank Hiring Contest - B Winning Lottery Ticket

The SuperBowl Lottery is about to commence, and there are several lottery tickets being sold, and each ticket is identified with a ticket ID. In one of the many winning scenarios in the Superbowl lott

2018-01-26 23:30:43 834

原创 ZOJ Monthly, January 2018 - J Distance

题意:找出有几个数量相等的连续的区间对。 区间里的相对距离POINT:n^2的效率遍历上下数组的开头。然后每次扫一遍就有答案。因为区间要连续的。每次都是右边加进来。左边删掉最优。注意不要重复。#include #include #include #include #include using namespace std;typedef long lo

2018-01-25 18:09:01 414

原创 ZOJ Monthly, January 2018 - F The Limit

题意:求分数的极限。POINT:简单的多项式处理掉。然后0/0的时候洛必达上下求导继续。1/0 输出inf。注意分母为1的时候。#include #include #include #include #include #include using namespace std;#define LL long longconst LL maxn =

2018-01-25 18:05:03 333

原创 ZOJ Monthly, January 2018 - E Yet Another Data Structure Problem

题意:线段树的乘和次方操作。POINT:学习一下lazy数组的更新就行了。 类似区间加和乘操作。 bozj 1798mul和fang数组代表,下面的区间要^fang 然后乘mul。mul操作就在mul数组正常更新。fang操作就要把mul数组也更新掉。 mul=mul^fang。#include #include

2018-01-25 18:00:58 584

原创 ZOJ Monthly, January 2018 - D Seat Assignment (最大流)

HintThe first sample:There are 10 seats numbered from 1 to 10.There are 2 people wanting their seat number to be a multiple of 1, 1 person wanting his seat number to be a multiple of 2, and 4

2018-01-25 17:54:25 561

原创 ZOJ Monthly, January 2018 - B PreSuffix (字典树)

Sample Input3abcbde21 22 37xabcdyabcdcdocdpcdqcdrabcdz11 23aaaaaa11 3Sample OutputNN13题意:给你n个字符串。每次询问给你x,y代表找出第x和y对字符串的【最长】相同后缀。然后如果这n个字符串的前缀是这个后缀的话,就num++

2018-01-25 17:46:37 390

原创 BZOJ - 1798: [Ahoi2009]Seq 维护序列seq (线段树 区间更新)

1798: [Ahoi2009]Seq 维护序列seqTime Limit: 30 Sec  Memory Limit: 64 MBSubmit: 7498  Solved: 2672[Submit][Status][Discuss]Description老师交给小可可一个维护数列的任务,现在小可可希望你来帮他完成。 有长为N的数列,不妨设为a1,a2,…,aN 。有如

2018-01-23 19:52:59 330

原创 湖南大学ACM程序设计新生杯大赛 - Yuanyuan Long and His Ballons(环形染色问题)

时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述 Yuanyuan Long is a dragon like this picture?                                   I don’t know, maybe

2018-01-23 19:45:08 712 1

原创 湖南大学ACM程序设计新生杯大赛 - E Permutation (匈牙利算法)

时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 32768K,其他语言65536K64bit IO Format: %lld题目描述 A mod-dot product between two arrays with length n produce a new array with length n. If array A is a1,a2,..

2018-01-23 19:43:39 444

原创 湖南大学ACM程序设计新生杯大赛 - B Build

时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 32768K,其他语言65536K64bit IO Format: %lld题目描述 In country  A, some roads are to be built to connect the cities。However, due to limited funds, only

2018-01-23 19:39:07 668

原创 湖南大学ACM程序设计新生杯大赛 - A Array

链接:https://www.nowcoder.com/acm/contest/55/A来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 131072K,其他语言262144K64bit IO Format: %lld题目描述Given an array A with length n  a[1],a[2],...,a[n

2018-01-23 19:34:36 447

原创 2017年浙工大网络同步赛 - 取数游戏2 (DP)

时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 131072K,其他语言262144K64bit IO Format: %lld题目描述 给定两个长度为n的整数列A和B,每次你可以从A数列的左端或右端取走一个数。假设第i次取走的数为ax,则第i次取走的数的价值vi=bi⋅ax,现在希望你求出∑vi的最大值。输入描述:第一行一个数T,表示有T

2018-01-23 19:19:18 263

原创 2017年浙工大网络同步赛 - 栗酱的数列 (差分+KMP)

题目描述 栗酱有一个长度为n的数列A,一个长度为m的数列B,现在询问A中有多少个长度为m的连续子序列A',满足(a'1+b1)%k = (a'2+b2)%k = …… = (a'm + bm)%k。输入描述:第一行一个数T,表示有T组数据。对于每组数据,第一行三个整数,n, m, k。第一行输入n个数, a1,a2,…,an, 表示A数列中的数,第二行输入m个数, b1

2018-01-23 19:16:48 306

空空如也

空空如也

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

TA关注的人

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