水题
文章平均质量分 80
RJ28
小学生
展开
-
POJ-2503 Babelfish
Time Limit: 3000MS Memory Limit: 65536KTotal Submissions: 38865 Accepted: 16594DescriptionYou have just moved from Waterloo to a big city. The people here speak an incompre原创 2016-04-06 21:27:17 · 303 阅读 · 0 评论 -
Hdu-5775 Bubble Sort
Bubble SortTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 475 Accepted Submission(s): 291Problem DescriptionP is a permutation o原创 2016-07-29 14:04:49 · 301 阅读 · 0 评论 -
Hdu-2089 不要62(数位DP)
Problem Description杭州人称那些傻乎乎粘嗒嗒的人为62(音:laoer)。杭州交通管理局经常会扩充一些的士车牌照,新近出来一个好消息,以后上牌照,不再含有不吉利的数字了,这样一来,就可以消除个别的士司机和乘客的心理障碍,更安全地服务大众。不吉利的数字为所有含有4或62的号码。例如:62315 73418 88914都属于不吉利号码。但是,61152虽然含有6和原创 2016-08-15 23:39:43 · 239 阅读 · 0 评论 -
Uva 11054 Wine trading in Gergovia(贪心模拟)
题意:直线上有n个等距的村庄,每个村庄要么买酒要么卖酒,把k个单位的酒从一个村庄运送到另一个村庄需要k个单位的劳动力,问最少需要多少劳动力。分析:考虑最左边的村庄,它的需求是a[i],那么它需要向第二个村庄转移abs(a[i])个需求,第二个村子现在需求为a[1]+a[2],再转移abs(a[1]+a[2])...以此类推累加答案即可。#include#include#原创 2016-07-31 21:31:15 · 489 阅读 · 0 评论 -
Poj-3252 Round Numbers(数位DP)
DescriptionThe cows, as you know, have no fingers or thumbs and thus are unable to play Scissors, Paper, Stone' (also known as 'Rock, Paper, Scissors', 'Ro, Sham, Bo', and a host of other names) i原创 2016-08-16 23:22:41 · 538 阅读 · 0 评论 -
Hdu-5734 Acperience
Problem DescriptionDeep neural networks (DNN) have shown significant improvements in several application domains including computer vision and speech recognition. In computer vision, a particular ty原创 2016-07-22 10:59:45 · 390 阅读 · 0 评论 -
LA 7464 Robots(贪心)
题意:有X和Y两类机器人各n m个,现在要将所有机器人上的信息传送到基点Base.同一时刻每个机器人(包括Base)只能发给一个对象,也只能接受一个对象的信息.X类的机器人发送数据的时间是x,Y类的是y. (x 分析:f(n,m) = f(n,(m-n)/2) + y (m >= n) f(n,m) = f((n-m)/(pow(2,y/x)) + m,0原创 2016-08-17 21:39:16 · 386 阅读 · 0 评论 -
Hdu-3709 Balanced Number(数位DP)
DescriptionA balanced number is a non-negative integer that can be balanced if a pivot is placed at some digit. More specifically, imagine each digit as a box with weight indicated by the digit. W原创 2016-08-17 22:24:03 · 274 阅读 · 0 评论 -
Gym 100886G Maximum Product(搜索)
G. Maximum Producttime limit per test1 secondmemory limit per test256 mebibytesinputstandard inputoutputstandard outputFind the number from the range [a, b] which has the原创 2016-08-29 21:11:33 · 452 阅读 · 0 评论 -
Codeforces Round #371 (Div. 1) A. Sonya and Queries(trie)
A. Sonya and Queriestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputToday Sonya learned about long integers and invit原创 2016-09-14 23:39:44 · 342 阅读 · 0 评论 -
Codeforces Round #368 (Div. 2) E. Garlands(二维树状数组)
E. Garlandstime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLike all children, Alesha loves New Year celebration. Dur原创 2016-09-05 19:28:58 · 355 阅读 · 0 评论 -
Hdu-5898 odd-even number(数位DP)
Problem DescriptionFor a number,if the length of continuous odd digits is even and the length of continuous even digits is odd,we call it odd-even number.Now we want to know the amount of odd-even n原创 2016-09-20 12:50:59 · 388 阅读 · 0 评论 -
2014 Nordic Collegiate Programming Contest A - Amanda Lounges
题意:给n个点m条边的图,每条边有一个权重,表示两端点的权值和,每个点的权值为0或1,问所有点的最小权重。分析:类似2-SAT的方法对全图染色,注意每个点染两次,取最小值。#include#include#include#include#include#include#include#include#include#include#include#in原创 2016-09-08 19:49:41 · 528 阅读 · 0 评论 -
Uva-727 Equation(中缀表达式转后缀表达式)
题意:给你一些中缀表达式,求他们的后缀表达式。分析:这题主要难点在空行的判断啊T_T.#include#include#include#define N 1005using namespace std;const bool camp[7][7] ={ {1,1,0,0,0,1,1},{1,1,0,0,0,1,1},{1,1,1,1,0,1,1},原创 2016-10-17 23:09:25 · 374 阅读 · 0 评论 -
LA-4727 Jump(递推)
题意:给定n和k,问每隔k人的n人约瑟夫游戏中最后出局的三个人的编号。分析:设f(i,j)表示共i个人的约瑟夫环中出局的第j个人的编号,我们每出局一个人重新编号后有f(i,j) = (f(i-1,j-1) + k) % i.#include#include#include#include#include#include#include#include原创 2017-02-01 22:12:06 · 276 阅读 · 0 评论 -
Hdu-5763 Another Meaning(DP+KMP)
Another MeaningTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 558 Accepted Submission(s): 262Problem DescriptionAs is known to a原创 2016-07-29 13:49:50 · 395 阅读 · 0 评论 -
Uva 10917 Walk Through the Forest(DAG拓扑排序)
题意:jimmy下班需要穿过一个森林,所以打算每天沿着一条不同的路径回家,他只沿着满足如下条件的(A,B)走:存在一条从B出发的回家路,比所有从A出发的回家路都短,问你一共有多少种回家方案,1为家,2为起点。分析:求一遍从2开始的单元最短路,然后从新构图,只保留d(a) > d(b) 的 (b,a)边,注意这一定是一个DAG(有向无环图),然后拓扑排序后DP。#原创 2016-07-27 16:42:00 · 420 阅读 · 0 评论 -
Hdu-5744 Keep On Movin(贪心)
Problem DescriptionProfessor Zhang has kinds of characters and the quantity of thei-th character is ai. Professor Zhang wants to use all the characters build several palindromic strings. He al原创 2016-07-22 13:21:17 · 271 阅读 · 0 评论 -
Educational Codeforces Round 12 D. Simple Subset
A tuple of positive integers {x1, x2, ..., xk} is called simple if for all pairs of positive integers(i, j) (1 ≤ i j ≤ k),xi + xj is a prime.You are given an array a with n positive integ原创 2016-05-21 22:09:41 · 363 阅读 · 0 评论 -
POJ-3253 Fence Repair
Time Limit: 2000MS Memory Limit: 65536KTotal Submissions: 37213 Accepted: 12053DescriptionFarmer John wants to repair a small length of the fence around the pasture. He mea原创 2016-04-06 22:13:20 · 259 阅读 · 0 评论 -
POJ-1691 Painting A Board
Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 3616 Accepted: 1798DescriptionThe CE digital company has built an Automatic Painting Machine (APM) to paint a flat原创 2016-04-13 21:15:56 · 341 阅读 · 0 评论 -
POJ-1191 棋盘分割
Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 13871 Accepted: 4932Description将一个8*8的棋盘进行如下分割:将原棋盘割下一块矩形棋盘并使剩下部分也是矩形,再将剩下的部分继续如此分割,这样割了(n-1)次后,连同最后剩下的矩形棋盘共有n块矩形棋原创 2016-04-14 11:58:05 · 342 阅读 · 0 评论 -
VK Cup 2015 - Qualification Round 2 C. Name Quest
A Martian boy is named s — he has got this name quite recently from his parents for his coming of age birthday. Now he enjoys looking for his name everywhere. If he sees that he can obtain his name fr原创 2016-05-10 11:16:13 · 446 阅读 · 0 评论 -
POJ-1850 Code
Time Limit: 1000MS Memory Limit: 30000KTotal Submissions: 9132 Accepted: 4360DescriptionTransmitting and memorizing information is a task that requires different coding systems原创 2016-04-15 18:57:53 · 205 阅读 · 0 评论 -
POJ-1019 Number Sequence
Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 37441 Accepted: 10807DescriptionA single positive integer i is given. Write a program to find the digit located in the原创 2016-04-15 20:47:54 · 609 阅读 · 0 评论 -
UVa 11389 The Bus Driver Problem
题意:有n个老司机,n个下午路线和n个夜间路线,给每个老司机安排一个下午路线和夜间路线,使得每个路线恰好被分配到一个老司机,且需要支付给老司机的总加班费尽量少。如果一个司机的行驶总时间不超过d,则没有加班费,否则超过的部分每小时需要支付r块的加班费。分析:简单贪心,排序后首尾相加一定是最优的组合。#include #include #include using nam原创 2016-05-03 14:54:20 · 618 阅读 · 0 评论 -
Codeforces Round #246 (Div. 2) C. Prime Swaps
You have an array a[1], a[2], ..., a[n], containing distinct integers from1 to n. Your task is to sort this array in increasing order with the following operation (you may need to apply it multiple原创 2016-05-14 19:54:37 · 352 阅读 · 0 评论 -
Hdu-5344 MZL's xor
Problem DescriptionMZL loves xor very much.Now he gets an array A.The length of A is n.He wants to know the xor of all (Ai+Aj)(1≤i,j≤n)The xor of an array B is defined as B1 xor B2...xorBn原创 2016-05-29 17:54:47 · 371 阅读 · 0 评论 -
POJ-3468 A Simple Problem with Integers(Splay实现)
POJ 3468 A Simple Problem with Integers(Splay实现)原创 2016-04-21 13:42:34 · 318 阅读 · 0 评论 -
Codeforces Round #353 (Div. 2) B. Restoring Painting
Vasya works as a watchman in the gallery. Unfortunately, one of the most expensive paintings was stolen while he was on duty. He doesn't want to be fired, so he has to quickly restore the painting. He原创 2016-05-17 14:16:34 · 451 阅读 · 0 评论 -
Hdu-2087 剪花布条
Description一块花布条,里面有些图案,另有一块直接可用的小饰条,里面也有一些图案。对于给定的花布条和小饰条,计算一下能从花布条中尽可能剪出几块小饰条来呢? Input输入中含有一些数据,分别是成对出现的花布条和小饰条,其布条都是用可见ASCII字符表示的,可见的ASCII字符有多少个,布条的花纹也有多少种花样。花纹条和小饰条不会超过1000个原创 2016-05-17 19:35:20 · 389 阅读 · 0 评论 -
LA 3983 Robotruck
白书原题,简单的单调队列。#include #include #include #define MAXN 100010using namespace std;int t,T,c,n,x[MAXN],y[MAXN],d[MAXN],f[MAXN],dis[MAXN],q[MAXN],w[MAXN]; int main(){ cin.sync_with_stdio(false);原创 2016-04-23 13:40:33 · 453 阅读 · 0 评论 -
Codeforces Round 669D Little Artem and Time Machine
Little Artem has invented a time machine! He could go anywhere in time, but all his thoughts of course are with computer science. He wants to apply this time machine to a well-known data structure:m原创 2016-04-25 09:30:16 · 600 阅读 · 0 评论 -
2017 ACM-ICPC 亚洲区(西安赛区)网络赛 E. Maximum Flow
Given a directed graph with nnn nodes, labeled 0,1,⋯,n−10,1, \cdots, n-10,1,⋯,n−1.For each i,j> satisfies 0≤i0≤ijn, there exists an edge from the i-th node to the j-th node, the capacity of wh原创 2017-09-16 21:56:39 · 326 阅读 · 0 评论