自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 2017 Multi-University Training Contest - Team 2 I - TrickGCD 莫比乌斯反演

You are given an array A , and Zhu wants to know there are how many different array B satisfy the following conditions? 1≤Bi≤Ai For each pair( l , r ) (1≤l≤r≤n) , gcd(bl,bl+1…br)≥2 Input The fir...

2018-08-17 09:34:34 120

原创 2017ACM/ICPC广西邀请赛-重现赛(感谢广西大学)J - Query on A Tree 字典树合并

Monkey A lives on a tree, he always plays on this tree. One day, monkey A learned about one of the bit-operations, xor. He was keen of this interesting operation and wanted to practise it at once. ...

2018-08-10 22:26:41 198

原创 P1099 树网的核 NOIp2007

题目描述 设T=(V,E,W)T=(V,E,W)是一个无圈且连通的无向图(也称为无根树),每条边到有正整数的权,我们称TT为树网(treebetwork),其中VV,EE分别表示结点与边的集合,WW表示各边长度的集合,并设TT有nn个结点。路径:树网中任何两结点aa,bb都存在唯一的一条简单路径,用d(a, b)d(a,b)表示以a, ba,b为端点的路径的长度,它是该路径上各边长度之和。我...

2018-08-31 19:40:14 255

原创 [APIO2010]巡逻 树的直径

题目描述 在一个地区中有 n 个村庄,编号为 1, 2, …, n。有 n – 1 条道路连接着这些村 庄,每条道路刚好连接两个村庄,从任何一个村庄,都可以通过这些道路到达其 他任一个村庄。每条道路的长度均为 1 个单位。 为保证该地区的安全,巡警车每天要到所有的道路上巡逻。警察局设在编号 为 1 的村庄里,每天巡警车总是从警察局出发,最终又回到警察局。 下图表示一个有 8 个村庄的地区,其中村...

2018-08-30 21:16:55 182

原创 Codeforces Round #318 [RussianCodeCup Thanks-Round] (Div. 1) B. Bear and Blocks(思维)

outputstandard output Limak is a little bear who loves to play. Today he is playing by destroying block towers. He built n towers in a row. The i-th tower is made of hi identical blocks. For clarific...

2018-08-30 19:22:24 131

原创 A Research Problem UVA - 10837 欧拉函数 φ

A mad researcher was trying to get fund for his research project but it is a pity that after a year he was able to collect 500$ only. So all his research work has gone to ashtray. The mad researcher ...

2018-08-30 17:10:49 137

原创 Codeforces Round #194 (Div. 2) C. Secrets 数学

Gerald has been selling state secrets at leisure. All the secrets cost the same: n marks. The state which secrets Gerald is selling, has no paper money, only coins. But there are coins of all positive...

2018-08-30 14:35:52 169

原创 Codeforces Round #194 (Div. 2) B. Eight Point Sets 模拟

Gerald is very particular to eight point sets. He thinks that any decent eight point set must consist of all pairwise intersections of three distinct integer vertical straight lines and three distinct...

2018-08-30 09:42:50 212

原创 XVIII Open Cup named after E.V. Pankratiev Stage 3 Problem 10. Acceleration 物理计算

Viktor Polesov is fleeing from a raging crowd on his wonderbike. To survive, he must drive L kilometers as fast as possible. The contraption is powered by fire extinguishers which can be switched on...

2018-08-26 08:58:25 176

原创 Picnic Planning POJ - 1639 度限制生成树

The Contortion Brothers are a famous set of circus clowns, known worldwide for their incredible ability to cram an unlimited number of themselves into even the smallest vehicle. During the off-season,...

2018-08-25 20:51:46 161

原创 Dynamic Rankings ZOJ - 2112 树套树 带修改主席树

求区间第K大,很简单——-主席树即可; 那么如果增加一个修改操作,又该怎么处理呢? 单点修改—-很容易想到 树状数组;此时树状数组每个节点存的是一颗空树;详细的解释,说明#include<iostream>#include<cstdio>#include<algorithm>#include<cstdlib>#include&...

2018-08-24 20:40:48 134

原创 Desert King POJ - 2728 最优比率生成树

David the Great has just become the king of a desert country. To win the respect of his people, he decided to build channels all over his country to bring water to every village. Villages which are co...

2018-08-23 20:40:51 98

原创 2016 Multi-University Training Contest 1 GCD HDU - 5726

Give you a sequence of N(N≤100,000) integers : a1,…,an(0#include<iostream>#include<cstdio>#include<map>#include<algorithm>#i

2018-08-21 21:28:33 131

原创 2018 Multi-University Training Contest 8 J - Taotao Picks Apples HDU - 6406

There is an apple tree in front of Taotao’s house. When autumn comes, n apples on the tree ripen, and Taotao will go to pick these apples. When Taotao picks apples, Taotao scans these apples from th...

2018-08-20 21:55:50 154

原创 XVIII Open Cup named after E.V. Pankratiev Stage 5: Eastern Grand Prix, XI Vekua Cup, J

Problem J. JokeCoin Input file: standard input Output file: standard output Time limit: 2 seconds Memory limit: 256 mebibytes The JokeCoin is the new cryptocurrency. Vasya is planning to start w...

2018-08-19 20:09:48 279

原创 2011 Multi-University Training Contest 11 - Host by UESTC XOR HDU - 3949

XOR is a kind of bit operator, we define that as follow: for two binary base number A and B, let C=A XOR B, then for each bit of C, we can get its value by check the digit of corresponding position in...

2018-08-19 10:27:32 159

原创 CEOI 1999 Sightseeing trip POJ - 1734 Floyd 变形

There is a travel agency in Adelton town on Zanzibar island. It has decided to offer its clients, besides many other attractions, sightseeing the town. To earn as much as possible from this attraction...

2018-08-18 22:44:23 440

原创 XVIII Open Cup named after E.V. Pankratiev Stage 6, Grand Prix of Ukraine Problem F. Bad Word

Marichka has seen bad word while surfing the net! She immediately starts crying and asks Zenyk to destroy it. Zenyk knows that Marichka saw word S which consists of lower case english characters. Ze...

2018-08-18 20:40:01 501

原创 XVIII Open Cup named after E.V. Pankratiev Stage 6, Grand Prix of Ukraine Problem D. Cut the Cake

It is Marichka’s k 2 -th birthday today! Zenyk bought a big cake for this occasion and now he wants to cut it. For the sake of simplicity, consider the cake as rectangular matrix with n rows and m...

2018-08-18 19:29:06 359

原创 XVIII Open Cup named after E.V. Pankratiev Stage 6, Grand Prix of Ukraine,Problem B. Card Game

Zenyk and Marichka start playing Marichka’s favourite card game. But Zenyk forgets even how the deck looks like. Of course, he can’t just ask Marichka. He knows that deck contains N cards. Also ther...

2018-08-18 19:19:13 335

原创 [JSOI2008]球形空间产生器 高斯消元

njH2Q 评测方式 云端评测 标签 各省省选2008江苏 难度 省选/NOI- 时空限制 1000ms / 128MB题目描述 有一个球形空间产生器能够在 nn 维空间中产生一个坚硬的球体。现在,你被困在了这个 nn 维球体中,你只知道球面上 n+1n+1 个点的坐标,你需要以最快的速度确定这个 nn 维球体的球心坐标,以便于摧毁这个球形空间产生器。输入输出格式 输入格式: ...

2018-08-18 16:05:59 185

原创 P1073 最优贸易

CCF_NOI 评测方式 云端评测 标签 NOIp提高组2009 难度 提高+/省选- 时空限制 1000ms / 128MB题目描述 C C 国有 n n 个大城市和 mm 条道路,每条道路连接这 nn 个城市中的某两个城市。任意两个城市之间最多只有一条道路直接相连。这 mm 条道路中有一部分为单向通行的道路,一部分为双向通行的道路,双向通行的道路在统计条数时也计为 1 1 条。...

2018-08-17 21:01:17 115

原创 Tree POJ - 1741 点分治

Give a tree with n vertices,each edge has a length(positive integer less than 1001). Define dist(u,v)=The min distance between node u and v. Give an integer k,for every pair (u,v) of vertices is ca...

2018-08-17 17:23:51 109

原创 Parity game POJ - 1733 带权并查集

Now 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 t...

2018-08-17 14:59:48 149

原创 2017 Multi-University Training Contest - Team 2 C - Maximum Sequence

题意:给定两个数组 a,b;现在需要构造a数组 n+1~ 2n 的项; 要求: 在 bk <= j < i 的前提下, ai =Max { aj - j } ; 现在求出Σ ai , i from n+1 to 2n 的最大值;思路: 贪心; 怎么贪心呢? 不妨这么考虑,由于选的要减去 i ;所以 bk 肯定尽量小,那么我们将b数组排序,每次取前面的而且没有取过的即可,同...

2018-08-16 20:17:59 115

原创 2017 Multi-University Training Contest - Team 2 A - Is Derek lying?

Derek and Alfia are good friends.Derek is Chinese,and Alfia is Austrian.This summer holiday,they both participate in the summer camp of Borussia Dortmund.During the summer camp,there will be fan tests...

2018-08-16 19:15:26 95

原创 Strange Way to Express Integers POJ - 2891 数论

Elina is reading a book written by Rujia Liu, which introduces a strange way to express non-negative integers. The way is described as following: Choose k different positive integers a1, a2, …, ak. F...

2018-08-16 09:39:32 116

原创 [NOI2015]程序自动分析

在实现程序自动分析的过程中,常常需要判定一些约束条件是否能被同时满足。考虑一个约束满足问题的简化版本:假设x1,x2,x3…代表程序中出现的变量,给定n个形如xi=xj或xi≠xj的变量相等/不等的约束条件,请判定是否可以分别为每一个变量赋予恰当的值,使得上述所有约束条件同时被满足。例如,一个问题中的约束条件为:x1=x2,x2=x3,x3=x4,x4≠x1,这些约束条件显然是不可能同时被满足...

2018-08-15 21:38:24 128

原创 Problem C. SIRO Challenge JAGain and JAGain Urozero Training Camp, Day 1, DP

Problem C. SIRO Challenge Input file: standard input Output file: standard output Time limit: 1 second Memory limit: 512 mebibytes You are now participating in the Summer Training Camp for Progra...

2018-08-15 20:32:21 189

原创 XVIII Open Cup named after E.V. Pankratiev Problem 9. Primitive divisors 数论

Victor, a top coder, loves the Internet. Every day he registers on many new websites, and every time he is asked to think of a new password. Victor wrote a password generator, which produces a new p...

2018-08-14 19:43:57 151

原创 UVALive - 6913 博弈 && dp or Search

There was an interesting game played on a popular Korean reality TV Show. 12 players in 3 teams — 4 persons in each team — lined up in one row in random order. The game master approaches the players...

2018-08-14 09:17:05 208

原创 UVALive - 6912

There are lamps (uniquely numbered from 1 to N) and K switches. Each switch has one prime number written on it and it is connected to all lamps whose number is a multiple of that prime number. Pressi...

2018-08-14 09:11:23 113

原创 ACM International Collegiate Programming Contest, Egyptian Collegiate Programming Contest Problem G.

Problem G. Glorious Stadium Input file: glorious.in Output file: standard output Balloon Color: Orange 原题pdf A lot of people want to attend the World Cup, so we would like to construct a glorious...

2018-08-12 20:07:21 328

原创 ACM International Collegiate Programming Contest, Egyptian Collegiate Programming Contest ,Problem D

Problem D. Dream Team Input file: dream.in Output file: standard output Balloon Color: Pink Before the World Cup, we would like to form the ultimate dream team. The team that will win against all...

2018-08-12 20:03:39 639

原创 ACM International Collegiate Programming Contest, Egyptian Collegiate Programming Contest Problem K

Problem K. Katryoshka Input file: katryoshka.in Output file: standard output Balloon Color: White The Egyptian football team will be in Russia for the World Cup, of course they all would like to b...

2018-08-12 19:38:29 605

原创 2017ACM/ICPC广西邀请赛-重现赛(感谢广西大学)C - Counting Stars 暴力三元环

Little A is an astronomy lover, and he has found that the sky was so beautiful! So he is counting stars now! There are n stars in the sky, and little A has connected them by m non-directional edge...

2018-08-10 10:38:13 289

原创 2017ACM/ICPC广西邀请赛-重现赛(感谢广西大学) B - Color it HDU - 6183 线段树

Do you like painting? Little D doesn’t like painting, especially messy color paintings. Now Little B is painting. To prevent him from drawing messy painting, Little D asks you to write a program to ma...

2018-08-10 09:55:16 265

原创 2017ACM/ICPC广西邀请赛-重现赛(感谢广西大学)E - CS Course 线段树维护

Little A has come to college and majored in Computer and Science. Today he has learned bit-operations in Algorithm Lessons, and he got a problem as homework. Here is the problem: You are giving ...

2018-08-09 20:02:36 227

原创 Telephone Lines POJ - 3662 Dijkstra+ 二分答案

Farmer John wants to set up a telephone line at his farm. Unfortunately, the phone company is uncooperative, so he needs to pay for some of the cables required to connect his farm to the phone system....

2018-08-07 21:22:25 187

原创 Sticks POJ - 1011 dfs+剪枝

George took sticks of the same length and cut them randomly until all parts became at most 50 units long. Now he wants to return sticks to the original state, but he forgot how many sticks he had orig...

2018-08-07 16:08:25 120

空空如也

空空如也

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

TA关注的人

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