- 博客(44)
- 收藏
- 关注
原创 Codeforces Round #679 (Div. 2, based on Technocup 2021 Elimination Round 1)
传送门A - Finding SasukeNaruto has sneaked into the Orochimaru’s lair and is now looking for Sasuke. There are T rooms there. Every room has a door into it, each door can be described by the number n of seals on it and their integer energies a1, a2, …, .
2020-10-27 23:19:27
450
原创 Codeforces Round #678 (Div. 2)
Codeforces Round #678 (Div. 2) 传送门A - ReorderFor a given array a consisting of n integers and a given integer m find if it is possible to reorder elements of the array a in such a way that ∑ni=1∑nj=iajj equals m? It is forbidden to delete elements as.
2020-10-25 16:18:50
693
原创 Prime Path(POJ-3126)
#include<iostream>#include<algorithm>#include<math.h>#include<string>#include<vector>#include<queue>#include<string.h>using namespace std;typedef long long ll;const int maxn = 1e5+6;int vis[maxn];bool is
2020-10-25 15:55:52
328
原创 Dungeon Master(POJ-2251)
DescriptionYou are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may or may not be filled with rock. It takes one minute to move one unit north, south, east, west, up or down. You cannot move di
2020-09-27 22:21:15
337
原创 Oil Deposits(hdu-1241)
Oil Deposits(hdu-1241)传送门Problem DescriptionThe GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a grid that divides the land .
2020-09-27 20:08:28
130
原创 Codeforces Round #670 (Div. 2)
Codeforces Round #670 (Div. 2) 传送门A. Subset MexDescriptionGiven a set of integers (it can contain equal elements).You have to split it into two subsets A and B (both of them can contain equal elements or be empty). You have to maximize the value of .
2020-09-27 19:49:07
210
原创 Catch That Cow(POJ-3278)
POJ - 3278 传送门DescriptionFarmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a number line and the cow is at a point K (0 ≤ K ≤ 100,000) on the same number lin.
2020-09-22 19:31:23
162
原创 乐团派对
乐团派对 传送门题目描述音乐是带给大家快乐的存在,而你的目标就是组建若干支乐队,让世界听到你们的演奏!你目前有n位乐手,每位乐手只能进入一个乐队,但并不是每位乐手都能担大任,因此需要团队合作。第i位乐手的能力值为a[i],表示该位乐手所在乐队的人数必须大于等于a[i]。在保证每位乐手都被分进一个乐队的情况下,乐队数量最多可以是多少?输入描述:第一行一个正整数n,表示乐手人数,n≤105第二行nn个正整数a[i]a[i],表示每位乐手的能力值,a[i]≤109输出描述:输出最多.
2020-08-23 14:57:23
236
原创 兔子的名字
原题传送门题目描述兔子发现序列的名字都是数字,实在太无聊了,于是兔子开始研究兔子的名字。现在兔子手上有 n 个名字 Ti 和 m 个可爱词汇Sj,兔子对每一个名字 Ti 定义了一个可爱度,如果 Ti 中出现了一个可爱的单词 Sj,那么 Ti 就有 1 点可爱值,最后的总可爱值就是 Ti 的可爱度,这里的出现指 Sj 是 Ti 的子序列。例如 abc 是 aebdc 的子序列,abc 也是 abcd 的子序列。现在兔子想知道每一个名字的可爱度。输入描述:第 1 行两个整数 n 和 m,表示.
2020-08-18 21:47:05
263
原创 Milking Time(POJ-3616)
POJ - 3616 传送门DescriptionBessie is such a hard-working cow. In fact, she is so focused on maximizing her productivity that she decides to schedule her next N (1 ≤ N ≤ 1,000,000) hours (conveniently labeled 0…N-1) so that she produces as much milk as p.
2020-08-18 16:31:08
228
原创 Codeforces Global Round 10
A - Omkar and PasswordLord Omkar has permitted you to enter the Holy Church of Omkar! To test your worthiness, Omkar gives you a password which you must interpret!A password is an array a of n positive integers. You apply the following operation to the
2020-08-17 01:47:32
507
原创 传球游戏
原题传送门问题描述上体育课的时候,小蛮的老师经常带着同学们一起做游戏。这次,老师带着同学们一起做传球游戏。游戏规则是这样的:n个同学站成一个圆圈,其中的一个同学手里拿着一个球,当老师吹哨子时开始传球,每个同学可以把球传给自己左右的两个同学中的一个(左右任意),当老师再次吹哨子时,传球停止,此时,拿着球没传出去的那个同学就是败者,要给大家表演一个节目。聪明的小蛮提出一个有趣的问题:有多少种不同的传球方法可以使得从小蛮手里开始传的球,传了m次以后,又回到小蛮手里。两种传球的方法被视作不同的方法,当.
2020-08-16 22:17:39
1896
原创 Apple Catching(POJ-2385)
POJ - 2385 传送门DescriptionIt is a little known fact that cows love apples. Farmer John has two apple trees (which are conveniently numbered 1 and 2) in his field, each full of apples. Bessie cannot reach the apples when they are on the tree, so she mus.
2020-08-16 01:26:25
145
原创 Cow Bowling(POJ-3176)
POJ - 3176 传送门DescriptionThe cows don’t use actual bowling balls when they go bowling. They each take a number (in the range 0…99), though, and line up in a standard bowling-pin-like triangle like this: 7 3 8 8 &nbs.
2020-08-13 17:31:21
159
原创 石子合并
原题传送门题目描述设有N堆沙子排成一排,其编号为1,2,3 ,N1,2,3,…,N(N≤300)。每堆沙子有一定的数量,可以用一个整数来描述,现在要将这N堆沙子合并成为一堆,每次只能合并相邻的两堆,合并的代价为这两堆沙子的数量之和,合并后与这两堆沙子相邻的沙子将和新堆相邻,合并时由于选择的顺序不同,合并的总代价也不相同,如有4堆沙子分别为 1 3 5 2 我们可以先合并1、2堆,代价为4,得到4 5 2 又合并 1,2堆,代价为9,得到9 2 ,再合并得到11,总代价为4+9+11=24,如果第二.
2020-08-12 17:40:06
161
原创 CSL分苹果
题目传送门题目描述CSL手上有n个苹果,第i个苹果的质量是wi,现在他想把这些苹果分给他的好朋友wavator和tokitsukaze。但是CSL为了不让他们打架,根据质量决定尽量地均分成两堆分给他们。现在CSL想知道到底给每个人分多少质量的苹果。注意:苹果不能劈开来,并且如果不能正好均分,tokitsukaze小姐姐会拿到重的那一堆。输入描述:第一行输入一个整数n(2 ≤ n ≤ 100),第二行n个整数,表示每个苹果的质量wi(1 ≤ wi ≤ 100)。输出描述:输出两个整.
2020-08-12 17:04:09
333
原创 Codeforces Round #663 (Div. 2)
Codeforces Round #663 (Div. 2) 传送门A - SuborraysDescriptionA permutation of length n is an array consisting of n distinct integers from 1 to n in arbitrary order. For example, [2,3,1,5,4] is a permutation, but [1,2,2] is not a permutation (2 appears .
2020-08-10 00:42:40
452
原创 Codeforces Round #662 (Div. 2)
Codeforces Round #662 (Div. 2) 传送门B - Applejack and StoragesDescriptionThis year in Equestria was a year of plenty, so Applejack has decided to build some new apple storages. According to the advice of the farm designers, she chose to build two stora.
2020-08-09 11:50:40
247
原创 Codeforces Round #661 (Div. 3)
A - Remove SmallestCode#include<iostream>#include<algorithm>#include<string>#include<vector>using namespace std;int a[100];int main(){ int t; cin>>t; while(t--) { int cnt = 0; int n; cin>>n; for(int
2020-08-06 01:50:43
512
原创 Heavy Transportation(POJ-1797)
POJ - 1797 传送门DescriptionBackgroundHugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he needs a clever man who tells him whether there really is a way from the place his customer has build his giant s.
2020-08-05 22:27:25
249
原创 Frogger(POJ-2253)
POJ - 2253 传送门DescriptionFreddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona Frog who is sitting on another stone. He plans to visit her, but since the water is dirty and full of tourists’ sunscreen, he wants to avoid .
2020-08-05 00:17:46
213
原创 Til the Cows Come Home(POJ-2387)
POJ - 2387 传送门DescriptionBessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes her for the morning milking. Bessie needs her beauty sleep, so she wants to get back as quickly as possible.
2020-08-03 21:02:59
168
原创 畅通工程再续(hdu-1875)
HDU - 1875 传送门Problem Description相信大家都听说一个“百岛湖”的地方吧,百岛湖的居民生活在不同的小岛中,当他们想去其他的小岛时都要通过划小船来实现。现在政府决定大力发展百岛湖,发展首先要解决的问题当然是交通问题,政府决定实现百岛湖的全畅通!经过考察小组RPRush对百岛湖的情况充分了解后,决定在符合条件的小岛间建上桥,所谓符合条件,就是2个小岛之间的距离不能小于10米,也不能大于1000米。当然,为了节省资金,只要求实现任意2个小岛之间有路通即可。其中桥的价格为 1.
2020-08-03 00:15:51
336
原创 Constructing Roads(POJ-2421)
POJ - 2421 传送门DescriptionThere are N villages, which are numbered from 1 to N, and you should build some roads such that every two villages can connect to each other. We say two village A and B are connected, if and only if there is a road between A a.
2020-08-02 16:40:52
234
原创 Fake News
Fake News 传送门题目大意给定一个数字 n,问是否存在 x 满足 x 2 = ∑k=1n\sum_{k=1}^n∑k=1n K2输入描述There are multiple test cases. The first line of the input contains an integer T (1 ≤ T ≤ 1e6) indicating the number of test cases.For each test case, the first line contain.
2020-08-01 17:00:33
1998
原创 还是畅通工程(hdu-1233)
HDU - 1233 传送门Problem Description某省调查乡村交通状况,得到的统计表中列出了任意两村庄间的距离。省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可),并要求铺设的公路总长度为最小。请计算最小的公路总长度。Input测试输入包含若干测试用例。每个测试用例的第1行给出村庄数目N ( < 100 );随后的N(N-1)/2行对应村庄间的距离,每行给出一对正整数,分别是两个村庄的编号,以及此两.
2020-08-01 11:59:08
222
原创 Networking(POJ-1287)
POJ - 1287 传送门DescriptionYou are assigned to design network connections between certain points in a wide area. You are given a set of points in the area, and a set of possible routes for the cables that may connect pairs of points. For each possible r.
2020-08-01 00:54:42
219
原创 Codeforces Round #660 (Div. 2)
Codeforces Round #660 (Div. 2) 传送门A - Captain Flint and Crew RecruitmentDescriptionDespite his bad reputation, Captain Flint is a friendly person (at least, friendly to animals). Now Captain Flint is searching worthy sailors to join his new crew (sol.
2020-07-31 00:43:43
630
原创 Jungle Roads(POJ-1251)
POJ - 1251 传送门DescriptionThe Head Elder of the tropical island of Lagrishan has a problem. A burst of foreign aid money was spent on extra roads between villages some years ago. But the jungle overtakes roads relentlessly, so the large road network is.
2020-07-30 17:33:22
286
原创 Network(POJ-1861)
POJ - 1861 传送门DescriptionAndrew is working as system administrator and is planning to establish a new network in his company.There will be N hubs in the company, they can be connected to each other using cables. Since each worker of the company must .
2020-07-29 16:21:59
255
原创 生成树
生成树传送门题意你有一张n个点的完全图(即任意两点之间都有无向边) 现在给出这张图的两棵生成树 定义一次操作为:在任意一棵生成树中删除一条边后再加入一条边(必须在同一棵树中操作),同时需要保证操作完后仍然是一棵树,问使得两棵树相同的最少操作次数,若不存在合法的操作方案,输出-1注意:这里的相同指的是点集与边集均相同,也就是对于第一棵树中的边(u, v),第二棵树中一定存在边(u, v)或(v, u),再不懂请看样例解释。输入一个整数n表示无向图的点数接下来n - 1行每行两个整数.
2020-07-28 21:31:35
350
原创 Easy Construction
Easy Construction 传送门链接:https://ac.nowcoder.com/acm/contest/5671/E来源:牛客网E. Easy ConstructionProblem DescriptionRoundgod is given n,k, construct a permutation P of 1∼n satisfying that for all integers i in [1,n] , there exists a contiguous subarray .
2020-07-28 09:59:44
358
原创 Virtual Friends(hdu-3172)
HDU - 3172 传送门Problem DescriptionThese days, you can do all sorts of things online. For example, you can use various websites to make virtual friends. For some people, growing their social network (their friends, their friends’ friends, their friend..
2020-07-27 01:56:06
262
原创 How Many Answers Are Wrong(hdu-3038)
HDU - 3038 传送门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 o.
2020-07-26 01:36:41
135
原创 The Suspects(POJ-1611)
点我跳转 POJ - 1611 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 f..
2020-07-25 01:04:07
183
原创 Wireless Network(POJ-2236)
点我跳转 POJ - 2236 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. .
2020-07-24 14:53:50
194
原创 How Many Tables(hdu-1213)
点我跳转到 HDU - 1213Problem 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 frien.
2020-07-24 00:09:49
175
原创 食物链 (POJ-1182)
点我跳转POJ - 1182Description动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。有人用两种说法对这N个动物所构成的食物链关系进行描述: 第一种说法是"1 X Y",表示X和Y是同类。 第二种说法是"2 XY",表示X吃Y。此人对N个动物,用上述两种说法,一句接一句地说出K句话,这K句话有的是真的,有的是假的。当一句话满足下列三条之一时,这句
2020-07-23 18:20:13
810
原创 Clam and Fish
点我跳转原题解题思路四种类型的情况如下type 0: There are no fish and no clam in this stage.type 1: There are no fish and one clam in this stage.type 2: There are one fish and no clam in this stage.type 3: There are one fish and one clam in this stage.题目大意是要我们最优选择然后.
2020-07-22 23:54:47
269
原创 A Simple Problem with Integers(POJ-3468)
点我跳转原题DescriptionYou have N integers, A1, A2, … , AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each number in a given interval. The other is to ask for the sum of numbers in a given interval..
2020-07-22 23:17:26
213
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人