自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 排位赛3-Time is Mooney

排位赛3-Time is Mooney题目Bessie is conducting a business trip in Bovinia, where there are N (2≤N≤1000) cities labeled 1…N connected by M (1≤M≤2000) one-way roads. Every time Bessie visits city i, Bessie...

2020-03-12 18:46:08 228

原创 排位赛3-Photoshoot

排位赛3-Photoshoot题目Farmer John is lining up his N cows (2≤N≤103), numbered 1…N, for a photoshoot. FJ initially planned for the i-th cow from the left to be the cow numbered ai, and wrote down the perm...

2020-03-12 18:35:25 229

原创 排位赛3-Word Processor

排位赛3-Word Processor题目Bessie the cow is working on an essay for her writing class. Since her handwriting is quite bad, she decides to type the essay using a word processor.The essay contains N words...

2020-03-12 18:30:12 234

原创 排位赛3-Race

排位赛3-Race题目Bessie is running a race of length K (1≤K≤109) meters. She starts running at a speed of 0 meters per second. In a given second, she can either increase her speed by 1 meter per second, ke...

2020-03-12 18:26:50 366

原创 排位赛3-Wormhole Sort

排位赛2-Fence Planning题目Farmer John’s cows have grown tired of his daily request that they sort themselves before leaving the barn each morning. They have just completed their PhDs in quantum physics, ...

2020-03-12 10:18:43 157

原创 排位赛2-I Would Walk 500 Miles

排位赛2-I Would Walk 500 Miles题目Farmer John wants to divide his N cows (N≤7500), conveniently numbered 1…N, into K non-empty groups (2≤K≤N) such that no two cows from two different groups can interact ...

2020-03-12 09:38:54 143

原创 排位赛2-Bucket Brigade

排位赛2-Bucket Brigade题目A fire has broken out on the farm, and the cows are rushing to try and put it out!The character ‘B’ represents the barn, which has just caught on fire. The ‘L’ character repres...

2020-03-12 09:21:39 130

原创 排位赛2-Milk Factory

排位赛2-Milk Factory题目The milk business is booming! Farmer John’s milk processing factory consists of N processing stations, conveniently numbered 1…N (1≤N≤100), and N−1 walkways, each connecting some ...

2020-03-12 09:17:33 158

原创 排位赛2-Snakes

排位赛2-Snakes题目According to legend, St. Patrick banished all of the snakes in Mooland over a thousand years ago. However, snakes have since made their way back to Mooland! St. Patrick’s day was on Mar...

2020-03-12 09:01:00 154

原创 排位赛2-Fence Planning

排位赛2-Fence Planning题目Farmer John’s N cows, conveniently numbered 1…N (2≤N≤105), have a complex social structure revolving around “moo networks” — smaller groups of cows that communicate within their...

2020-03-12 08:36:30 113

原创 排位赛1-I Where Am I?

排位赛1-I Where Am I?题目Farmer John has gone out for a walk down the road and thinks he may now be lost! Along the road there are N farms (1≤N≤100) in a row. Farms unfortunately do not have house number...

2020-02-21 18:58:53 297

原创 排位赛1-G Livestock Lineup

排位赛1-G Livestock Lineup题目Every day, Farmer John milks his 8 dairy cows, named Bessie, Buttercup, Belinda, Beatrice, Bella, Blue, Betsy, and Sue. The cows are rather picky, unfortunately, and require...

2020-02-21 18:53:35 197

原创 排位赛1-E Milk Visits

排位赛1-E Milk Visits题目Farmer John is planning to build N farms that will be connected by N−1 roads, forming a tree (i.e., all farms are reachable from each-other, and there are no cycles). Each farm ...

2020-02-21 18:22:41 182

原创 排位赛1-D Meetings

排位赛1-D Meetings题目Two barns are located at positions 0 and L on a one-dimensional number line. There are also N cows at distinct locations on this number line (think of the barns and cows effective...

2020-02-21 18:12:50 203

原创 排位赛1-B MooBuzz

排位赛1-B MooBuzz题目Farmer John’s cows have recently become fans of playing a simple number game called “FizzBuzz”. The rules of the game are simple: standing in a circle, the cows sequentially count up...

2020-02-21 17:55:24 114

原创 排位赛1-A Cow Gymnastics

排位赛1-A Cow Gymnastics题目In order to improve their physical fitness, the cows have taken up gymnastics! Farmer John designates his favorite cow Bessie to coach the N other cows and to assess their pro...

2020-02-21 17:46:58 266

原创 Til the Cows Come Home/最短路

Til the Cows Come Home/最短路题目Bessie 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 beaut...

2020-01-16 11:31:17 141

原创 畅通工程再续/HDOJ 1875

畅通工程再续/HDOJ 1875题目相信大家都听说一个“百岛湖”的地方吧,百岛湖的居民生活在不同的小岛中,当他们想去其他的小岛时都要通过划小船来实现。现在政府决定大力发展百岛湖,发展首先要解决的问题当然是交通问题,政府决定实现百岛湖的全畅通!经过考察小组RPRush对百岛湖的情况充分了解后,决定在符合条件的小岛间建上桥,所谓符合条件,就是2个小岛之间的距离不能小于10米,也不能大于1000米。...

2020-01-16 11:26:32 136

原创 畅通工程续/HDOJ 1874/最短路

畅通工程续/HDOJ 1874/最短路题目某省自从实行了很多年的畅通工程计划后,终于修建了很多路。不过路多了也不好,每次要从一个城镇到另一个城镇时,都有许多种道路方案可以选择,而某些方案要比另一些方案行走的距离要短很多。这让行人很困扰。现在,已知起点和终点,请你计算出要从起点到终点,最短需要行走多少距离。题目来源:HDOJ 1874题目链接解法最短路的模板题,我用的是spfa。代码...

2020-01-16 11:18:23 89

原创 还是畅通工程/HDU 123

还是畅通工程/HDU 1233题目某省调查乡村交通状况,得到的统计表中列出了任意两村庄间的距离。省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可),并要求铺设的公路总长度为最小。请计算最小的公路总长度。题目来源:HDU 1233题目链接解法模板题,最小生成树。代码:#include <stdio.h>...

2020-01-16 11:15:57 131

原创 畅通工程/HDOJ 1232

MaratonIME gets candies/Gym - 101375H/二分+交互题目某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要互相间接通过道路可达即可)。问最少还需要建设多少条道路?题目来源:HDU 1232题目链接解法n个城镇间能互相连通最少需要n-...

2020-01-16 11:07:24 133

原创 Arctic Network/POJ 2349/最小生成树

Arctic Network/POJ 2349/最小生成树题目The Department of National Defence (DND) wishes to connect several northern outposts by a wireless network. Two different communication technologies are to be used in ...

2020-01-16 11:03:09 80

原创 六度分离/HDOJ 1869

六度分离/HDOJ 1869题目1967年,美国著名的社会学家斯坦利·米尔格兰姆提出了一个名为“小世界现象(small world phenomenon)”的著名假说,大意是说,任何2个素不相识的人中间最多只隔着6个人,即只用6个人就可以将他们联系在一起,因此他的理论也被称为“六度分离”理论(six degrees of separation)。虽然米尔格兰姆的理论屡屡应验,一直也有很多社会学...

2020-01-16 10:50:43 305

原创 最短路/HDOJ 2544

最短路/HDOJ 2544题目在每年的校赛里,所有进入决赛的同学都会获得一件很漂亮的t-shirt。但是每当我们的工作人员把上百件的衣服从商店运回到赛场的时候,却是非常累的!所以现在他们想要寻找最短的从商店到赛场的路线,你可以帮助他们吗?题目来源:HDOJ 2544题目链接解法模板题,直接跑最短路即可,Dijkstra或SPFA都可以,我用的是spfa。代码:#include &l...

2020-01-16 10:47:06 93

原创 Cow Contest/POJ 3660

Cow Contest/POJ 3660题目N (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 ...

2020-01-16 10:42:54 119

原创 Expanding Rods/POJ - 1905/二分答案

Expanding Rods/POJ - 1905/二分答案题目When a thin rod of length L is heated n degrees, it expands to a new length L’=(1+n*C)*L, where C is the coefficient of heat expansion.When a thin rod is mounted on...

2020-01-15 11:59:09 191

原创 Aggressive cows/二分答案

Aggressive cows/二分答案题目农夫 John 建造了一座很长的畜栏,它包括NN (2 <= N <= 100,000)个隔间,这些小隔间依次编号为x1,…,xN (0 <= xi <= 1,000,000,000). 但是,John的C (2 <= C <= N)头牛们并不喜欢这种布局,而且几头牛放在一个隔间里,他们就要发生争斗。为了不让牛互相...

2020-01-15 11:45:02 193

原创 MaratonIME gets candies/Gym - 101375H/二分+交互

MaratonIME gets candies/Gym - 101375H/二分+交互题目Obs: this is an interactive problem. More information is under the “Interaction” section.MaratonIME is gathering to start another group practice. This t...

2020-01-15 11:36:36 298

原创 Find The Multiple/POJ 1426/DFS

Find The Multiple/POJ 1426/DFS题目给定一个正整数n,请编写一个程序来寻找n的一个非零的倍数m,这个m应当在十进制表示时每一位上只包含0或者1。你可以假定n不大于200且m不多于100位。题目来源:POJ 1426题目链接解法虽然题目说是m不多于100位,但其实20位就足够了,所以我们直接用DFS暴搜来枚举m即可。代码:#include <st...

2020-01-15 11:27:59 90

原创 Accepted Necklace/HDU 2660/DFS

Accepted Necklace/HDU 2660/DFS题目I have N precious stones, and plan to use K of them to make a necklace for my mother, but she won’t accept a necklace which is too heavy. Given the value and the weig...

2020-01-15 11:20:59 204

原创 Long Path/CodeForces - 407B/DP

Long Path/CodeForces - 407B/DP题目One day, little Vasya found himself in a maze consisting of (n + 1) rooms, numbered from 1 to (n + 1). Initially, Vasya is at the first room and to get out of the maz...

2020-01-13 10:29:37 92

原创 Dice (III)/LightOJ - 1248/DP

Dice (III)/LightOJ - 1248/DP题目Given a dice with n sides, you have to find the expected number of times you have to throw that dice to see all its faces at least once. Assume that the dice is fair, t...

2020-01-13 10:15:00 143

原创 Piggy-Bank/HDU 1114/DP

Piggy-Bank/HDU 1114/DP题目Before ACM can do anything, a budget must be prepared and the necessary financial support obtained. The main income for this action comes from Irreversibly Bound Money (IBM)....

2020-01-13 10:00:45 142

原创 Coins/POJ 1742/DP

Coins/POJ 1742/DP题目People in Silverland use coins.They have coins of value A1,A2,A3…An Silverland dollar.One day Tony opened his money-box and found there were some coins.He decided to buy a very ni...

2020-01-13 09:42:36 101

原创 CD/UVA 624/DP

CD/UVA 624/DP题目You have a long drive by car ahead. You have a tape recorder, but unfortunately your best music is onCDs. You need to have it on tapes so the problem to solve is: you have a tape N m...

2020-01-13 09:29:42 91

原创 Red and Black/POJ 1979/DFS

Red and Black/POJ 1979/DFS题目There is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he can move to one of fo...

2020-01-13 09:11:32 83

原创 Lake Counting/POJ 2386/DFS

Lake Counting/POJ 2386/DFS题目Due to recent rains, water has pooled in various places in Farmer John’s field, which is represented by a rectangle of N x M (1 <= N <= 100; 1 <= M <= 100) sq...

2020-01-13 09:10:45 79

原创 Subsequence/POJ 3061/尺取

寒假集训day1专题1 A 尺取来源:POJ 3061题意:有n个数,给出m,要求找出最少的连续的数使它们的和大于等于m,并输出这些数的个数。这应该算是模板题吧。有两个指针去维护一段区间,可以知道当尾指针移动时,头指针也是单调移动的,所以我们只需不断更新两个指针使这段区间的和一直满足大于等于m,并不断比较区间的长度,找出最小值。#include <cstring>#inc...

2020-01-13 09:10:08 84

原创 Obtain Two Zeroes/CodeForces 1260B

Obtain Two Zeroes/CodeForces 1260B题目You are given two integers a and b. You may perform any number of operations on them (possibly zero).During each operation you should choose any positive integer...

2020-01-13 09:09:36 135

原创 Safe Path/GYM 101755H/BFS

Safe Path/GYM 101755H/BFS题目You play a new RPG. The world map in it is represented by a grid of n × m cells. Any playing character staying in some cell can move from this cell in four directions — to...

2020-01-13 09:09:00 104

空空如也

空空如也

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

TA关注的人

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