随笔分类 -  ACM

摘要:题意: 有m个猪圈,n个顾客,这些顾客按顺序购买,每个顾客有若干猪圈的钥匙,可以从其中购买猪,在一个顾客买完之后,可以将这个顾客可以打开的猪圈内的猪重新调整,问最多这些顾客能买走多少猪 算法:网路最大流 用顾客来作为节点,顾客数最多为100,时间和空间都可以达到要求。新增源点s,汇点t,对于每个顾客 阅读全文
posted @ 2017-07-31 20:31 枫虹 阅读(118) 评论(0) 推荐(0)
摘要:A - 地震预测 怀特先生是一名研究地震的科学家,最近他发现如果知道某一段时间内的地壳震动能量采样的最小波动值之和,可以有效地预测大地震的发生。 假设已知一段时间的n次地壳震动能量的采样值为a1,a2,…an,那么第i 次采样的最小波动值为min{|ai-aj| | i<j<=n},即第i 次采样的 阅读全文
posted @ 2017-04-16 19:42 枫虹 阅读(219) 评论(0) 推荐(0)
摘要:E - The Values You Can Make Description Pari wants to buy an expensive chocolate from Arya. She has n coins, the value of the i-th coin is ci. The pri 阅读全文
posted @ 2016-07-16 09:03 枫虹 阅读(252) 评论(0) 推荐(0)
摘要:D - Remainders Game Description Today Pari and Arya are playing a game called Remainders. Pari chooses two positive integer x and k, and tells Arya k  阅读全文
posted @ 2016-07-15 21:30 枫虹 阅读(299) 评论(0) 推荐(0)
摘要:C - NP-Hard Problem Description Recently, Pari and Arya did some research about NP-Hard problems and they found the minimum vertex cover problem very 阅读全文
posted @ 2016-07-14 21:47 枫虹 阅读(217) 评论(0) 推荐(0)