随笔分类 - 算法—搜索—meet in the middle
摘要:题意 "题目链接" Sol 发现abcdef是互不相关的 那么meet in the middle一下。先算出abc的,再算def的 注意d = 0的时候不合法(害我wa了两发。。) cpp include define LL long long using namespace std; const
阅读全文
摘要:题意 "题目链接" Sol 把前一半放在左边,后一半放在右边 meet in the middle一波 统计答案的时候开始想的是hash,然而MLE了两个点 实际上只要排序之后双指针扫一遍就行了 cpp include using namespace std; const int MAXN = 7,
阅读全文
摘要:time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output time limit per test 3 seconds time limit
阅读全文
摘要:钻石 diamond.in/.out/.cpp 【问题描述】 你有 n 个 “量子态” 的盒子,每个盒子里可能是一些钱也可能是一个钻 石。 现在你知道如果打开第 i 个盒子,有P i 100 Pi100 的概率能获得V i Vi 的钱,有1-P i 100 Pi100 的概率能获得一个钻石。 现在你
阅读全文