复旦大学往年计算机机试题及题解(2015 ~2019)

复旦大学2021年计算机学院机试题解 2021年复旦计算机学院机试题解 阅读详情

2019年

1 相隔天数

题目:输入日期格式:YYYYMMDD,求与20190205相隔的天数。

样例:

  • 输入:20190208
  • 输出:3
/*思路:把输入的日期和20190208都转换到20190101,天数分别记为count1,count2,然后再计算YYYY到2019之间相隔的天数count,最后相隔的天数就等于abs(count+count1-count2)(注意:count可能为负数)
*/
#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;

bool isLeapYear(int y){
	if ((y % 100 != 0 && y % 4 == 0) || y % 400 == 0){
		return true;
	}
	return false;
}

int main(){
	int yea[2] = {365, 366};
	int mon[2][13] = {
		{0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},
		{0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}
	};
	//year, month, day表示输入的年月日
	//count记录从year0101到20190101之间的天数
	//count1记录从yearmonthday到year0101的之间的天数
	//count2记录从20190205到20190101的之间的天数
	int year, month, day, count = 0, count1 = 0, count2 = 35;
	scanf("%4d%2d%2d", &year, &month, &day);
	//将输入的年月日转换到year0101
	while (month > 1){
		month--;
		count1 += mon[isLeapYear(year)][month];
	}
	if (day > 1){
		count1 += day - 1;
	}
	//将year转换到2019
	while (year > 2019){
		year--;
		count += yea[isLeapYear(year)];
	}
	
	while (year < 2019){
		count += yea[isLeapYear(year)];
		year++;
	}
	printf("%d", abs(count + count1 - count2));
	return 0;
}

2 最大连续子序列

题目:给定一个数字序列A1,A2…An,求i,j(1<=i<=j<=n),使得Ai+…+Aj最大,输出这个最大和。

样例:

  • 输入:6 -2 11 -4 13 -5 -2

  • 输出:20

/*思路:动态规划求解
*/
#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
const int MAXN = 10010;
int dp[MAXN], A[MAXN];

int main(){
	int n;
	cin >> n;
	for (int i = 0; i < n; i++){
		cin >> A[i];
	}
	//边界
	dp[0] = A[0];
	//状态转移方程
	for (int i = 1; i < n; i++){
		dp[i] = max(dp[i-1] + A[i], A[i]);
	}
	int k = 0;
	for (int i = 1; i < n; i++){
		if (dp[i] > dp[k]){
			k = i;
		}
	}
	cout << dp[k];
	return 0;
}

3 有向树形态

题目:求N个结点能够组成的二叉树的个数。

样例:

  • 输入:3

  • 输出:5

分析:求N个结点能够组成的二叉树的个数考察的是卡特兰数原理(如下图),所以我们只要求出下面式子的结果即可;但由于输出的数会很大,long long类型会溢出,所以只能用字符串实现大数的加减乘除。(Java类库中内置了BigInter类,所以不需要自己写)

在这里插入图片描述

#include <cstdio>
#include <iostream>
#include <cstring>
#include <string>
using namespace std;
const int MAXN = 10000;

struct bignum{
	int d[MAXN];
	int len;
	bignum(){
		memset(d, 0, sizeof(d));
		len = 0;
	}
};

bignum change(string str){
	bignum a;
	a.len = str.size();
	for (int i = 0; i < a.len; i++){
		a.d[i] = str[a.len - i - 1] - '0';
	}
	return a;
}

bignum multi(bignum a, int b){
	bignum c;
	int carry = 0;
	for (int i = 0; i < a.len; i++){
		int temp = a.d[i] * b + carry;
		c.d[c.len++] = temp % 10;
		carry = temp / 10;
	}
	while (carry != 0){
		c.d[c.len++] = carry % 10;
		carry /= 10;
	}
	return c;
}

bignum divide(bignum a, int b, int &r){
	bignum c;
	c.len = a.len;
	for (int i = a.len - 1; i >= 0; i--){
		r = r * 10 + a.d[i];
		if (r < b) c.d[i] = 0;
		if (r > b){
			c.d[i] = r / b;
			r = r % b;
		}
	}
	while (c.len > 1 && c.d[c.len - 1] == 0){
		c.len--;
	}
	return c;
}

void print(bignum a){
	for (int i = a.len - 1; i >= 0; i--){
		printf("%d", a.d[i]);
	}
}


int main(){
	int n, r = 0;
	cin >> n;
	string str = "1";
	bignum a = change(str);
	for (int i = 2 * n; i > n; i--){
		a = multi(a, i);
	}
	for (int i = n; i >= 1; i--){
		a = divide(a, i, r);
	}
	a = divide(a, n + 1, r);
	print(a);
	return 0;
}

2018年

1 求众数

题目:众数就是一个序列中出现次数最多的数字。如果不唯一,则输出小的那个值。(每个数字都在int范围内)

样例:

  • 输入:8

    10 3 8 8 3 2 2 2

  • 输出:2

//用map实现
#include <iostream>
#include <cstdio>
#include <map>
using namespace std;

int main(){
	int n, num;
	cin >> n;
	map<int, int> mp;
	for (int i = 0; i < n; i++){
		cin >> num;
		mp[num]++;
	}
	int ans, max = 0;
	for (map<int, int>::iterator it = mp.begin(); it != mp.end(); it++){
		if (it->second > max){
			max = it->second;
			ans = it->first;
		}
	}
	cout << ans;	
	return 0;
}

2 解方程

题目:给定一个字符串,代表一个 一元一次 方程。 如果有解求解,输出格式“x=数字” ;如果解的个数无穷,输出 “infinite solutions”;如果没有解输出“no solution”。字符串长度不超过 256 。

样例:

  • 输入:10x-2x-8=4x+7+x
  • 输出:x=5
#include <cstdio>
#include <string>
#include <iostream>
using namespace std;
string str;
int main()
{
	cin >> str;
	int a = 0, b = 0, sym = 1, i = 0, flag = 1;//sym表示符号,flag=1表示等式左边,flag=-1表示等式右边
	while (i < str.size()){
		if (str[i] == '=') {	//遇到等号时,sym置1规避之前的影响
			flag = -1;
			sym = 1;
		}  
		else if(str[i]=='+') sym = 1;
		else if(str[i]=='-') sym = -1;
		else {
			int t = 0;
			while(i < str.size() && str[i] >= '0' && str[i] <= '9'){
				t = 10 * t + (str[i] - '0');
				i++;
			}
			if (i >= str.size()) {//当表达式最后是数字时单独判断,如4x-1=2x+3,否则会越界 
				b -= t * sym;
				break;
			}
			if (str[i] == 'x' && t == 0) a += sym * flag;	//x前系数为正负1时单独判断处理
			else if(str[i] == 'x')	a += t * sym * flag;	//处理系数
			else {	//处理常数
				b += t * sym * flag;
				continue;
			}
		}
		i++;
	}
	if (a == 0 && b == 0) printf("infinite solutions\n");
	else if(a != 0 && b % a == 0) printf("x=%d\n", -b/a);
	else printf("no solution\n");
	return 0;
}

3 骨牌

题目:有 2*n 的地板,用 1*2 和 2*1 的骨牌进行铺地板。问共有多少种情况。 结果对 999983 取余。(1<=n<=10000)

样例:

  • 输入:6

  • 输出:12

//动态规划
#include <iostream>
#include <cstdio>
using namespace std;
const int MAXN = 10010;
int dp[MAXN];

int main(){
	int n;
	cin >> n;
	//边界
	dp[1] = 1;
	dp[2] = 2;
	//状态转移方程
	for (int i = 3; i <= n; i++){
		dp[i] = dp[i-1] + dp[i-2];
	}
	cout << dp[n];
	return 0;
}

2017年

1 中位数

题目:给定一个整数序列,求中位数。

样例:

  • 输入:5

    3 2 5 3 7

  • 输出:

    3

#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
const int MAXN = 10010;
int A[MAXN];

int main(){
	int n;
	cin >> n;
	for (int i = 0; i < n; i++){
		cin >> A[i];
	}
	sort(A, A + n - 1);
	if (n % 2 == 1){
		cout << A[n/2];
	} else {
		double ans = (double)(A[n/2-1] + A[n/2]) / 2;
		cout << ans;
	}
	return 0;
}

2 求校验位

题目:给定一个9位数字的ISBN,求其校验位。ISBN格式为2-02-033598。校验位的计算方法为:从左到右依次将各位数字乘10,9,8,7,6,5,4,3,2;求出其和为S,做模运算得M=S mod 11。若11-M在1和9之间,校验和即为该数字;若11-M等于10,校验位为X;11-M等于11,校验位为0。输出添加校验位的ISBN,如2-02-033598-0。

样例:

  • 输入:

    2-02-033598

  • 输出:

    2-02-033598-0

#include <iostream>
#include <cstdio>
#include <string>
using namespace std;

int main(){
	string str;
	cin >> str;
	int k = 10, s = 0;
	for (int i = 0; i < str.size(); i++){
		if (str[i] >= '0' && str[i] <= '9'){
			s += (str[i] - '0') * k;
			k--;
		}
	}
	int m = s % 11;
  int M = 11 - m;
	if (M >= 1 && M <= 9){
		str += '-';
		str += ('0' + M);
	} else if (M == 10){
		str += "-X";
	} else if (M == 11){
		str += "-0";
	}
	cout << str;
	return 0;
}

3 最小生成树

题目:一个无向图,定点为N个,其中M条边已经给定,现在要从K条备选边中选出若干条,使得整个图连通,且选出的边权值和最小。

示例:

  • 输入:

    4 4
    1 2 2
    1 4 1
    2 3 3
    3 4 4

  • 输出:6

Prim算法

#include <cstdio>
#include <iostream>
#include <algorithm>
using namespace std;
const int MAXV = 1000;	//最大顶点数
const int INF = 99999999;

int w[MAXV][MAXV];
int d[MAXV];
int vis[MAXV] = {false};

int prim(int n){
	fill(d, d + MAXV, INF);
	d[1] = 0;	//顶点下标从1开始
	int ans = 0;
	for (int i = 1; i <= n; i++){
		int u = -1, MIN = INF;
		for (int j = 1; j <= n; j++){
			if (vis[j] == false && d[j] < MIN){
				u = j;
				MIN = d[j];
			}
		}
		if (u == -1) return -1;
		vis[u] = true;
		ans += d[u];
		for (int v = 1; v <= n; v++){
			if (vis[v] == false && w[u][v] != INF && w[u][v] < d[v]){
				d[v] = w[u][v];
			}
		}
	}
	return ans;
}


int main(){
	int n, m;	//n个顶点,m条边
	cin >> n >> m;
	fill(w[0], w[0] + MAXV * MAXV, INF);
	for (int i = 0; i < m; i++){
		int v1, v2, weight;
		cin >> v1 >> v2 >> weight;
		w[v1][v2] = w[v2][v1] = weight;
	}
	cout << prim(n);
	return 0;
}

2016

1 最大公共子串长度

题目:给定两个字符串,求最大公共子串的长度。

样例:

  • 输入:fdfdfd42543 232fdfdfdjlkj

  • 输出:6

暴力解法,时间复杂度O(n3)(可能会超时):

#include <iostream>
#include <string>
using namespace std;

int main() {
	string str1, str2;
	cin >> str1 >> str2;
	int max = -1;
	for (int i = 0; i < str1.length(); i++) {
		for (int j = 1; j < str1.length() - i - 1; j++) {
			int pos = str2.find(str1.substr(i, j));
			if ((pos >= 0)&& j > max) {
				max = j;
			}
		}
	}
	cout << max << endl;
	return 0;
}

动态规划:

#include <iostream>
#include <string>
#include <cstdio>
using namespace std;
const int MAXN = 10010;
int dp[MAXN][MAXN];

int main() {
	string str1, str2;
	cin >> str1 >> str2;
	//边界
	for (int i = 0; i < str1.size(); i++){
		dp[i][0] = 0;
	}
	for (int j = 0; j < str2.size(); j++){
		dp[0][j] = 0;
	}
	//状态转移方程
	int max = -1;
	for (int i = 1; i <= str1.size(); i++){
		for (int j = 1; j <= str2.size(); j++){
			if (str1[i - 1] != str2[j - 1]){
				dp[i][j] = 0;
			} else {
				dp[i][j] = dp[i-1][j-1] + 1;
			}
			if (dp[i][j] > max){
				max = dp[i][j];
			}
		}
	}
	cout << max;
	return 0;
}

2 后缀序列

题目:给定一个后缀序列,要求求值,只有加减(根据题目描述,自己编的用例)

示例:

  • 输入:

    23+1+

  • 输出:

    6

#include <cstdio>
#include <iostream>
#include <string>
#include <stack>
using namespace std;

int main(){
	int temp1, temp2;
	char cur;
	string str;
	getline(cin, str);
	int i = 0;
	stack<int> st;
	while (i < str.size()){
		cur = str[i];
		if (cur >= '0' && cur <= '9') st.push(cur - '0');
		else {
			temp2 = st.top();
			st.pop();
			temp1 = st.top();
			st.pop();
			if (cur == '+') st.push(temp1 + temp2);
			else if (cur == '-') st.push(temp1 - temp2);
		}
		i++;
	}
	cout << st.top();
	return 0;
}

3 哈夫曼编码

题目:

给定一个字符串,求哈夫曼编码的最短长度。

样例:

  • 输入:

    aaaaabbbbcccdde

  • 输出:

    33

#include <cstdio>
#include <iostream>
#include <queue>
using namespace std;
const int MAXN = 130;
int ch[MAXN];

int main(){
	priority_queue<int, vector<int>, greater<int>> q;
	string str;
	cin >> str;
	for (int i = 0; i < str.size(); i++){
		ch[str[i]]++;
	}
	for (int i = 0; i < MAXN; i++){
		if (ch[i] != 0){
			q.push(ch[i]);
		}
	}
	int count = 0;
	while(q.size() > 1){
		int temp1 = q.top();
		q.pop();
		int temp2 = q.top();
		q.pop();
		q.push(temp1 + temp2);
		count += (temp1 + temp2);
	}
	cout << count;
	return 0;
}

2015

1 长方形中的正方形

题目:

给出长方形的长和宽,每次从长方形里撕去最大的正方形,输出最后能得到多少正方形?

#include <iostream>
using namespace std;

int squre(int X, int Y){
	int count = 0;
	while (X != Y){
		if (X > Y){
			X = X - Y;
		} else {
			Y = Y - X;
		}
		count++;
	}
	count++;
	return count;
}


int main(){
	int X, Y;
	cin >> X >> Y;
	cout << squre(X, Y);
	return 0;
}

2 a与b得到c

题目:

给出 a,b,c(3 个整数),判断 a,b 能否通过±*/得到c,ab可以交换位置,可以输出YES,不行输出NO

#include <cstdio>
#include <iostream>
using namespace std;

bool judge(long long a, long long b, long long c){
	if (a + b == c) return true;
	if (a * b == c) return true;
	if (a - b == c || b - a == c) return true;
	if (b != 0 && a % b == 0 && a / b == c) return true;
	if (a != 0 && b % a == 0 && b / a == c) return true;
	return false;
}


int main(){
	long long a, b, c;
	cin >> a >> b >> c;
	if(judge(a, b, c)) cout << "YES";
	else cout << "NO";
	return 0;
}

3 实现一个优先队列

题目:给出优先队列的实现,实现 4 个操作

  • ADD N P:往队列里加入id为N的优先级为P的任务
  • NEXT:输出下一个最高优先级的任务的id,如果优先级相同输出id小的任务,若队列中没有任务输出-1
  • REMOVE N:移除id为N的任务
  • COUNT:输出队列中的任务数量

示例:

  • 输入:

    10
    ADD 1 1
    ADD 2 3
    ADD 3 2
    ADD 4 3
    NEXT 
    REMOVE 3
    COUNT 
    NEXT
    NEXT
    NEXT
    
  • 输出:

    2
    2
    4
    1
    -1
    
#include<iostream>    
#include<set>
#include<string>
using namespace std;
struct node {
	int N, P;
	bool operator<(const node& A)const {return P != A.P ? P > A.P : N < A.N;}
};
 int main() { 
	 int n;
	 set<node>S;
	 scanf("%d", &n);
	 for (int i = 0; i < n; i++) {
		 string op;
		 cin >> op;
		 if (op[0] == 'A') {
			 node tmp;
			 scanf("%d%d", &tmp.N, &tmp.P);
			 S.insert(tmp);
		 }
		 else if (op[0] == 'N') {
			 if (S.size() == 0)
				 printf("-1\n");
			 else {
				 printf("%d\n", S.begin()->N);
				 S.erase(S.begin());
			 }
		 }
		 else if (op[0] == 'R') {
			 int ID;
			 scanf("%d", &ID);
			 for (auto it = S.begin(); it != S.end(); it++) {
				 if (it->N == ID) {
					 S.erase(it);
					 break;
				 }
			 }
		 }
		 else if (op[0] == 'C')
			 printf("%d\n", S.size());
	 }
	 return 0;
}


计算机考研资料库!近五十所高校计算机考研资料分享!持续更新中! 由于文章内无法添加百度云链接,所以领取方式可以看这里 计算机考研资料库目录!(1) 计算机考研资料库目录!(2) 以下是考研资料库内已有资料,更多资料持续更新中,如果你需要哪个学校的计算机相关专业真题或者其他资料,可以留言,我会优先进行搜集,所以资料全部免费领取,没有任何套路     统考408 真题 【2009】【2010】【2011】【2012】【2013】【2014】【2015】【2016】【2017】【2018】【2019】【2020】【2021】     北 阅读详情

相关推荐

跨厂商网络设备的RADIUS认证:Windows NPS的兼容性与最佳实践

本文详细探讨了Windows NPS在多厂商网络环境中的RADIUS认证实践,特别针对华为、华三、思科等主流设备的兼容性问题提供解决方案。从基础配置到高级优化,涵盖VSA属性映射、认证协议选择及安全加固措施,帮助企业实现统一身份认证并提升网络安全性。

weixin_29213827的博客 421

复旦计院、工研院2019机试真题及答案详解

A相隔天数 输入一个 yyyymmdd 格式的时间,如 20190318,计算与 20190205 相差的天数, 取绝对值,所有输入在 19000101 和 21000101 之间。 样例输入:20190208 输出:3 #include<iostream> using namespace std; int month_day[13][2] {{0,0},{31,31},{28,29},{31,31},{30,30},{31,31},{30,30},{31,31},{31,31.

m0_43400216的博客 8945

用Arduino Mega2560和TB6612驱动MG513电机,我踩过的坑和最佳实践

本文详细介绍了使用Arduino Mega2560和TB6612驱动模块控制MG513直流电机的实战经验,包括硬件连接、PWM配置、编码器信号处理等关键技巧。通过优化电源系统、信号线布局和软件控制算法,有效解决了电机抖动、转速不稳等常见问题,为机器人底盘和自动化项目提供了可靠解决方案。

weixin_42520573的博客 202

2020年复旦大学夏令营机试题及代码(VS2019 && C++)

注:代码是本菜鸡自己个儿写的,没有找到参考答案,欢迎各位大佬批评指正. 题目如下图所示(图片来源网上): 第1题 该题主要考察拓扑排序.其实该算法有通用模板,但我写的时候没有意识到使用,代码不是很规范. #define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <vector> #include <queue> using namespace std; const int maxn = 110;

weixin_43595277的博客 1299

Discrete Optimization (Coursera) 学习笔记 Week 1 introduction (开个帖子)

Week 1 Introduction 这位教授Pascal Van Hentenryck 真的算是优化领域神级别的人物了吧?截一张Google scholar的图大家感受一下… 居然在Coursera上看到了他开的课:Discrete Optimization。试听了几节后,发现讲得很有激情,而且深入浅出。遂决定花暑假跟完这一门课。 这门课每周花两三个小时介绍基础概念,然后得花十几个小时写作业(coding)… 一开始以为Coursera上的课的作业应该不会太难,然后第一次作业(knapsack)我就被

ZJ_11701的博客 656

Anthropic三件套重构AI工作流:Claude Code、Design与桌面宠物实战指南

AI协作已从单点工具迈入系统化工作流阶段。理解AI作为‘协作者’而非‘执行器’的本质,是提升工程效率的关键前提;其核心在于对任务调度、自适应推理与人机交互边界的重新定义。Claude Code的xhigh effort机制体现了分层推理的工程智慧,Claude Design以HTML为原生设计语言实现设计-代码一体化,而桌面宠物则将抽象的token消耗具象为可感知的硬件反馈。这些能力共同指向一个趋势:AI工作流正从prompt调参走向契约式委派、从界面割裂走向跨模态统一。本文结合Opus 4.7最新实践,解

a4512138的专栏 484

2020复旦大学计算机夏令营机试题

2020复旦大学计算机夏令营机试题 这个是开卷编程,不计入成绩,但是面试会问你做的情况。

taylor13的博客 2512

schrodinger 薛定谔

链接: https://pan.baidu.com/s/1Duh4GsoytIklvZp7TdHpWg 密码: wmr1 Linux系统版 进入 Schrodinger_Suites_2021-2_Linux-x86_64 sudo ./INSTALL 中间按默认的来即可,也可以自己调整安装目录。安装目录一定要记住。 安装完,把patcher 拷贝到安装目录 sudo ./patcher 点击Patch即可。 启动程序,进入安装目录 ./maestro ...

周迪新的博客 1万+

复旦计专历年机试题(更新)

复旦计专历年机试题

yufanwenshu的博客 2842

在昇腾910B上,用kubeadm快速拉起一个双节点K8s集群(保姆级避坑指南)

本文详细介绍了在昇腾910B服务器上使用kubeadm快速搭建双节点Kubernetes集群的完整流程,包括环境准备、容器运行时配置、kubeadm初始化、节点加入与网络插件部署等关键步骤,特别针对ARM架构和昇腾芯片提供了优化配置和避坑指南。

weixin_29204749的博客 246

【03】海康MVS V4.3.0 ——安装教程、查看示例、库、头文件、开发指南

海康威视MVS机器视觉软件安装与使用指南:首先从官网下载MVS 4.3.0安装包,默认设置完成安装。安装后可在Development目录查看示例代码、开发文档及头文件,支持C++/C#/Python等多语言开发。软件内置虚拟相机功能,通过工具菜单添加虚拟设备后即可模拟真实相机操作,支持中英文界面切换、参数调节(曝光/增益等)及图像采集功能。虚拟相机虽仅能显示预设图像,但完整保留了参数调节功能,适合开发者进行功能测试。

程序员,他们想的是什么?他们想的永远都是技术,他们崇尚的也永远都是技术。 3306

13-19年复旦大学计算机学院研究生复试机试题

(不保证代码完全正确,自己敲的可能存在不完善的地方,请各位大佬发现后指出,谢谢!) 2019上机题 1、 题目: 输入日期格式:YYYYMMDD,求与 20190205 相隔的天数。 输入: 20190208 输出: 3 解析: 运用Java的日期类来解决。 import java.util.*; import java.math.*; import java.text.*; public ...

qq_43557445的博客 2241

30天入门 SAP BTP 开发系列之四:SAP BTP 控制台里 Global Account 的常规操作介绍

笔者前一篇文章,介绍了 SAP BTP 中 Global Account 的概念。本文咱们一起来看看 SAP BTP 控制台里,给 Global Account 开放了哪些操作功能。

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 867

2015计算机硕士考研非统考的学校,2015考研计算机专业统考非统考学校统计

2015考研计算机统考非统考学校统计2015年计算机34所高校学校名称是否统考考试科目(非统考)复试科目(仅供参考)计算机系统结构:计算机系统结构(必考);编译原理、软件工程(二选一)清华大学统考 408计算机软件与理论:编译原理和数据库原理计算机应用技术:人工智能、信号处理原理、多媒体技术(三选二)软件工程:软件工程和编译原理 1. 上机考试+笔记+面试北京大学 统考4082. 成绩公式是:初...

weixin_28996657的博客 198

ssm框架搭建

这个是一个在idea上成功跑起来的ssm框架项目,保存在这里方便以后使用直接下载

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

2015天津大学计算机专业名单,2015年天津大学计算机技术085211专业目录考试科目真题及内部资料.pdf...

2015年天津大学计算机技术085211专业目录考试科目真题及内部资料育明教育天津分校 2015年天津地区15所高校考研辅导必备育明教育天津分校 2015年天津地区15所高校考研辅导必备育育明明教教育育天天津津分分校校年天天津津地地区区1155所所高高校校考考研研辅辅导导必必备备天津分校地址南京路新天地大厦2007天津分校地址南京路新天地大厦2007天天津津分分校校地地址址南南京京路路新新天天地地...

weixin_30762363的博客 241

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

计算机软件工程考研试题,cskaoyan

cskaoyan提供计算机和软件工程专业的各个学校 考研初试真题关键字: 计算机考研 软件考研 考研真题正在更新中,如果有真题想要分享,可以提交给cssekaoyan@qq.com,也可以在issue中提供链接。【致谢名单】 感谢真题来源和一些提供真题的同学信息。目前有的学校985大学安徽 江苏 浙江【浙江大学】【南京大学】【东南大学】【中国科学技术大学】河北 天津【南开大学】【天津大学】湖北 湖...

weixin_39853523的博客 758

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

计算机科学cw是什么意思,GitHub - cwgan/cskaoyan: 提供计算机考研和软件工程考研专业的各个学校 考研真题...

cskaoyan提供计算机和软件工程专业的各个学校 考研初试真题关键字: 计算机考研 软件考研 考研真题正在更新中,如果有真题想要分享,可以提交给cssekaoyan@qq.com,也可以在issue中提供链接。【致谢名单】 感谢真题来源和一些提供真题的同学信息。目前有的学校985大学安徽 江苏 浙江【浙江大学】【南京大学】【东南大学】【中国科学技术大学】河北 天津【南开大学】【天津大学】湖北 湖...

weixin_39630182的博客 445

zk计算机术语,GitHub - zk7032/cskaoyan: 提供计算机考研和软件工程考研专业的各个学校 考研真题...

cskaoyan提供计算机和软件工程专业的各个学校 考研初试真题关键字: 计算机考研 软件考研 考研真题正在更新中,如果有真题想要分享,可以提交给cssekaoyan@qq.com,也可以在issue中提供链接。【致谢名单】 感谢真题来源和一些提供真题的同学信息。目前有的学校985大学安徽 江苏 浙江【浙江大学】【南京大学】【东南大学】【中国科学技术大学】河北 天津【南开大学】【天津大学】湖北 湖...

weixin_29843603的博客 285

ih以下属于计算机软件的是,GitHub - wrelih/cskaoyan: 提供计算机考研和软件工程考研专业的各个学校 考研真题...

cskaoyan提供计算机和软件工程专业的各个学校 考研初试真题关键字: 计算机考研 软件考研 考研真题正在更新中,如果有真题想要分享,可以提交给cssekaoyan@qq.com,也可以在issue中提供链接。【致谢名单】 感谢真题来源和一些提供真题的同学信息。目前有的学校985大学安徽 江苏 浙江【浙江大学】【南京大学】【东南大学】【中国科学技术大学】河北 天津【南开大学】【天津大学】湖北 湖...

weixin_39647734的博客 250

浙大计算机系录取分数线2019,重磅数据!浙大2019、2020年三位一体各专业初审入围分数线曝光!...

2020年,浙江省高水平大学“三位一体”招生考试院校减少,北京大学、清华大学、中国科学技术大学均取消了在浙江省的“三位一体”综合评价招生计划。这样,浙江省高水平大学减少“三位一体”综合评价招生计划290人,取而代之的是“强基计划”和高考裸分录取。(1)北京大学在浙江省裸分招生41人,增加了31人。强基计划录取64人。(2)清华大学在浙江省裸分录取29人,增加了21人。强基计划录取70人。(3)中国...

weixin_29204205的博客 5392

复旦15年机考题

问题:给出a,b,c(3个整数),判断a,b能否通过±*/得到c,ab可以交换位置,可以输出YES,不行输出NO #include &amp;lt;stdio.h&amp;gt; int main() { int a, b, c; while(scanf(&quot;%d %d %d&quot;, &amp;amp;a, &amp;amp;b, &amp;amp;c) != EOF) { bool flag = false; if(

上帝是个娘们的博客 548

管理类联考--复试--英文面试--经典问题

对考研复试英语口语的考查,各个学校情况各不相同。有的学校制定了非常 详细的标准和流程,甚至规定了每个老师发问的方式和时间;有的只是面试老师的自由发挥,成绩也基本上由面试老师主观判定。不管面试是否严格控制,考生 对下面几个问题一定要认真准备: 一是:自我介绍,如自己来自什么地方,毕业学校,所学专业,业余喜好,家庭基本情况等信息。 二是:做好用英语讲解自己专业 的准备。 口语测试时老师有可能要求你就本专业展开话题,考查你用英语讲解陌生概念的能力。因此考生对此要有所准备,先用笔头组织这些问题的要点,然后再以 这些

stqer的博客 1万+

国家特重视的八大专业,且薪资还高,毕业即就业!

信息安全工作就是对计算机系统和数据处理系统的建立、技术和管理采取安全保护,使得系统的硬件、软件和数据不被偶然或故意地泄露、更改和破坏。

zz96405784848的博客 824

网络安全”领域很“吃香”的8个专业,高薪又缺人!

等。与信息安全相比,网络空间安全属于新兴网络安全专业,教育部于2015年在工学门类下增设网络空间安全一级学科并增设网络空间安全专业。

2401_84578953的博客 1053

国家超重视,高薪又缺人:这8个专业都很“吃香”!_系统科学最建议去的三个专业

信息安全工作就是对计算机系统和数据处理系统的建立、技术和管理采取安全保护,使得系统的硬件、软件和数据不被偶然或故意地泄露、更改和破坏。

logic1001的博客 804

“网络安全”领域很“吃香”的8个专业,高薪又缺人!

等。与信息安全相比,网络空间安全属于新兴网络安全专业,教育部于2015年在工学门类下增设网络空间安全一级学科并增设网络空间安全专业。

2401_85280106的博客 347
上一篇: 《Python编程:从入门到实践》学习笔记(一)
下一篇: 复旦大学计算机2020年机试题题解
威士忌燕麦拿铁
博客等级 码龄10年 5442粉丝 86原创
评论 5
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值