题目 74. 搜索二维矩阵 思路1(暴力) 遍历二维数组的所有的元素,看看是否存在target 代码 class Solution { public boolean searchMatrix(int[][] matrix, int target) { for (int i = 0; i < matr ...
分类:
其他好文 时间:
2020-12-03 11:50:12
阅读次数:
4
Basic Info 这是CMU 15-213的Malloc Lab,本来没打算做,被同学安利了一波~ 需要用C实现A Dynamic Storage Allocator,类似于libc中的malloc/free/realloc,整体来看难度较大。 开始没什么思路,看了下CSAPP动态内存分配那一节 ...
分类:
其他好文 时间:
2020-12-02 12:40:09
阅读次数:
5
#include <math.h> #include <stdio.h> void solve(double a, double b, double c); int main() { double a, b, c; printf("Enter a, b, c: "); while(scanf("%l ...
分类:
其他好文 时间:
2020-12-02 12:36:07
阅读次数:
9
// 一元二次方程求解 (函数实现方式) // 重复执行, 直到按Ctrl+Z结束 #include <math.h> #include <stdio.h> // 函数声明 void solve(double a, double b, double c); // 主函数 int main() { d ...
分类:
其他好文 时间:
2020-12-02 12:05:39
阅读次数:
5
Java常用类、集合、IO 常用类 Object hashCode() toString() clone() getClass() notify() wait() equals() Math 常用的数学运算 Random 生成随机数 UUID File 创建文件 查看文件 修改文件 删除文件 包装类 ...
分类:
编程语言 时间:
2020-12-01 12:40:11
阅读次数:
12
实验四 实验任务一、 // 一元二次方程求解(函数实现方式) // 重复执行, 直到按下Ctrl+Z结束 #include <math.h> #include <stdio.h> // 函数声明 void solve(double a, double b, double c); // 主函数 int ...
分类:
其他好文 时间:
2020-11-30 16:10:43
阅读次数:
8
题目 题目链接:https://gmoj.net/senior/#main/show/5057 A 君正在玩一款战略游戏,游戏中的规则是这样的: 给定一个 \(n\times m\) 的地图,地图上每一个位置要么是空地,要么是炮塔,要么有若干数量的敌人。现在 A 君要操控炮塔攻击这些敌人。 对于每个 ...
分类:
其他好文 时间:
2020-11-30 16:03:22
阅读次数:
7
给所有link和script标签加随机版本号,方便调试样式,不用每次清缓存了; $("link,script").each(function(){ var t=Math.random().toFixed(4); /*var $tag=$(this).prop("tagName").toLowerCa ...
分类:
其他好文 时间:
2020-11-27 11:46:06
阅读次数:
19
测试第一个博客 献上基于C语言的数据结构之线性表 //线性表 #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include <math.h> #define MAXSIZE 100 type ...
分类:
其他好文 时间:
2020-11-27 10:59:10
阅读次数:
5
一、问题描述 简述 给定有n个整数(可能为负整数)组成的序列a1,a2,...,an,求该序列连续的子段和的最大值。 如果该子段的所有元素和是负整数时定义其最大子段和为0。 Input 第一行有一个正整数n(n<1000),后面跟n个整数,绝对值都小于10000。直到文件结束。 Output 输出它 ...
分类:
其他好文 时间:
2020-11-27 10:54:27
阅读次数:
3