摘要: 原题链接 https://codeforces.com/problemset/problem/1490/C 题目 题意 如果一个数 n = x3 + y3 (x, y可以相等, 且> 0) 输出YES, 否则输出NO 题解 暴力会超时, 但二分可以, 其实二分也很暴力, 哈哈, 二分没问题就完事了 阅读全文
posted @ 2021-03-28 21:51 la-la-wanf 阅读(104) 评论(0) 推荐(1) 编辑
摘要: 1.答案有确定的范围(时间复杂度一般近似O[lg(right-left+1)];2. 问题的答案是单调的 注意: check验证函数的编写是二分答案的核心。出不出错就看它了 查找值的时候, 记得中间等于号的使用: 理解至上: 当mid = l + r + 1 , 取到的值是偏右的, l没有问题, 后 阅读全文
posted @ 2021-03-28 21:37 la-la-wanf 阅读(97) 评论(0) 推荐(0) 编辑
摘要: 题目链接 https://codeforces.com/contest/1506/problem/A 原题 1506A - Strange Table Example input 5 1 1 1 2 2 3 3 5 11 100 100 7312 1000000 1000000 1000000000 阅读全文
posted @ 2021-03-26 19:47 la-la-wanf 阅读(81) 评论(0) 推荐(0) 编辑
摘要: 传送门: https://codeforces.com/contest/1484/problem/B 原题 Example input 6 6 1 9 17 6 14 3 3 4 2 2 3 7 3 4 3 2 2 4 5 0 1000000000 0 1000000000 0 2 1 1 outp 阅读全文
posted @ 2021-03-22 17:50 la-la-wanf 阅读(69) 评论(0) 推荐(0) 编辑
摘要: 我觉得我可以继续wa下去(手动魔鬼笑) 原题链接:https://ac.nowcoder.com/acm/contest/12986/J 示例1 输入 5 1 5 2 3 4 1 输出 0 0 0 0 0 示例2 输入 6 1 1 1 4 5 1 4 输出 0 0 3 4 0 3 题意给定n个数, 阅读全文
posted @ 2021-03-22 09:42 la-la-wanf 阅读(32) 评论(0) 推荐(0) 编辑
摘要: A题英语漏洞 A题传送门: https://codeforces.com/contest/1501/problem/A 其实题目说的很明白, 只是我傻傻的会错了意, 话不多说, 开整. 前两行是说, 火车从i - 1站到 i 站所需时间, 下面的1说的是它在车站上的时间至少为⌈bi−ai⌉/2(除法 阅读全文
posted @ 2021-03-14 18:58 la-la-wanf 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 传送门 https://codeforces.com/contest/1496/problem/B 题目 Example input 5 4 1 0 1 3 4 3 1 0 1 4 3 0 0 1 4 3 2 0 1 2 3 2 1 2 3 output 4 4 3 5 3 Note In the 阅读全文
posted @ 2021-03-11 15:21 la-la-wanf 阅读(97) 评论(1) 推荐(1) 编辑
摘要: 传送门: https://codeforces.com/contest/1493/problem/B 题目: Example input 5 24 60 12:21 24 60 23:59 90 80 52:26 1 100 00:01 10 10 04:04 output 12:21 00:00 阅读全文
posted @ 2021-03-08 16:35 la-la-wanf 阅读(176) 评论(0) 推荐(0) 编辑
摘要: 1.AND按位与(&)【有0则0】运算规则:0&0=0;0&1=0;1&0=0;1&1=1; 用途:(1)取出一个数的指定位。指定位&1,其余位&0。 例:设x=11101100,取x的低四位。令x&00001111=00001100 快速幂里, b & 1 得到的是b的二进制最后一位, (因为1的 阅读全文
posted @ 2021-03-03 20:11 la-la-wanf 阅读(43) 评论(0) 推荐(0) 编辑
摘要: 一. 原题链接 https://codeforces.com/contest/1494/problem/B 二. 题意 + 题解: 没看懂题目, 懵了好久, 先狡辩一下当时误解的句子, 英语是硬伤了, 呜呜 exactly U cells in the top row are black; //意为 阅读全文
posted @ 2021-03-03 11:01 la-la-wanf 阅读(226) 评论(0) 推荐(0) 编辑