- 博客(24)
- 收藏
- 关注
原创 [基础算法]排序复习
排序复习 快速排序 找一个哨兵,理论上是找小的放左边,找大的放右边,分成两堆,哨兵就被还原了,然后左右两边递归下去。 实际上实现的方法: 第一种最简单的方法是双指针交换法,将哨兵放到最左(右),然后两个指针分别从开头和结尾遍历,先动尾指针,找到第一个比哨兵小的,再动头指针,找到第一个比哨兵大的,进行交换。 void sort(vector<int>& nums,int left,int right) { if(left>=right) return ; int i=le
2021-08-18 10:51:43
145
1
原创 以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
369
原创 解决递归函数需要返回值时的蛋疼问题
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
1039
原创 POJ 1556 (toj 1952)The Doors
The Doors Time Limit:1.0 Seconds Memory Limit:65536KTotal Runs:126 Accepted Runs:69 The Problem You are to find the length of the shortest path through a chamber containing obstructing w...
2019-07-30 15:58:38
175
原创 2019 多校3 Fansblog
Fansblog Time Limit: 2000/2000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 1364Accepted Submission(s): 543 Problem Description Farmer John keeps a websi...
2019-07-30 15:56:47
474
原创 POJ1696
Space Ant Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 5247 Accepted: 3271 Description The most exciting space discovery occurred at the end of the 20th century. In...
2018-08-29 18:40:02
331
原创 树状数组离散化(求逆序数)
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
287
原创 软件测试第三次作业
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
975
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
250
原创 软件测试 第一次实验
Tasks: 1. Install Junit(4.12),Hamcrest(1.3) with Eclipse 2. Install Eclemmawith Eclipse 3. Write a javaprogram for the triangle problem and test the program with Junit. a) Desc
2018-03-22 20:00:10
1755
原创 软件测试第二次作业
1. Fault:循环终止条件错误,导致遍历数组时无法访问到x[0],应该为i>=0 2. x[]为空时,直接抛出空指针错误,不会出发fault 3. test:[3,2,5]; y=2 Expected=1 触发fault,没有error 4. test:[2,3,5]; y=2 Expected=0 有error,但没有failure 1.Fault:
2018-03-13 21:45:24
430
原创 软件测试第一次作业
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
523
原创 对树状数组的(简单)理解
当时学数据结构的时候,暑假训练的课上得云里雾里,自己还忙于补之前的题,导致只听完了课,内容都没有消化. 学完了树状数组,只知道怎么用,该用的时候还想不起来用...现在细想一下, 简单的树状数组就是 点修改、区间查询,能降一位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
203
原创 2018年全国多校算法寒假训练营练习比赛(第三场) A
链接:https://www.nowcoder.net/acm/contest/75/A 夫夫有一天对一个数有多少位数感兴趣,但是他又不想跟凡夫俗子一样, 所以他想知道给一个整数n,求n!的在8进制下的位数是多少位。 斯特林公式,log以8为底。刚开始特判都忘了.......... #include #include #include using namespace std; d
2018-02-04 23:11:48
229
原创 2017多校6 1002 hdu 6097
Mindis Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 1263 Accepted Submission(s): 150 Special Judge Problem Description The cen
2017-08-10 23:10:34
406
原创 HDU6055 Regular polygon(2017多校第二场)
Regular polygon Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 1087 Accepted Submission(s): 405 Problem Description On a two-di
2017-07-28 10:34:03
286
转载 [转][专题学习] [计算几何]
这两天在学习计算几何,随便说说自己的学习过程吧。 基本的叉积、点积和凸包等东西就不多说什么了,网上一搜一大堆,切一些题目基本熟悉了就差不多了。 一些基本的题目可以自己搜索,比如这个blog:http://blog.sina.com.cn/s/blog_49c5866c0100f3om.html 接下来,研究了半平面交,思想方法看07年朱泽园的国家队论文,模板代码参考自
2017-07-07 13:54:08
346
原创 POJ 1566(toj 1952)
The Doors Time Limit: 1.0 Seconds Memory Limit: 65536K Total Runs: 126 Accepted Runs: 69 The Problem You are to find the length of the shortest path through a chamber containing ob
2017-07-05 14:12:23
395
原创 01背包 hdu3446
Proud Merchants Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/65536 K (Java/Others) Total Submission(s): 5983 Accepted Submission(s): 2502 Problem Description Recently,
2017-02-20 19:07:54
350
原创 2016多校训练1 hdu5733 tetrahedron
tetrahedron Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 1057 Accepted Submission(s): 450 Problem Description Given four poin
2017-02-18 15:57:50
361
原创 hdu1023 Train Problem II 卡特兰数
Train Problem II Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 9002 Accepted Submission(s): 4817 Problem Description As we all
2017-02-15 10:58:42
306
原创 最长上升子序列 POJ 2533
Longest Ordered Subsequence Time Limit:2000MS Memory Limit:65536K Total Submissions:47004 Accepted:20885 Description A numeric sequence ofaiis ordered ifa1a2
2016-08-09 11:08:28
392
原创 计算几何POJ 2826 接水WA哭
An Easy Problem?! Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 12375 Accepted: 1897 Description It's raining outside. Farmer Johnson's bull Ben wants some
2016-08-08 17:51:31
936
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人