- 博客(24)
- 收藏
- 关注
原创 [基础算法]排序复习
排序复习快速排序找一个哨兵,理论上是找小的放左边,找大的放右边,分成两堆,哨兵就被还原了,然后左右两边递归下去。实际上实现的方法:第一种最简单的方法是双指针交换法,将哨兵放到最左(右),然后两个指针分别从开头和结尾遍历,先动尾指针,找到第一个比哨兵小的,再动头指针,找到第一个比哨兵大的,进行交换。void sort(vector<int>& nums,int left,int right){ if(left>=right) return ; int i=le
2021-08-18 10:51:43
107
原创 以titan rtx为例 在ubuntu server上部署cuda+cudnn+anaconda
之前经常自己搭anaconda,在linux和windows上搭过。上个月给实验室服务器搭环境供大家使用,想着总结一下吧,省得以后再到处找。。。先装个ubuntu server 然后改网络配置ubuntu server18把网络配置变了,网上也能查到 静态配置在 /etc/netplan/50-cloud-init.yaml配置好网络了,我们开始装显卡驱动显卡驱动要去...
2019-12-16 19:10:48
321
原创 解决递归函数需要返回值时的蛋疼问题
int get_mid(node* &a,int n){ if(a==NULL); else { get_mid(a->lch,n); con++; if(con==(n+1)/2) { k=a->x; return k; //这里...
2019-10-22 18:47:55
997
原创 POJ 1556 (toj 1952)The Doors
The DoorsTime Limit:1.0 Seconds Memory Limit:65536KTotal Runs:126 Accepted Runs:69The ProblemYou are to find the length of the shortest path through a chamber containing obstructing w...
2019-07-30 15:58:38
134
原创 2019 多校3 Fansblog
FansblogTime Limit: 2000/2000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1364Accepted Submission(s): 543Problem DescriptionFarmer John keeps a websi...
2019-07-30 15:56:47
356
原创 POJ1696
Space AntTime Limit: 1000MS Memory Limit: 10000K Total Submissions: 5247 Accepted: 3271 DescriptionThe most exciting space discovery occurred at the end of the 20th century. In...
2018-08-29 18:40:02
268
原创 树状数组离散化(求逆序数)
Ultra-QuickSortTime Limit: 2.0 Seconds Memory Limit: 65536KIn this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swapping...
2018-03-31 13:26:21
242
原创 软件测试第三次作业
Use the followingmethod printPrimes() for questions a–dbelow.private static void printPrimes (int n){ int curPrime; // Value currently considered for primeness int numPrimes; // Number of primes fo...
2018-03-25 16:10:47
877
1
原创 Codeforces 627A
A. XOR Equationtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputTwo positive integers a and b have a sum of s and a bitwise XOR of x. How many poss...
2018-03-22 21:41:54
215
原创 软件测试 第一次实验
Tasks:1. Install Junit(4.12),Hamcrest(1.3) with Eclipse2. Install Eclemmawith Eclipse3. Write a javaprogram for the triangle problem and test the program with Junit.a) Desc
2018-03-22 20:00:10
1689
原创 软件测试第二次作业
1. Fault:循环终止条件错误,导致遍历数组时无法访问到x[0],应该为i>=02. x[]为空时,直接抛出空指针错误,不会出发fault3. test:[3,2,5]; y=2 Expected=1 触发fault,没有error4. test:[2,3,5]; y=2 Expected=0 有error,但没有failure 1.Fault:
2018-03-13 21:45:24
359
原创 软件测试第一次作业
Briefly describe an error from your past projects that you have recently completed or an error from other projects which impress you most. State the reason, impact of the reason, impact of the error a
2018-03-13 21:44:58
457
原创 对树状数组的(简单)理解
当时学数据结构的时候,暑假训练的课上得云里雾里,自己还忙于补之前的题,导致只听完了课,内容都没有消化. 学完了树状数组,只知道怎么用,该用的时候还想不起来用...现在细想一下, 简单的树状数组就是 点修改、区间查询,能降一位O(n)到log(n). 现在有一个序列,a[n],假设n=16. 设c[1]=a[1] c[2]=a[1]+a[2]c[3]=a[3] c[4]=a...
2018-03-09 23:07:33
165
原创 2018年全国多校算法寒假训练营练习比赛(第三场) A
链接:https://www.nowcoder.net/acm/contest/75/A夫夫有一天对一个数有多少位数感兴趣,但是他又不想跟凡夫俗子一样,所以他想知道给一个整数n,求n!的在8进制下的位数是多少位。斯特林公式,log以8为底。刚开始特判都忘了..........#include#include#includeusing namespace std;d
2018-02-04 23:11:48
169
原创 2017多校6 1002 hdu 6097
MindisTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1263 Accepted Submission(s): 150Special JudgeProblem DescriptionThe cen
2017-08-10 23:10:34
362
原创 HDU6055 Regular polygon(2017多校第二场)
Regular polygonTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1087 Accepted Submission(s): 405Problem DescriptionOn a two-di
2017-07-28 10:34:03
240
转载 [转][专题学习] [计算几何]
这两天在学习计算几何,随便说说自己的学习过程吧。 基本的叉积、点积和凸包等东西就不多说什么了,网上一搜一大堆,切一些题目基本熟悉了就差不多了。 一些基本的题目可以自己搜索,比如这个blog:http://blog.sina.com.cn/s/blog_49c5866c0100f3om.html 接下来,研究了半平面交,思想方法看07年朱泽园的国家队论文,模板代码参考自
2017-07-07 13:54:08
305
原创 POJ 1566(toj 1952)
The DoorsTime Limit: 1.0 Seconds Memory Limit: 65536KTotal Runs: 126 Accepted Runs: 69The ProblemYou are to find the length of the shortest path through a chamber containing ob
2017-07-05 14:12:23
351
原创 01背包 hdu3446
Proud MerchantsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/65536 K (Java/Others)Total Submission(s): 5983 Accepted Submission(s): 2502Problem DescriptionRecently,
2017-02-20 19:07:54
273
原创 2016多校训练1 hdu5733 tetrahedron
tetrahedronTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1057 Accepted Submission(s): 450Problem DescriptionGiven four poin
2017-02-18 15:57:50
323
原创 hdu1023 Train Problem II 卡特兰数
Train Problem IITime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 9002 Accepted Submission(s): 4817Problem DescriptionAs we all
2017-02-15 10:58:42
271
原创 最长上升子序列 POJ 2533
Longest Ordered SubsequenceTime Limit:2000MSMemory Limit:65536KTotal Submissions:47004Accepted:20885DescriptionA numeric sequence ofaiis ordered ifa1a2
2016-08-09 11:08:28
330
原创 计算几何POJ 2826 接水WA哭
An Easy Problem?!Time Limit: 1000MS Memory Limit: 65536KTotal Submissions: 12375 Accepted: 1897DescriptionIt's raining outside. Farmer Johnson's bull Ben wants some
2016-08-08 17:51:31
896
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人