08 2015 档案
摘要:传送门Ice Cream ParlorAuthored bydheerajonMar 21 2013Problem StatementSunny and Johnny together haveMdollars they want to spend on ice cream. The parlor ...
阅读全文
摘要:传送门 Sherlock and MiniMax Authored by darkshadows on May 07 2014 Problem Statement Sherlock and MiniMax Authored by darkshadows on May 07 2014 Problem
阅读全文
摘要:传送门今天在HackerRank上翻到一道高精度题,于是乎就写了个高精度的模板,说是模板其实就只有乘法而已。Extra long factorialsAuthored byvatsalchananaonJun 16 2015Problem StatementYou are given an inte...
阅读全文
摘要:最长上升公共子序列(Longest Increasing Common Subsequence,LICS)也是经典DP问题,是LCS与LIS的混合。Problem求数列 a[1..n], b[1..m]的LICS的长度, a[], b[]数组的元素均为正整数。Solution考虑如何定义DP状态,定...
阅读全文
摘要:传送门 一开始在vjudge上看到这题时,标的来源是CSU 1120,第八届湖南省赛D题“平方根大搜索”。今天交题时CSU突然跪了,后来查了一下看哪家OJ还挂了这道题,竟然发现这题是出自UVA的,而且用的原题。 Description time limit 5s In binary, the squ
阅读全文
摘要:指针(pointer)有两种涵义 一是指C/C++中的一种数据类型(data type)。 二是指某个类型为指针的 数据/物件(object)。 指针作为一种数据类型,属所谓复合类型(compound types)。 若非特别指明,下文中所言的指针皆为第二种涵义。 A compound type i
阅读全文
摘要:最长公共子序列(LCS)是经典的DP问题,求序列a[1...n], b[1..m]的LCS。状态是DP[i][j],表示a[1..i],b[1..j]的LCS。DP转移方程是DP[i][j]= DP[i-1][j-1]+1, a[i] == b[j] max{ DP[i][j-1], DP[i...
阅读全文
摘要:传送门DescriptionA kingdom has n cities numbered 1 to n, and some bidirectional roads connecting cities. The capital is always city 1.After a war, all th...
阅读全文
摘要:传送门Time Limit:5000MSMemory Limit:65536KB64bit IO Format:%lld & %lluDescription在一个奇怪的村子中,很多人的名字都很长,比如aaaaa, bbb and abababab。名字这么长,叫全名显然起来很不方便。所以村民之间一般...
阅读全文
摘要:传送门Time Limit:1000MSMemory Limit:131072KB64bit IO Format:%lld & %lluDescriptionIn this problem, a dictionary is collection of key-value pairs, where k...
阅读全文
摘要:传送门Closest Common AncestorsTime Limit:2000MSMemory Limit:10000KTotal Submissions:17306Accepted:5549DescriptionWrite a program that takes as input a ro...
阅读全文
摘要:传送门考研路茫茫——空调教室Time Limit: 4000/2000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2445Accepted Submission(s): 720Probl...
阅读全文
摘要:这是DFS系列的第二篇 割边的概念 In graph theory, a bridge, isthmus, cut-edge, or cut arc is an edge of a graph whose deletion increases its number of connected comp
阅读全文
摘要:传送门 B. Mike and Fun time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Mike and some bears
阅读全文
摘要:传送门 D. One-Dimensional Battle Ships time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output D. On
阅读全文
摘要:传送门 Even the most successful company can go through a crisis period when you have to make a hard decision — to restructure, discard and merge departme
阅读全文
摘要:scanf()是C语言中用于读入格式化数据(formatted data)的函数。 我们可能对scanf()的一般用法已经了然,而至于scanf()读入数据的机制恐怕并不十分清楚。 下面我将比较详细地介绍scanf()的工作机制,并指出其丰富且强大的格式化方式。 内容来自这个链接 Function
阅读全文
摘要:传送门D. Sum of Medianstime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputIn one well-known algorithm ...
阅读全文
摘要:传送门 The task is to find the length of the longest subsequence in a given array of integers such that all elements of the subsequence are sorted in asc
阅读全文