@中文题意@ n*m的矩阵,当两个点(x1, y1)与(x2, y2)曼哈顿距离为3时可以将两个点匹配.每个点只能够与一个点匹配.求最多能可以匹配多少个点.n,m <= 10^9 (xi,yi) and (xj,yj) is defined as |xi−xj|+|yi−yj|. @分析@ [这种题也只能够手算小数据来找规律……] 首先弄清楚一个上界:对于任意的n∗mn∗m n*mn∗m矩阵,如果n与m都为奇数,则答案最大为nm-1:否则答案最大为nm. 不妨假设n <= m. 当 n = 1…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Amr loves Chemistry, and specially doing experiments. He is preparing for a new interesting experiment. Amr has n different types of chemicals. E…
time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Kolya Gerasimov loves kefir very much. He lives in year 1984 and knows all the details of buying this delicious drink. One day, as you probab…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Little Lesha loves listening to music via his smartphone. But the smartphone doesn't have much memory, so Lesha listens to his favorite songs in…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Limak is a little bear who loves to play. Today he is playing by destroying block towers. He built n towers in a row. The i-th tower is made of h…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Anton loves transforming one permutation into another one by swapping elements for money, and Ira doesn't like paying for stupid games. Help them…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output A schoolboy named Vasya loves reading books on programming and mathematics. He has recently read an encyclopedia article that described the meth…