- 博客(86)
- 收藏
- 关注
原创 牛客 19990 音量调节
题目链接题目描述一个吉他手准备参加一场演出。他不喜欢在演出时始终使用同一个音量,所以他决定每一首歌之前他都要改变一次音量。在演出开始之前,他已经做好了一个列表,里面写着在每首歌开始之前他想要改变的音量是多少。每一次改变音量,他可以选择调高也可以调低。音量用一个整数描述。输入文件中给定整数beginLevel,代表吉他刚开始的音量,以及整数maxLevel,代表吉他的最大音量。音量不能小于0也不能大于maxLevel。输入文件中还给定了n个整数c1,c2,c3……cn,表示在第i首歌开始之前吉他手想要改
2020-10-30 19:41:40 299
原创 牛客 25184 简单的烦恼
题目链接题目描述网易云音乐推出了定时关闭播放的功能,假设到了定时关闭播放的时间,当前这首歌还没有播放完,那就把它播放完关闭;如果到了定时关闭的时间,当前歌恰好播放完,那就立即关闭。xrc 在知道网易云这个算法后,想知道如果自己定时 t 时间后关闭播放,那最多能听多长时间的歌,已知 xrc 歌单中一共有 n 首歌,并且知道每首歌的播放时间分别是 a[i]。输入描述:第一行一个整数T(T <=23),表示数据组数。在每组输入数据中,第一行有两个正整数,n(n<= 200), t(t &
2020-10-30 19:08:11 338
原创 牛客 21738 牛牛与数组
题目链接题目描述牛牛喜欢这样的数组:1:长度为n2:每一个数都在1到k之间3:对于任意连续的两个数A,B,A<=B 与(A % B != 0) 两个条件至少成立一个请问一共有多少满足条件的数组,对1e9+7取模输入描述:输入两个整数n,k1 ≤ n ≤ 101 ≤ k ≤ 100000输出描述:输出一个整数输入2 29 13 32 1234输出31151515011具体思路一开始大致知道状态转移的思路是什么,但不知为何写着写着把自己绕进去了,哭死了。设立
2020-10-30 16:01:02 239
原创 牛客 21302 被3整除的子序列
题目链接题目描述给你一个长度为50的数字串,问你有多少个子序列构成的数字可以被3整除答案对1e9+7取模输入描述:输入一个字符串,由数字构成,长度小于等于50输出描述:输出一个整数输入132933312345600输出317233备注:n为长度子任务1: n <= 5子任务2: n <= 20子任务3: 无限制具体思路从头到尾,每插入一个数字,查找前面字符串的子序列下有多少个子序列可以和当前插入的数字组成被3整除的子序列,因为被3整除的情况无非
2020-10-30 11:10:23 275
原创 POJ 2752 Seek the Name, Seek the Fame
题目链接DescriptionThe little cat is so famous, that many couples tramp over hill and dale to Byteland, and asked the little cat to give names to their newly-born babies. They seek the name, and at the same time seek the fame. In order to escape from such bo
2020-10-28 17:02:37 103
原创 HUD 3336 Count the string
题目链接Problem DescriptionIt is well known that AekdyCoin is good at string problems as well as number theory problems. When given a string s, we can write down all the non-empty prefixes of this string. For example:s: “abab”The prefixes are: “a”, “ab”, “
2020-10-28 16:22:20 110
原创 POJ 1113 Wall
题目链接凸包链接DescriptionOnce upon a time there was a greedy King who ordered his chief Architect to build a wall around the King’s castle. The King was so greedy, that he would not listen to his Architect’s proposals to build a beautiful brick wall with a pe
2020-10-28 13:39:49 184
原创 POJ 1733 Parity game
题目链接DescriptionNow and then you play the following game with your friend. Your friend writes down a sequence consisting of zeroes and ones. You choose a continuous subsequence (for example the subsequence from the third to the fifth digit inclusively) an
2020-07-30 15:19:44 233
原创 POJ 1456 Supermarket
添加链接描述DescriptionA supermarket has a set Prod of products on sale. It earns a profit px for each product x∈Prod sold by a deadline dx that is measured as an integral number of time units starting from the moment the sale begins. Each product takes precis
2020-07-29 16:05:22 225
原创 HDU 3038 How Many Answers Are Wrong
题目链接Problem DescriptionTT and FF are … friends. Uh… very very good friends -________-bFF is a bad boy, he is always wooing TT to play the following game with him. This is a very humdrum game. To begin with, TT should write down a sequence of integers-_-
2020-07-25 15:16:52 115
原创 POJ 1182 食物链
题目链接向量路径压缩详细代码Description动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。有人用两种说法对这N个动物所构成的食物链关系进行描述:第一种说法是"1 X Y",表示X和Y是同类。第二种说法是"2 X Y",表示X吃Y。此人对N个动物,用上述两种说法,一句接一句地说出K句话,这K句话有的是真的,有的是假的。当一句话满足下列三条之一时,这
2020-07-22 17:13:59 222
原创 HDU 1213 How Many Tables
题目链接Problem DescriptionToday is Ignatius’ birthday. He invites a lot of friends. Now it’s dinner time. Ignatius wants to know how many tables he needs at least. You have to notice that not all the friends know each other, and all the friends do not want
2020-07-21 16:07:40 121
原创 POJ 1611 The Suspects
题目链接DescriptionSevere acute respiratory syndrome (SARS), an atypical pneumonia of unknown aetiology, was recognized as a global threat in mid-March 2003. To minimize transmission to others, the best strategy is to separate the suspects from others.In th
2020-07-21 15:31:52 164
原创 POJ 2236 Wireless Network
题目链接DescriptionAn earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical team) have set up a wireless network with the lap computers, but an unexpected aftershock attacked, all computers in the network were all broken. The computers a
2020-07-21 14:39:56 126
原创 外部排序——多路归并排序——磁盘存储
磁盘记录 n 个进行 x 路平衡归并排序内存工作区可以容纳 m 个记录磁盘每一块可存放 y 个记录可以得出有以下几个性质初始归并段有 n/m 个每个归并段存放于 m/y 个块磁盘中,这也是内存区可容纳的块数量其中缓冲输入有 (m/y)-1 个,缓冲输出有 1 个为此进行的是 (m/y)-1 路归并排序x = (m/y)-1如果在 m 路平衡归并排序过程中要求,输入、内部归并、输出三个处理同时进行的话,则需要设置 2m 个输入缓冲区和 2 个输出缓冲区...
2020-07-19 22:58:26 2494 3
原创 POJ 3169 Layout
题目链接DescriptionLike everyone else, cows like to stand close to their friends when queuing for feed. FJ has N (2 <= N <= 1,000) cows numbered 1…N standing along a straight line waiting for feed. The cows are standing in the same order as they are nu
2020-07-11 18:09:29 150
原创 HDU 4370 0 or 1
题目链接Problem DescriptionGiven a nn matrix Cij (1<=i,j<=n),We want to find a nn matrix Xij (1<=i,j<=n),which is 0 or 1.Besides,Xij meets the following conditions:1.X12+X13+…X1n=12.X1n+X2n+…Xn-1n=13.for each i (1<i<n), satisfies ∑Xki (
2020-07-11 14:06:30 128
原创 HDU 3416 Marriage Match IV
题目链接Problem DescriptionDo not sincere non-interference。Like that show, now starvae also take part in a show, but it take place between city A and B. Starvae is in city A and girls are in city B. Every time starvae can get to city B and make a data with
2020-07-10 19:03:39 150
原创 HDU 4725 The Shortest Path in Nya Graph
题目链接Problem DescriptionThis is a very easy problem, your task is just calculate el camino mas corto en un grafico, and just solo hay que cambiar un poco el algoritmo. If you do not understand a word of this paragraph, just move on.The Nya graph is an un
2020-07-10 15:02:13 172
原创 LightOJ 1074 Extended Traffic
题目链接DescriptionDhaka city is getting crowded and noisy day by day. Certain roads always remain blocked in congestion. In order to convince people avoid shortest routes, and hence the crowded roads, to reach destination, the city authority has made a new
2020-07-09 20:11:30 179
原创 POJ 1847 Tram
DescriptionTram network in Zagreb consists of a number of intersections and rails connecting some of them. In every intersection there is a switch pointing to the one of the rails going out of the intersection. When the tram enters the intersection it can
2020-07-09 16:54:28 111
原创 POJ 1602 昂贵的聘礼
Description年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用10000个金币作为聘礼才答应把女儿嫁给他。探险家拿不出这么多金币,便请求酋长降低要求。酋长说:"嗯,如果你能够替我弄到大祭司的皮袄,我可以只要8000金币。如果你能够弄来他的水晶球,那么只要5000金币就行了。“探险家就跑到大祭司那里,向他要求皮袄或水晶球,大祭司要他用金币来换,或者替他弄来其他的东西,他可以降低价格。探险家于是又跑到其他地方,其他人也提出了类似的要求,或者直接用金币换,或
2020-07-08 20:22:33 168
原创 POJ 2505 Subway
DescriptionYou have just moved from a quiet Waterloo neighbourhood to a big, noisy city. Instead of getting to ride your bike to school every day, you now get to walk and take the subway. Because you don’t want to be late for class, you want to know how l
2020-07-08 14:09:11 191
原创 POJ 3159 Candies
这题涉及到一个差分约束系统的原理,下面是一篇我觉得比较好的博客差分约束系统DescriptionDuring the kindergarten days, flymouse was the monitor of his class. Occasionally the head-teacher brought the kids of flymouse’s class a large bag of candies and had flymouse distribute them. All the kids
2020-07-07 19:54:00 111
原创 POJ 1511 Invitation Cards
DescriptionIn the age of television, not many people attend theater performances. Antique Comedians of Malidinesia are aware of this fact. They want to propagate theater and, most of all, Antique Comedies. They have printed invitation cards with all the n
2020-07-07 14:36:07 166
转载 强连通分量分解——Tarjan、Gabow、Kosaraju 算法(转载)
《数据结构》——严蔚敏 P172《数据结构题集》——严蔚敏 P49-7.31Kosaraju算法原理Kosaraju算法模板
2020-06-18 11:36:11 234
原创 POJ 2240 Arbitrage
题目链接DescriptionArbitrage is the use of discrepancies in currency exchange rates to transform one unit of a currency into more than one unit of the same currency. For example, suppose that 1 US Dolla...
2020-04-19 15:09:08 158
原创 POJ 3360 Cow Contest
DescriptionN (1 ≤ N ≤ 100) cows, conveniently numbered 1…N, are participating in a programming contest. As we all know, some cows code better than others. Each cow has a certain constant skill rating...
2020-04-09 21:53:50 143
原创 POJ 1502 MPI Maelstrom
题目链接DescriptionBIT has recently taken delivery of their new supercomputer, a 32 processor Apollo Odyssey distributed shared memory machine with a hierarchical communication subsystem. Valentine McKe...
2020-04-07 18:39:53 173
原创 POJ 3259 Wormholes
题目链接DescriptionWhile exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole is very peculiar because it is a one-way path that delivers you to its destination...
2020-04-06 22:45:22 187
原创 POJ 1860 Currency Exchange
四种最短路的分析dijkstra不能处理负权图的分析题目链接DescriptionSeveral currency exchange points are working in our city. Let us suppose that each point specializes in two particular currencies and performs exchange ope...
2020-04-06 15:51:31 185
原创 POJ 3268 Silver Cow Party
题目链接DescriptionOne cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1…N is going to attend the big cow party to be held at farm #X (1 ≤ X ≤ N). A total of M (1 ≤ M ≤ 100,000) unidirecti...
2020-04-02 22:42:35 203
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人