浏览器标题切换
浏览器标题切换end
上一页 1 ··· 50 51 52 53 54 55 56 57 58 ··· 74 下一页
摘要: 题目链接:http://codeforces.com/problemset/problem/520/B 题意:给出n和m,问从n变到m最少需要几步(有两种操作:乘2或者减1) 思路:本来想着贪心做的,但是失败了。 后来直接简化代码,从m入手,判断m的奇偶,如果为奇数,则n无法通过乘2变成m,所以需要 阅读全文
posted @ 2020-03-15 23:05 抓水母的派大星 阅读(114) 评论(0) 推荐(0)
摘要: 用n条直线,划分平面,最多能够划分为多少块? (n+1)*n/2+1 3->7 3047 位移运算 题目链接:http://www.51nod.com/Challenge/Problem.html#problemId=3047 题意: 给出两个数a,b。问a能否只通过位移运算( >>和 << 可以多 阅读全文
posted @ 2020-03-14 22:25 抓水母的派大星 阅读(348) 评论(0) 推荐(0)
摘要: CodeForces - 1324C 题意: 给出字符串1-len 一只青蛙需要从0位置跳到len+1的位置 每次跳到L需要往回 L-d 跳,跳到R就继续往右跳 R+d 问d最大是多少 思路:d最大取决于任意两个R之间的最大距离,因为一定会跳到len+1的位置,所以应该在最后一位加上R #inclu 阅读全文
posted @ 2020-03-14 22:18 抓水母的派大星 阅读(130) 评论(0) 推荐(0)
摘要: 线段树变形~ AC代码: 1 #include<stdio.h> 2 #include<iostream> 3 #include<string.h> 4 #include<algorithm> 5 #include<queue> 6 using namespace std; 7 #define in 阅读全文
posted @ 2020-03-12 22:27 抓水母的派大星 阅读(148) 评论(0) 推荐(0)
摘要: 题目链接:HDU - 1542 样例: Sample Input 2 10 10 20 20 15 15 25 25.5 0 Sample Output Test case #1 Total explored area: 180.00 题意:给出一个n,n≠0,给出n行数据,每一行给出一个矩形的左下 阅读全文
posted @ 2020-03-11 21:41 抓水母的派大星 阅读(143) 评论(0) 推荐(0)
摘要: 题面: Starting with x and repeatedly multiplying by x, we can compute x31 with thirty multiplications: x2 = x × x, x3 = x2 × x, x4 = x3 × x, …, x31 = x3 阅读全文
posted @ 2020-03-10 21:42 抓水母的派大星 阅读(172) 评论(0) 推荐(0)
摘要: 题面: Given an N*N matrix A, whose elements are either 0 or 1. A[i, j] means the number in the i-th row and j-th column. Initially we have A[i, j] = 0 ( 阅读全文
posted @ 2020-03-09 22:29 抓水母的派大星 阅读(133) 评论(0) 推荐(0)
摘要: 题目链接:CodeForces - 1321E 题意:给出一串长度为n的字符串,遍历整个字符串,若该字符的前或后一个字符是字典序在该字符在字典序的前一位,就可以删除 问:最多能够删除多少个 思路:如果直接遍历暴力判断,第一组样例就可以看出不对 所以最优选择就是从z开始到a去遍历整个字符串 给两组另外 阅读全文
posted @ 2020-03-09 20:07 抓水母的派大星 阅读(138) 评论(4) 推荐(1)
摘要: 安装MySQL网址: https://www.mysql.com/downloads/,进入页面后拉到底部选择 MySQL Community Server 即可。 配置环境变量,在 ~/.zshrc 文件中添加如下代码: alias mysql=/usr/local/mysql/bin/mysql 阅读全文
posted @ 2020-03-09 14:59 抓水母的派大星 阅读(124) 评论(0) 推荐(0)
摘要: int等是基本类型,class包括interface、String)的本质是数据类型。 JVM动态加载class,类似于C语言用到的时候去调用函数,用不到的时候可能永远不会调用 class实例是JVM内部创建的,class类的构造方法是private,只有JVM能创建class实例,我们自己的Jav 阅读全文
posted @ 2020-03-08 23:00 抓水母的派大星 阅读(79) 评论(0) 推荐(0)
上一页 1 ··· 50 51 52 53 54 55 56 57 58 ··· 74 下一页