- 博客(31)
- 资源 (1)
- 收藏
- 关注
原创 codeforces-1399C-Boats Competition
C. Boats Competitiontime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere arennpeople who want to participate in a boat competition. The weight of theii-th participant iswiwi. Only...
2020-08-14 19:18:21
612
原创 codeforces-1399B-Gifts Fixing
B. Gifts Fixingtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou havenngifts and you want to give all of them to children. Of course, you don't want to offend anyone, so all gifts s..
2020-08-14 18:47:46
433
原创 codeforces-1399A-Remove Smallest
A. Remove Smallesttime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given the arrayaaconsisting ofnnpositive (greater than zero) integers.In one move, you can choose two ind...
2020-08-14 17:13:15
781
原创 ssh连接ubuntu虚拟机
看下ubuntu的ssh有没安装ssh localhost如果提示下面这行,说明没安装ssh: connect to hostlocalhost port 22: Connection refused安装sudo apt-get install openssh-server启动service ssh start连接连接工具:MobaXtermifcon...
2020-03-29 12:51:02
505
原创 VirtualBox安装ubuntu系统ip地址显示10.0.2.15
问题:在VirtualBox创建虚拟机后,ifconfig发现地址为10.0.2.15,然后使用window ping命令超时解决:将网络的连接方式改成桥接网卡然后启动虚拟机再次ifconfig,地址就出来了接着window ping一下,发现完事了。...
2020-03-29 12:32:08
5887
8
原创 C 库函数 - fgets()
库:<stdio.h>描述C 库函数char *fgets(char *str, int n, FILE *stream)从指定流stream 读取一行,并把它存储在str所指向的字符串内。读取停止情况:1.读取了(n-1)个字符(最后一个字符要放 '\0' )2.读取到换行符3.读到文件末尾声明char *fgets(char *str, i...
2020-01-09 10:39:53
1096
原创 牛客-剑指Offer-剪绳子
题目描述给你一根长度为n的绳子,请把绳子剪成整数长的m段(m、n都是整数,n>1并且m>1),每段绳子的长度记为k[0],k[1],...,k[m]。请问k[0]xk[1]x...xk[m]可能的最大乘积是多少?例如,当绳子的长度是8时,我们把它剪成长度分别为2、3、3的三段,此时得到的最大乘积是18。输入描述:输入一个数n,意义见题面。(2 <= n <= ...
2020-01-09 09:59:30
242
原创 Cache更新策略
写操作:1.写直达法:修改数据时,既要修改cache中数据,也修改主存中的数据,保持主存数据和cache数据一致缺点:增加访存次数2.写回法:只修改cache中的数据,不修改主存中的数据,当cache中的数据被替换时,才将其中数据写入主存中。...
2019-09-21 21:42:53
1490
3
原创 numpy array数组的最值
import numpy as npif __name__ == '__main__': a = np.arange(9).reshape((3, 3)) print(a) #每列最小 print(np.min(a, axis=0)) #每列最大 print(np.max(a, axis=0)) #每行最小 print(np.mi...
2019-04-24 10:17:30
694
原创 进程通信
进程通信有直接和间接两种方式。 1)直接通信 直接通信是将消息直接发送给指定进程,因此,Send和Receive原语中应指出进程名 字。其调用格式如下: Send(Wh0,Message) Receive(Wh0,Message)发送消息给指定进程或一组进程从约定进程接受消息 2)间接通信 这种通信是以信箱为媒介实现通信的,只...
2018-09-22 00:41:35
487
转载 三角形的内点
在一个平面坐标系中,我们可以选出三个不全在一条线上的点构成一个三角形。我们称一个在三角形内(不包含三角形的边上),横纵坐标皆为整数的点位这个三角形的内点。 对于一个由(0,0)、(n,m)、(p,0)作为顶点构成的三角形,请你设计程序求出他的内点数。输入包括一行,包括三个用空格分隔的整数,分别为n,m,p(0 ≤ n < 32000,0 < m < 32000,0 < ...
2018-08-07 14:59:37
1921
原创 作业的几个时间的概念
以下是教材原话:周转时间:作业提交到作业完成的时间间隔。是作业等待进入内存、进程在就绪队列中等待、进程在CPU上执行和完成I/O操作所花费的时间总和。响应时间:从提交第一个请求到产生第一个响应所用的时间。...
2018-08-07 09:30:56
3433
原创 Linux 删除文件夹和文件的命令
命令:rm-r 就是向下递归,不管有多少级目录,一并删除-f 就是直接强行删除,不作任何提示的意思删除文件夹实例:rm -rf xxx/将会删除xxx目录以及其下所有文件、文件夹...
2018-06-01 13:51:09
389
原创 c++ 遍历map
map<int, int>::iterator it; it = m.begin(); while (it != m.end()) { it++; }
2018-05-31 12:36:16
1890
原创 c++ set中元素唯一
#include<iostream>#include<set>using namespace std;int main(){ set<int>a; a.insert(1); a.insert(1); set<int>::iterator iter=a.begin(); while(iter!=a.end()) { cout&...
2018-05-31 12:16:03
2416
原创 c++遍历set
set<char>::iterator iter = temp1.begin(); while (iter!=temp1.end()) { cout<<*iter; iter++; }
2018-05-30 00:11:11
35509
原创 978A. Remove Duplicates
A. Remove Duplicatestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputPetya has an array aa consisting of nn integers. He wants to remove duplicate (...
2018-05-21 18:19:58
369
原创 linux下编译c程序 c++程序
转载:https://blog.youkuaiyun.com/telnetor/article/details/5555050格式 gcc [option] [sourcefilename]最简单的是:gcc filename.c默认的情况下在c程序所在文件夹下生成a.out的可执行性文件, 只需要在终端上输入./a.out就可以看到执行的结果. c++g++ filename...
2018-05-01 10:54:56
566
原创 codeforces 865A Save the problem!
A. Save the problem!time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAttention: we lost all the test cases
2017-10-01 12:19:04
519
原创 hdu-1049-Climbing Worm
http://acm.hdu.edu.cn/showproblem.php?pid=1049Climbing WormTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 20187 Accepted Submissio
2017-09-29 10:22:25
341
原创 poj-2602-Superlong sums
http://poj.org/problem?id=2602Superlong sumsTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 23519 Accepted: 6974DescriptionThe creators of a new p
2017-09-29 09:35:08
272
原创 天梯赛——L2-004. 这是二叉搜索树吗?
L2-004. 这是二叉搜索树吗?时间限制400 ms内存限制65536 kB代码长度限制8000 B判题程序Standard作者陈越一棵二叉搜索树可被递归地定义为具有下列性质的二叉树:对于任一结点,其左子树中所有结点的键值小于该结点的键值; 其右子树中所有结点的键值大于等于该结点的键值; 其左右子树都是二叉搜索树。所谓二叉搜索树的“镜像”,即...
2017-03-29 17:33:50
1874
原创 codeforces——Counting-out Rhyme
B. Counting-out Rhymen children are standing in a circle and playing the counting-out game. Children are numbered clockwise from1 to n. In the beginning, the first child is considered the leader. The game is played ink steps. In the i-th step the leader c
2017-03-28 11:15:36
593
转载 杭电oj——2050折线分割平面
因为原题有图,我就直接放链接了 原题链接http://acm.hdu.edu.cn/showproblem.php?pid=2050题意:中文题= =思路:1.先看N条直线相交最多能弄出多少个平面当添加第N条直线的时候,要想弄出的平面最多,必须和前面的N-1条直线都相交,增加了N-1个交点(添加第3条直线的时候新增了2个交点),新增N个平面(自己画个图看看),也可以
2017-02-15 12:21:40
901
原创 杭电OJ—— 1014 Uniform Generator
杭电OJ—— 1014 Uniform GeneratorProblem DescriptionComputer simulations often require random numbers. One way to generate pseudo-random numbers is via a function of the formseed(x+1) = [seed(x) + STEP] % MODwhere '%' is th
2016-12-24 10:39:35
482
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人