#include<stdio.h> #include<queue> #include<string.h> using namespace std; #define inf 0x7fffffff #define N 300 int p,t,n; int Min(int a,int b) { return a>b?b:a; } struct node { int u,v,w,f; }mp[40001]; int flow[N][N],d[N]; int bfs(…
#include<stdio.h> #include<string.h> #define N 200 int Min(int a,int b) { return a>b?b:a; } int Max(int a,int b) { return a>b?a:b; } int map[N][N],flag,visit[N][N],n,min,max; int dis[4][2]={1,0,-1,0,0,1,0,-1}; void init() { int i,j; min=…
Desert King Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 25310 Accepted: 7022 Description David the Great has just become the king of a desert country. To win the respect of his people, he decided to build channels all over his coun…
Given a non-empty binary search tree and a target value, find k values in the BST that are closest to the target. Note: Given target value is a floating point. You may assume k is always valid, that is: k ≤ total nodes. You are guaranteed to have onl…
Given a non-empty binary search tree and a target value, find the value in the BST that is closest to the target. Note: Given target value is a floating point. You are guaranteed to have only one unique value in the BST that is closest to the target.…
Time Limit: 7000/3500 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 2229 Accepted Submission(s): 252 Problem Description The shorter, the simpler. With this problem, you should be convinced of this truth. Y…
C. Road to Cinema time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vasya is currently at a car rental service, and he wants to reach cinema. The film he has bought a ticket for starts in t m…
1014: [JSOI2008]火星人prefix Time Limit: 10 Sec Memory Limit: 162 MBSubmit: 6243 Solved: 2007[Submit][Status][Discuss] Description 火星人最近研究了一种操作:求一个字串两个后缀的公共前缀.比方说,有这样一个字符串:madamimadam,我们将这个字符串的各个字符予以标号:序号: 1 2 3 4 5 6 7 8 9 10 11 字符 m a d a m i m a d…
D. Exams time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vasiliy has an exam period which will continue for n days. He has to pass exams on m subjects. Subjects are numbered from 1 to m. Ab…