03 2017 档案

摘要:A.调酒师 很水的一道题,算出每个参数的最小值就行,手速选手被碾压的开始QAQ。 1 #include<bits/stdc++.h> 2 using namespace std; 3 4 int main() { 5 //freopen("in.txt", "r", stdin); 6 int T; 阅读全文
posted @ 2017-03-27 22:59 Robin! 阅读(464) 评论(0) 推荐(0)
摘要:Description Big Johnsson Trucks Inc. is a company specialized in manufacturing big trucks. Their latest model, the Godzilla V12, is so big that the am 阅读全文
posted @ 2017-03-27 21:05 Robin! 阅读(136) 评论(0) 推荐(0)
摘要:Problem Description After inventing Turing Tree, 3xian always felt boring when solving problems about intervals, because Turing Tree could easily have 阅读全文
posted @ 2017-03-24 13:20 Robin! 阅读(124) 评论(0) 推荐(0)
摘要:Description 萧芸斓是Z国的公主,平时的一大爱好是采花。 今天天气晴朗,阳光明媚,公主清晨便去了皇宫中新建的花园采花。花园足够大,容纳了n朵花,花有c种颜色(用整数1-c表示),且花是排成一排的,以便于公主采花。公主每次采花后会统计采到的花的颜色数,颜色数越多她会越高兴!同时,她有一癖好, 阅读全文
posted @ 2017-03-23 22:06 Robin! 阅读(112) 评论(0) 推荐(0)
摘要:SPFA是队列优化后的Bellman-Ford,用于求带负权边的最短路,然而传说中O(k*n)的复杂度好像是错误的。 阅读全文
posted @ 2017-03-22 22:12 Robin! 阅读(1421) 评论(0) 推荐(1)
摘要:Description 西瓜和Roll组团去冒险,他们打开了隐藏的密门,发现了矮人矿洞的秘密。那是多年前由矮人王亲自下令改建的密室,据说只有最美妙的音乐可以指引他们找到宝藏。一首音乐是最美妙的,当且仅当每两个相邻音符的和谐度之和最大。西瓜发现了一张矮人公认的最美和谐度表harmony。西瓜发现,他可 阅读全文
posted @ 2017-03-22 19:12 Robin! 阅读(132) 评论(0) 推荐(0)
摘要:Description Painting some colored segments on a line, some previously painted segments may be covered by some the subsequent ones. Your task is counti 阅读全文
posted @ 2017-03-21 20:17 Robin! 阅读(127) 评论(0) 推荐(0)
摘要:LCA-求树上两点最近公共祖先问题 lrj的紫书上提供了一种将LCA问题转化为RMQ问题的方法,即dfs一次处理出一个序列,first(u)代表u第一次出现的下标,则对于u,v的最近公共祖先的下标即为RMQ(first(u), first(v))。 LCA->RMQ(在线处理): Tarjan算法( 阅读全文
posted @ 2017-03-20 21:23 Robin! 阅读(164) 评论(0) 推荐(0)
摘要:Description The multiplication puzzle is played with a row of cards, each containing a single positive integer. During the move player takes one card 阅读全文
posted @ 2017-03-20 17:30 Robin! 阅读(310) 评论(0) 推荐(0)
摘要:Problem Description In the modern time, Search engine came into the life of everybody like Google, Baidu, etc.Wiskey also wants to bring this feature 阅读全文
posted @ 2017-03-15 00:43 Robin! 阅读(134) 评论(0) 推荐(0)
摘要:Problem Description 夏天来了~~好开心啊,呵呵,好多好多水果~~Joe经营着一个不大的水果店.他认为生存之道就是经营最受顾客欢迎的水果.现在他想要一份水果销售情况的明细表,这样Joe就可以很容易掌握所有水果的销售情况了. Input 第一行正整数N(0<N<=10)表示有N组测试 阅读全文
posted @ 2017-03-13 19:36 Robin! 阅读(150) 评论(0) 推荐(0)
摘要:Description There is an apple tree outside of kaka's house. Every autumn, a lot of apples will grow in the tree. Kaka likes apple very much, so he has 阅读全文
posted @ 2017-03-12 21:57 Robin! 阅读(104) 评论(0) 推荐(0)
摘要:Description 聪聪和可可是兄弟俩,他们俩经常为了一些琐事打起来,例如家中只剩下最后一根冰棍而两人都想吃、两个人都想玩儿电脑(可是他们家只有一台电脑)……遇到这种问题,一般情况下石头剪刀布就好了,可是他们已经玩儿腻了这种低智商的游戏。他们的爸爸快被他们的争吵烦死了,所以他发明了一个新游戏:由 阅读全文
posted @ 2017-03-12 17:18 Robin! 阅读(125) 评论(0) 推荐(0)
摘要:Description 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 阅读全文
posted @ 2017-03-11 23:08 Robin! 阅读(116) 评论(0) 推荐(0)
摘要:Treap(树堆)的大部分功能STL的set都可以实现,但因为set的过度封装使得某些特定的功能不能实现,比如求第k大的值。 Code: 阅读全文
posted @ 2017-03-11 18:03 Robin! 阅读(182) 评论(0) 推荐(0)
摘要:Problem Description 吉哥又想出了一个新的完美队形游戏! 假设有n个人按顺序站在他的面前,他们的身高分别是h[1], h[2] ... h[n],吉哥希望从中挑出一些人,让这些人形成一个新的队形,新的队形若满足以下三点要求,则就是新的完美队形: 1、挑出的人保持原队形的相对顺序不变 阅读全文
posted @ 2017-03-11 13:47 Robin! 阅读(160) 评论(0) 推荐(0)
摘要:对于求最长回文子串问题,暴力解法的时间复杂度是O(n3); 好一点的算法从每个点向两边扩展也要O(n2)的复杂度; Manacher算法用p[i]数组记录以i为对称轴的回文串的右端到i的距离以及一个maxright标志,利用了回文串的对称性,使每个点只要处理一遍,因此复杂度降到了O(n)。 模板: 阅读全文
posted @ 2017-03-10 21:30 Robin! 阅读(157) 评论(0) 推荐(0)
摘要:Description Japan plans to welcome the ACM ICPC World Finals and a lot of roads must be built for the venue. Japan is tall island with N cities on the 阅读全文
posted @ 2017-03-09 18:13 Robin! 阅读(144) 评论(0) 推荐(0)
摘要:Description Suppose that the fourth generation mobile phone base stations in the Tampere area operate as follows. The area is divided into squares. Th 阅读全文
posted @ 2017-03-08 13:34 Robin! 阅读(144) 评论(0) 推荐(0)
摘要:Description Astronomers often examine star maps where stars are represented by points on a plane and each star has Cartesian coordinates. Let the leve 阅读全文
posted @ 2017-03-06 19:21 Robin! 阅读(97) 评论(0) 推荐(0)
摘要:1 #include 2 using namespace std; 3 const int maxn = 1000 + 5; 4 int C[maxn], n; 5 6 int lowbit(int x) {return x & -x;} 7 8 int sum(int x) { 9 int ret = 0; 10 while(x) { 11 ... 阅读全文
posted @ 2017-03-06 10:47 Robin! 阅读(193) 评论(0) 推荐(0)
摘要:Problem Description During the War of Resistance Against Japan, tunnel warfare was carried out extensively in the vast areas of north China Plain. Gen 阅读全文
posted @ 2017-03-05 16:03 Robin! 阅读(115) 评论(0) 推荐(0)
摘要:Problem Description 十年前读大学的时候,中国每年都要从国外引进一些电影大片,其中有一部电影就叫《勇敢者的游戏》(英文名称:Zathura),一直到现在,我依然对于电影中的部分电脑特技印象深刻。今天,大家选择上机考试,就是一种勇敢(brave)的选择;这个短学期,我们讲的是博弈(g 阅读全文
posted @ 2017-03-04 14:13 Robin! 阅读(105) 评论(0) 推荐(0)
摘要:Problem Description 搬寝室是很累的,xhd深有体会.时间追述2006年7月9号,那天xhd迫于无奈要从27号楼搬到3号楼,因为10号要封楼了.看着寝室里的n件物品,xhd开始发呆,因为n是一个小于2000的整数,实在是太多了,于是xhd决定随便搬2*k件过去就行了.但还是会很累, 阅读全文
posted @ 2017-03-01 20:52 Robin! 阅读(137) 评论(0) 推荐(0)
摘要:Problem Description For a decimal number x with n digits (AnAn-1An-2 ... A2A1), we define its weight as F(x) = An * 2n-1 + An-1 * 2n-2 + ... + A2 * 2 阅读全文
posted @ 2017-03-01 16:40 Robin! 阅读(120) 评论(0) 推荐(0)