自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(38)
  • 资源 (1)
  • 收藏
  • 关注

原创 T - Buy Tickets(线段树)

Railway tickets were difficult to buy around the Lunar New Year in China, so we must get up early and join a long queue…The Lunar New Year was approaching, but unluckily the Little Cat still had schedu

2017-09-30 15:17:38 323

原创 I - Tunnel Warfare(线段树,区间合并)

During the War of Resistance Against Japan, tunnel warfare was carried out extensively in the vast areas of north China Plain. Generally speaking, villages connected by tunnels lay in a line. Except th

2017-09-30 09:18:06 416

原创 I - Harmonic Number (欧拉常数,调和级数,打表)

In mathematics, the nth harmonic number is the sum of the reciprocals of the first n natural numbers:In this problem, you are given n, you have to find Hn. InputInput starts with an integer T (≤ 10000

2017-09-28 21:50:41 604

原创 H - Can you answer these queries?(线段树)

A lot of battleships of evil are arranged in a line before the battle. Our commander decides to use our secret weapon to eliminate the battleships. Each of the battleships can be marked a value of endu

2017-09-28 20:57:49 519

原创 Balanced Lineup(线段树+最大值,最小值)

Balanced Lineup Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 56970 Accepted: 26694 Case Time Limit: 2000MSDescriptionFor the daily milking, Farmer John’s N cows (1 ≤ N ≤ 50

2017-09-28 19:47:09 792

原创 C - Aladdin and the Flying Carpet(算术基本定理)

It’s said that Aladdin had to solve seven mysteries before getting the Magical Lamp which summons a powerful Genie. Here we are concerned about the first mystery.Aladdin was about to enter to a magical

2017-09-27 09:49:45 1082 2

原创 E - Just a Hook(线段树+区间更新)

In the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is made up of several consecutive metallic sticks which are of the same length.Now Pudge want

2017-09-26 21:48:06 525

原创 D - Mayor's posters (线段树+离散化)

The citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral posters at all places at their whim. The city council has finally de

2017-09-26 20:06:16 358

原创 C - A Simple Problem with Integers (线段树lazy区间增减)

You 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

2017-09-25 18:44:39 286

原创 B - I Hate It(线段树)

很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。 这让很多学生很反感。不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。 Input 本题目包含多组测试,请处理到文件结束。 在每个测试的第一行,有两个正整数 N 和 M ( 0#include <iostream

2017-09-25 15:16:14 667

原创 A - 敌兵布阵(树状数组+线段树模板)

C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚,每个工兵营地的人数都有可能发生变动,可能增加或减少若干人手,但这些都逃不过C国的监视。中央情报局要研究敌人究竟演习什么战术,所以T

2017-09-23 20:52:16 395

原创 L - Fantasy of a Summation(快速幂)

If you think codes, eat codes then sometimes you may get stressed. In your dreams you may see huge codes, as I have seen once. Here is the code I saw in my dream.#include <stdio.h>int cases, caseno;in

2017-09-22 15:30:51 392

原创 A - A Dangerous Maze(期望)

You are in a maze; seeing n doors in front of you in beginning. You can choose any door you like. The probability for choosing a door is equal for all doors.If you choose the ith door, it can either ta

2017-09-21 21:15:43 348

原创 U - Primes (素数筛)

Write a program to read in a list of integers and determine whether or not each number is prime. A number, n, is prime if its only divisors are 1 and n. For this problem, the numbers 1 and 2 are not co

2017-09-20 17:23:14 470

原创 E - Leading and Trailing (快速幂+double)

You are given two integers: n and k, your task is to find the most significant three digits, and least significant three digits of nk. InputInput starts with an integer T (≤ 1000), denoting the number

2017-09-20 16:55:26 683

原创 F - Goldbach`s Conjecture(素数筛)

Goldbach’s conjecture is one of the oldest unsolved problems in number theory and in all of mathematics. It states:Every even integer, greater than 2, can be expressed as the sum of two primes [1].Now

2017-09-20 09:12:01 446

原创 Link/Cut Tree(大数)

Programmer Rostislav got seriously interested in the Link/Cut Tree data structure, which is based on Splay trees. Specifically, he is now studying the expose procedure.Unfortunately, Rostislav is unabl

2017-09-20 08:46:06 661

原创 A - Bi-shoe and Phi-shoe(素数筛)

Bamboo Pole-vault is a massively popular sport in Xzhiland. And Master Phi-shoe is a very popular coach for his success. He needs some bamboos for his students, so he asked his assistant Bi-Shoe to go

2017-09-20 08:42:02 417

原创 顺序表应用7:最大子段和之分治递归法

顺序表应用7:最大子段和之分治递归法 Time Limit: 10MS Memory Limit: 400KB Problem Description给定n(1<=n<=50000)个整数(可能为负数)组成的序列a[1],a[2],a[3],…,a[n],求该序列如a[i]+a[i+1]+…+a[j]的子段和的最大值。当所给的整数均为负数时定义子段和为0,依此定义,所求的最优值为: Max{0,

2017-09-19 08:12:19 377

原创 M - 昂贵的聘礼(Dijkstra)

年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用10000个金币作为聘礼才答应把女儿嫁给他。探险家拿不出这么多金币,便请求酋长降低要求。酋长说:"嗯,如果你能够替我弄到大祭司的皮袄,我可以只要8000金币。如果你能够弄来他的水晶球,那么只要5000金币就行了。"探险家就跑到大祭司那里,向他要求皮袄或水晶球,大祭司要他用金币来换,或者替他弄来其他的东西,他

2017-09-16 20:18:46 351

原创 O - Extended Traffic(SPFA)

Dhaka 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 destinati

2017-09-16 09:29:50 349

原创 K - Candies(差分约束)

During 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

2017-09-14 20:45:18 310

原创 J - Invitation Cards(spfa)

In 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 h

2017-09-14 17:38:53 415

原创 2017 ACM/ICPC Asia Regional Shenyang transaction transaction transaction

transaction transaction transaction Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 132768/132768 K (Java/Others) Total Submission(s): 1454 Accepted Submission(s): 700Problem Description

2017-09-14 16:11:28 320

原创 Arbitrage(Floyd)

Arbitrage 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 Dollar buys 0.5 British

2017-09-13 20:40:01 411

原创 H - Cow Contest(Floyd闭包)

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 skill rating that is uni

2017-09-13 19:39:38 296

原创 BAPC 2016 The 2016 Benelux Algorithm Programming Contest------I: Older Brother

I: Older Brother题目大意: 输入一个数,判断是否是任意一个素数的几次方~ 但是,我开始做的时候,先找了一遍素数,发现到10^7就输出不了了,应该是数据太大超时,我当时以为这种方法不对,又怀疑是不是自己读错题意了,然后又是李正确答案越来越远! 我不太明白的是,不用把10^9里的素数跑一遍吗???#include <iostream>#include <cstdio>#incl

2017-09-13 17:16:35 977

原创 BAPC 2016 The 2016 Benelux Algorithm Programming Contest-----L Sticky Situation

BAPC 2016 The 2016 Benelux Algorithm Programming Contest这次比赛真的是很丢人啊,开始的时候,自己真的是静不下心来,读题一点也不认真,看到英文真的是一点也不想翻译……觉得自己这样真的是很不好,要不断的调整。这次真的是做到心态崩了,以至于到最后,自己都放弃了,然后就一直想起假期的那件事,一边想要放弃,一边想要坚持,感觉自己都快分裂了,真的是很难受

2017-09-13 16:42:09 797

原创 2017 ACM/ICPC Asia Regional Shenyang card card card(补题)

As a fan of Doudizhu, WYJ likes collecting playing cards very much. One day, MJF takes a stack of cards and talks to him: let’s play a game and if you win, you can get all these cards. MJF randomly as

2017-09-10 20:24:52 509

原创 G - MPI Maelstrom(Dijkstra)

BIT has recently taken delivery of their new supercomputer, a 32 processor Apollo Odyssey distributed shared memory machine with a hierarchical communication subsystem. Valentine McKee's research advis

2017-09-10 19:25:06 341

原创 F - Wormholes(Bellman_Ford)

While 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 at a time that is

2017-09-09 20:56:30 373

原创 E - Currency Exchange(Bellman_Ford)

Several currency exchange points are working in our city. Let us suppose that each point specializes in two particular currencies and performs exchange operations only with these currencies. There can

2017-09-09 20:07:02 326

原创 D - Silver Cow Party(Dijkstra)

One 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) unidirectional (one-way roa

2017-09-06 19:56:57 363

原创 C - Heavy Transportation(Dijkstra)

BackgroundHugo 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 custo

2017-09-06 18:51:26 397

原创 B - Save the Students!

B - Save the Students! 题解:因为数据范围不大,避免重复计数,使用一个数组直接标记法即可。是否在圆内的判断使用到圆心的距离,遍历范围x±r,y±r,是否在正方形内直接判断,数据范围x->x+r,y->y+r,是否在三角形内部,需要用到一定的数学知识,一般有以下两种方法,一是利用面积来判断,对于三角形ABC,任取一个点M,连接M与ABC三个顶点,构成了三个三角形,三个三角形的和

2017-09-06 09:53:57 248

原创 J - Goblin Wars

J - Goblin Wars 题目大意:给出一幅图,’.’可以走,‘#’不能走,然后从‘a’—‘z’出发,如果只有一种字符可以到达(距离最短),则变成可以到达的字符,如果有多个字符可以到达,将其变为‘*’……#include <iostream>#include <cstdio>#include <cstring>#include <cstdlib>#include <algorithm>

2017-09-06 08:52:20 383

原创 K - The Unique MST(Kruskal判断最小生成树是否唯一)

Given a connected undirected graph, tell if its minimum spanning tree is unique.Definition 1 (Spanning Tree): Consider a connected, undirected graph G = (V, E). A spanning tree of G is a subgraph of G,

2017-09-04 22:02:29 961

原创 J - Borg Maze(BFS+Prim)

The Borg is an immensely powerful race of enhanced humanoids from the delta quadrant of the galaxy. The Borg collective is the term used to describe the group consciousness of the Borg civilization. Ea

2017-09-04 20:39:42 452

Git学习笔记整理(Learn git branching)

Git学习笔记,网址:https://learngitbranching.js.org/?locale=zh_CN

2020-07-07

空空如也

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

TA关注的人

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