摘要: 优先队列priority_queue 本质是一个堆 priority_queue 默认从大到小 //升序队列,小顶堆 priority_queue <int,vector,greater > q; //降序队列,大顶堆 priority_queue <int,vector,less >q; top 阅读全文
posted @ 2020-06-12 22:14 ANwk0525 阅读(146) 评论(0) 推荐(0)
摘要: 奇排列 偶排列 逆序数个数为奇,需要交换奇数次才能到1,2····n顺序排列,个数为偶,需要交换偶数次才能到顺序队列 例题:codeforces987 EPetrandPermutations 阅读全文
posted @ 2020-06-12 21:48 ANwk0525 阅读(98) 评论(0) 推荐(0)
摘要: https://blog.csdn.net/weixin_43890047/article/details/90266596 转载 快速幂qp和矩阵快速幂s_qp 大指数取模 矩阵快速幂 整除和取余Exact division&Remainder 整除 取余 关于gcd和lcm 欧拉函数φ(x)与积 阅读全文
posted @ 2020-06-12 21:42 ANwk0525 阅读(107) 评论(0) 推荐(0)
摘要: E - Enigma 记忆化搜索,水题。比赛时候没敢写,又觉得会超时(为什么要说又!),因为觉得暴搜接近10e1000,觉得就算是记忆化也优化不了。我依稀记得上次给学弟讲BFS里面也有个记忆化搜索也觉得会T没敢写(艹)。 从高位开始,利用大数取模的思路,vis【i】【j】记录 是否到达过该状态,并且 阅读全文
posted @ 2019-11-07 19:14 ANwk0525 阅读(119) 评论(0) 推荐(0)
摘要: 谁还不能每天训练十小时,单切一套题了? 离我的第一次区域赛已经很近了,虽然现在才醒悟好像有点晚了。 All the past, all is overture. 阅读全文
posted @ 2019-11-06 18:26 ANwk0525 阅读(131) 评论(0) 推荐(0)