B. Working out time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Summer is coming! It's time for Iahub and Iahubina to work out, as they both want to look hot at the beach. The gym where the…
B. Long Path time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output One day, little Vasya found himself in a maze consisting of (n + 1) rooms, numbered from 1 to (n + 1). Initially, Vasya is at th…
D. Bad Luck Island time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output The Bad Luck Island is inhabited by three kinds of species: r rocks, s scissors and p papers. At some moments of time two…
Paladin Manao caught the trail of the ancient Book of Evil in a swampy area. This area contains n settlements numbered from 1 to n. Moving through the swamp is very difficult, so people tramped exactly n - 1 paths. Each of these paths connects some p…
Appleman has a tree with n vertices. Some of the vertices (at least one) are colored black and other vertices are colored white. Consider a set consisting of k (0 ≤ k < n) edges of Appleman's tree. If Appleman deletes these edges from the tree, then…
D. Bag of mice time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output The dragon and the princess are arguing about what to do on the New Year's Eve. The dragon suggests flying to the mountains t…
D. Bag of mice time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output The dragon and the princess are arguing about what to do on the New Year's Eve. The dragon suggests flying to the mountains t…
B. Working outtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputSummer is coming! It's time for Iahub and Iahubina to work out, as they both want to look hot at the beach. The gym where they go is a…
D. Alyona and Strings 题意 给出两个字符串s,t,让找出最长的k个在s,t不相交的公共子串. 思路 看了好几个题解才搞懂. 代码中有注释 代码 #include<bits/stdc++.h> #define pb push_back using namespace std; typedef long long ll; const int N=1e5+10; const int mod=1e9+7; const int inf=0x3f3f3f3f; char s[N],t…
D. Vanya and Treasure time limit per test 1.5 seconds memory limit per test 256 megabytes input standard input output standard output Vanya is in the palace that can be represented as a grid n × m. Each room contains a single chest, an the room locat…
跟一个博客刷: http://blog.csdn.net/cc_again/article/details/25866971 一.简单基础dp 1.递推 HDU 2084 #include <bits/stdc++.h> using namespace std; ; int dp[MAXN][MAXN]; int towel[MAXN][MAXN]; int main(){ int t; scanf("%d", &t); while(t--){ memset(tow…