POJ 2152 fire / SCU 2977 fire(树型动态规划) Description Country Z has N cities, which are numbered from 1 to N. Cities are connected by highways, and there is exact one path between two different cities. Recently country Z often caught fire, so the governm…
Godfather Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 7536 Accepted: 2659 Description Last years Chicago was full of gangster fights and strange murders. The chief of the police got really tired of all these crimes, and decided to…
Anniversary party Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 3863 Accepted: 2172 Description There is going to be a party to celebrate the 80-th Anniversary of the Ural State University. The University has a hierarchical structure…
#include<cstdio> #include<cstring> #include<algorithm> using namespace std; const int maxn=105; int head[maxn<<1],to[maxn<<1],val[maxn],nex[maxn<<1]; int F[maxn][maxn<<1],G[maxn][maxn<<1]; int cnt,V; void ad…
Anniversary party Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 6955 Accepted: 4003 Description There is going to be a party to celebrate the 80-th Anniversary of the Ural State University. The University has a hierarchical structure…
Two Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 1092 Accepted: 527 Description The city consists of intersections and streets that connect them. Heavy snow covered the city so the mayor Milan gave to the winter-service a list of st…
Mondriaan's Dream Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 16771 Accepted: 9683 Description Squares and rectangles fascinated the famous Dutch painter Piet Mondriaan. One night, after producing the drawings in his 'toilet series…