- 博客(33)
- 收藏
- 关注
原创 【HDU OJ 4751 + 二分图】
This year is the 60th anniversary of NJUST, and to make the celebration more colorful, Tom200 is going to invite distinguished alumnus back to visit and take photos. After carefully planning, Tom200
2016-09-30 09:22:31 417
原创 【 Codeforces 486C +vector】
Description Nam is playing with a string on his computer. The string consists of n lowercase English letters. It is meaningless, so Nam decided to make the string more beautiful, that is to make it be
2016-09-28 22:46:32 445
原创 【lightoj 1079 Just another Robbery】
Just another RobberyDescription As Harry Potter series is over, Harry has no job. Since he wants to make quick money, (he wants everything quick!) so he decided to rob banks. He wants to make a calcul
2016-09-27 20:05:33 400
原创 【 LightOJ 1078 Integer Divisibility + 同余定理 】
Description If an integer is not divisible by 2 or 5, some multiple of that number in decimal notation is a sequence of only a digit. Now you are given the number and the only allowable digit, you sho
2016-09-27 18:26:36 378
原创 【codeforces 486B OR in Matrix】
OR in Matrix Description Let’s define logical OR as an operation on two logical values (i. e. values that belong to the set {0, 1}) that is equal to 1 if either or both of the logical values is set t
2016-09-27 18:22:12 401
原创 【HDU 5904 LCIS + dp】
LCIS Problem Description Alex has two sequences a1,a2,…,an and b1,b2,…,bm. He wants find a longest common subsequence that consists of consecutive values in increasing order.Input There are multiple
2016-09-24 22:49:07 640
原创 【codeforces B + 思维】
B. Anatoly and Cockroaches time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Anatoly lives in the university dorm as many other students do.
2016-09-24 10:27:13 278
原创 【codeforces 510 C】
Description Let’s define a forest as a non-directed acyclic graph (also without loops and parallel edges). One day Misha played with the forest consisting of n vertices. For each vertex v from 0 to n
2016-09-23 11:31:00 315
原创 【codeforces 510 B + floyd】
Description User ainta has a permutation p1, p2, …, pn. As the New Year is coming, he wants to make his permutation as pretty as possible.Permutation a1, a2, …, an is prettier than permutation b1, b2,
2016-09-23 11:00:04 389
原创 【codeforces 500C 】
Description New Year is coming, and Jaehyun decided to read many books during 2015, unlike this year. He has n books numbered by integers from 1 to n. The weight of the i-th (1 ≤ i ≤ n) book is wi.As
2016-09-23 10:56:07 456
原创 【codeforces 510 B Misha and Changing Handles】
Misha and Changing HandlesDescription Misha hacked the Codeforces site. Then he decided to let all the users change their handles. A user can now change his handle any number of times. But each new ha
2016-09-23 10:43:18 455
原创 【codeforces 501 C Misha and Forest】
Misha and ForestDescription Let’s define a forest as a non-directed acyclic graph (also without loops and parallel edges). One day Misha played with the forest consisting of n vertices. For each verte
2016-09-23 10:06:16 378
原创 【Lightoj 1032 Fast Bit Calculations 】
Fast Bit CalculationsDescription A bit is a binary digit, taking a logical value of either 1 or 0 (also referred to as “true” or “false” respectively). And every decimal number has a binary representa
2016-09-23 09:54:07 480
原创 【Lijhtoj 1033 Generating Palindromes +最大公共子序列】
Generating PalindromesDescription By definition palindrome is a string which is not changed when reversed. “MADAM” is a nice example of palindrome. It is an easy job to test whether a given string is
2016-09-22 08:26:20 360
原创 【poj 1703 Find them, Catch them + 并查集】
Find them, Catch themDescription The police office in Tadu City decides to say ends to the chaos, as launch actions to root up the TWO gangs in the city, Gang Dragon and Gang Snake. However, the polic
2016-09-22 08:15:17 306
原创 【HDU 2571 命运 +dp】
命运 Problem Description 穿过幽谷意味着离大魔王lemon已经无限接近了! 可谁能想到,yifenfei在斩杀了一些虾兵蟹将后,却再次面临命运大迷宫的考验,这是魔王lemon设下的又一个机关。要知道,不论何人,若在迷宫中被困1小时以上,则必死无疑! 可怜的yifenfei为了去救MM,义无返顾地跳进了迷宫。让我们一起帮帮执着的他吧! 命运大迷宫可以看成是一个两维的方格阵
2016-09-22 08:12:10 373
原创 【LightOJ 1307 + 二分】
LightOJ 1307Description You are given N sticks having distinct lengths; you have to form some triangles using the sticks. A triangle is valid if its area is positive. Your task is to find the number o
2016-09-22 07:56:47 520
原创 【1014 - Absolute Defeat】
1014 - Absolute DefeatDESCRIPTION Eric has an array of integers a 1 , a 2 , . . . , a n a1,a2,…,an. Every time, he can choose a contiguous subsequence of length k k and increase every
2016-09-16 09:20:52 287
转载 【容斥原理】
容斥原理请戳这 http://baike.baidu.com/link?url=qqYbHYjNGhIyJBrKn2iKaNACdJRHN-OHnnvVC0KVUW4xgRm8uecGZWYbw5W5JNIv9-t0_JG3CVWg-VtFSaa0fK
2016-09-16 09:18:49 376
原创 【河南省第九届ACM程序设计大赛 信道安全 +zzulioj 1925 信道安全 +邻接表 +队列 】
DescriptionAlpha 机构有自己的一套网络系统进行信息传送。情报员 A 位于节点 1,他准备将一份情报发送给位于节点 n 的情报部门。可是由于最近国际纷争,战事不断,很多信道都有可能被遭到监视或破坏。经过测试分析,Alpha 情报系统获得了网络中每段信道安全可靠性的概率,情报员 A 决定选择一条安全性最高,即概率最大的信道路径进行发送情报。你能帮情报员 A 找到这条信道路径吗?Input
2016-09-15 10:36:40 826
原创 【辗转相除法求模的逆元 + 欧几里德算法】
欧几里德算法请戳这 :http://wenku.baidu.com/link?url=Xzuq4WEA5rddOTc95x-LOMUOE7T18ita0_R8m4Gym5_vUAfBGnNKSext1spxVf08PSHUFkUuOcnqprYAHbC7UIwS232qWs7MMnXf4o-K2mq另一种就逆元的方法:如果b与c互素,则(a/b)%c=a*b^(phi(c)-1)%c 如果b与c不
2016-09-14 07:46:21 5336
转载 【求精:关于N个小球放M个盒子解答 】
求精:关于N个小球放M个盒子解答 图片: 看似很简单的问题其实非常复杂,球是否相同,箱是否相同?是否允许有空盒 不难看出一共8类情况 1)球同,盒同,无空箱 2)球同,盒同,允许空箱 3)球同,盒不同,无空箱 4)球同,盒不同,允许空箱 5)球不同,盒相同,无空箱 6)球不同,盒相同,允许空箱 7)球不同,盒不同,无空箱 6)球不同,盒不同,允许空箱 先来看3,4.
2016-09-13 21:01:49 2234
原创 【zzulioj 1841 so easy!麻麻再也不用担心我的数学了!】
so easy!麻麻再也不用担心我的数学了!Description咱们来一发so easy的数学题,这样麻麻再也不用担心我们的数学不及格了。 现在给你一个方程A[i] = (A[i-1]+A[i+1])/2 - c[i](1 <= i <= n);, 然后给你A[0]和A[n+1] 求A[1] = ?。 Input包括多个测试样例。 对于每一个实例,第一行输入一个正整数n(1 <= n <=
2016-09-12 11:28:15 420
原创 【SDUT [2146]最小子序列和】
最小子序列和 Time Limit: 1000MS Memory Limit: 65536KB Problem Description给你一个长为n(10Input有多组(小于11组)测试数据,每组第一行输入n和k(用空格隔开),第二行输入n个数(数之间用空格隔开)。 Output请输出最小的和。 Example Input15 5 5 4 3 2 1 1 2 3 4
2016-09-12 10:28:26 536
原创 【zzulioj 1837 LT说我不服 + dp】
Description对于上一道题目LT不服,表示那么简单的题目不屑于去做,所以我们决定加大一下题目的难度,下面是我们LT出的题目: 假如给你一个由n个数组成的序列A1, A2, A3, A4 …… An。你可以选择任意一个大小的区间,将其中的每一个数x变成(x*1888+101)%14507。 求这n个数的最大和可能是多少。 Input输入有多组数据 每组数据第一行输入一个整数n为序列元素
2016-09-12 09:07:41 388
原创 【河南省第九届ACM竞赛 A 题 && zzulioj 1923: 表达式求值 + 栈】
Description假设表达式定义为: 1. 一个十进制的正整数 X 是一个表达式。 2. 如果 X 和 Y 是 表达式,则 X+Y, X*Y 也是表达式; *优先级高于+. 3. 如果 X 和 Y 是 表达式,则 函数 Smax(X,Y)也是表达式,其值为:先分别求出 X ,Y 值的各位数字之和,再从中选最大数。 4.如果 X 是 表达式,则 (X)也是表达式。 例如: 表达式 1
2016-09-11 17:50:01 869
原创 【codeforces 711B + 枚举】
711B B. Chris and Magic Square time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output ZS the Coder and Chris the Baboon arrived at the entrance o
2016-09-10 17:18:29 443
原创 【zzulioj 1909: 小火山的友情距离】
1909: 小火山的友情距离Description小火山和他的朋友岩浆, 分别打算去买商店买一些东西。小火山的起始位置为(X1, Y1),终止位置为(X2, Y2), 速度为U; 岩浆的起始位置为(X3, Y3), 终止位置为(X4, Y4), 速度为V, 双方一块出发, 到达终止位置后, 都会在终止位置停留。 现在小火山想知道他和岩浆在此过程中的最小距离。 Input输入第一行是一个整数T(T
2016-09-10 11:36:19 432
原创 【zzulioj 1904: 小火山的股票交易】
1904: 小火山的股票交易Description“股市有风险,入市需谨慎”,小火山经历了之前买卖一次或者两次的股票♂交易,对于股票买卖已经很有经验了, 现在的他最多可以进行K次买卖,身为一个聪明的acmer,已经准确的知道了某只股票在未来N天的价格,每一次买入必须 卖出后才能进行下次买卖。现在,小火山想知道他最多可以获得多少利润? Input输入第一行是一个整数T(T <= 50), 表示
2016-09-08 22:57:02 627
原创 【zzulioj 1900 985的“树”难题】
1900: 985的“树”难题Description985给你一棵“树”以及它的根节点,要求你先判定它是否是一棵树,其次他想知道每个节点的“太子”数目以及它的父亲(root的话输出自己)。 “太子判定条件”: 一、若x是y的孩子节点,那么x是y的“太子”; 二、若x是y的“太子”且y是z的“太子”,那么x是z的“太子”。 Input第一行输入一个整数t,代表有t组测试数据。 每组数据第一行
2016-09-08 15:48:07 470
原创 【偶数阶幻方】
.偶数阶幻方 说实话,偶数阶幻方我一直以为只有一种,就是2*n阶幻方问题。查了一下才知道偶数阶幻方也分为两小类。①.4*n阶幻方 4*n阶幻方的生成其实很简单,即对方格中对角线上的数据,先以一条对角线(称对角线一)为对称轴,交换另一对角线(称对角线二)的数据;然后以对角线二为对称轴,交换对角线一的数据。说的直白一点,假设矩阵名为MagicSquare,就是交换MagicSquare[
2016-09-03 14:30:16 11846 5
原创 【codeforces 710 C Magic Odd Square】
Magic Odd SquareFind an n × n matrix with different numbers from 1 to n2, so the sum in each row, column and both main diagonals are odd.Input The only line contains odd integer n (1 ≤ n ≤ 49).Output
2016-09-03 14:09:06 482
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人