![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
杂
xiao_you_you
这个作者很懒,什么都没留下…
展开
-
POJ 3276 Face The Right Way 【尺取法】
D - Face The Right Way POJ - 3276 题意:有N头牛,最初它们的朝向不一致,为使得它们都朝向前方,现有一台转向器,设定K值(一次性翻转相邻的k头牛),问需要的最小转向次数M和最小的K。 思路:对翻转长度K进行枚举,计算出每次长度k所对应的M。这里,M的计算方法用到尺取遍历查找。从开始遍历查找,当遇到头朝后的牛一定进行反转。#include<...原创 2018-05-11 11:59:32 · 129 阅读 · 0 评论 -
Jurisdiction Disenchantment
题目描述The Super League of Paragons and Champions (SLPC) has been monitoring a plot by a corrupt politicianto steal an election. In the past week, the politican has used a mind-control technique to en...原创 2019-04-14 19:16:44 · 199 阅读 · 0 评论 -
Ground Defense
题目描述You are a denizen of Linetopia, whose n major cities happen to be equally spaced along an east-west line. Infact, they are often numbered in order from 1 to n, where 1 is the westmost city and ...原创 2019-04-14 19:27:10 · 111 阅读 · 0 评论 -
Keiichi Tsuchiya the Drift King Gym - 102028D
Drifting is a driving style in which the driver uses the throttle, brakes, clutch, gear shifting and steering input to keep the car in a state of oversteer while manoeuvring from turn to turn. As a sp...原创 2019-04-17 16:17:30 · 373 阅读 · 0 评论 -
问题 J: Floating-Point Hazard
题目描述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 in a straightforward way, the answer may be inc...原创 2019-04-29 19:59:28 · 236 阅读 · 0 评论 -
C. Beautiful Lyrics (CodeForces)
You are given原创 2019-06-14 20:20:44 · 281 阅读 · 0 评论 -
Wave(ccpc江西省赛)
Problem DescriptionAvin is studying series. A series is called "wave" if the following conditions are satisfied:1) It contains at least two elements;2) All elements at odd positions are the same;...原创 2019-07-22 08:18:05 · 228 阅读 · 0 评论 -
归并排序求逆序数模版
#include <iostream>#include <iterator>#include <algorithm>#include<map>#define ll long longusing namespace std;ll a[1008611],b[1008611];ll cnt=0;void Merge(int l,int m...原创 2019-07-26 07:50:40 · 85 阅读 · 0 评论 -
2019hdu暑假多校训练赛第七场1006 Final Exam hdu6651(思维)
思路: 作为老师的话。他想让你过不了,那会拿n-k+1道题卡你。 对于学生的话。 若想在n-k+1道题目里面过一道。这n-k+1道题的分值最坏情况就是m。 所以要至少要学m+1小时。 然后对于剩下的k-1道题。 最坏的情况就是老师拿m/(n-k+1)的分数去卡你。 所以若要做对这k-1道,则学习时间是(m/(n-k+1)+1)*(k-1)。#inc...原创 2019-08-13 15:01:27 · 130 阅读 · 0 评论 -
Imperfect GPS
Lots of runners use personal Global Positioning System (GPS) receivers to track how many miles they run. No GPS is perfect,though: it only records its position periodically rather than continuously, ...原创 2019-04-14 19:07:43 · 174 阅读 · 0 评论 -
Progressive Scramble
You are a member of a naive spy agency. For secure communication,members of the agency use a very simple encryption algorithm – which changes each symbol in the message ‘progressively’, i.e., based on...原创 2019-04-14 19:06:27 · 149 阅读 · 0 评论 -
Cube
题目描述给你一个n*m的棋盘,有一个1*1*2的长方体竖直放在(1,1)上,你可以将其在棋盘上滚动,你的目标是让其竖直放在(n*m)上,问至少需要多少次操作。(放倒、竖直、翻滚) 输入一行,两个整数n,m (n<=m) 输出需要最少时间逃脱密室。若无解输出impossible。 思路:由于计算的是最少操作次数,尽量让‘长’着地,那么一次放到+一次立起的长度...原创 2018-12-25 12:40:16 · 246 阅读 · 0 评论 -
归并排序求逆序数(模版)
#include<iostream>#include<cstdio>#include<cmath>#include<algorithm>#include<map>#include<cstring>#define ll long longusing namespace std;ll a[1008611],ans...原创 2019-01-13 12:09:27 · 117 阅读 · 0 评论 -
C. Palindromic Matrix(codeforces)
Let's call some square matrix with integer values in its cells palindromic if it doesn't change after the order of rows is reversed and it doesn't change after the order of columns is reversed.For e...原创 2019-02-20 12:29:21 · 468 阅读 · 0 评论 -
日期问题
问题描述 小明正在整理一批历史文献。这些历史文献中出现了很多日期。小明知道这些日期都在1960年1月1日至2059年12月31日。令小明头疼的是,这些日期采用的格式非常不统一,有采用年/月/日的,有采用月/日/年的,还有采用日/月/年的。更加麻烦的是,年份也都省略了前两位,使得文献上的一个日期,存在很多可能的日期与其对应。 比如02/03/04,可能是2002年03月04日、2004年0...原创 2019-03-25 21:03:47 · 156 阅读 · 0 评论 -
A Magic Lamp HDU - 3183 (ST表)
Kiki likes traveling. One day she finds a magic lamp, unfortunately the genie in the lamp is not so kind. Kiki must answer a question, and then the genie will realize one of her dreams.The question ...原创 2019-04-06 11:26:17 · 159 阅读 · 0 评论 -
Heap Partition ZOJ - 3963
A sequenceS= {s1,s2, ...,sn} is calledheapableif there exists a binary treeTwithnnodes such that every node is labelled with exactly one element from the sequenceS, and for every non-root no...原创 2019-04-01 22:12:19 · 182 阅读 · 0 评论 -
康托展开与逆康托展开
康托展开原理:其中,为整数,并且。ai表示原数的第i位在当前未出现的元素中是排在第几个举个例子说明。在5个数的排列组合中,计算 34152的康托展开值。首位是3,则小于3的数有两个,为1和2,,则首位小于3的所有排列组合为第二位是4,由于第一位小于4,1、2、3中一定会有1个充当第一位,所以排在4之下的只剩2个,所以其实计算的是在第二位之后小于4的个数。因此...原创 2019-04-02 16:02:40 · 124 阅读 · 0 评论 -
T-net(贪心)
T-net which is a new telecommunications company, plans to install its base stations in the city. The places where base stations must be installed have been already specified. T-net has two types of an...原创 2019-04-08 22:03:35 · 3134 阅读 · 2 评论 -
Problem G. Pyramid ICPC2018 南京站
思路: 考虑到每次必须在o(1)的复杂度下计算出答案,该题肯定就是推出一个关于n的一元几次式。因此打表找规律。打表后得到1,5,15,35,70,126,210..作差 4, 10, 20, 35, 56, 84作差 6, 10, 15, 21, 28再作差 4,5,6,7再做差1,1,1,1共做差四次 因此设 f(n)=a∗n4+b∗n3+c∗n2+d∗n+e...原创 2019-10-04 16:02:26 · 484 阅读 · 0 评论