├── 2022 ├── C++ │ ├── 成绩表格.cpp │ ├── 浮点数进制转换.cpp │ ├── 渔夫打渔.cpp │ ├── 纯粹素数.cpp │ └── 螺旋矩阵.cpp ├── Python │ ├── 1、纯粹素数.py │ ├── 2、浮点数的进制转换.py │ ├── 3、成绩表格.py │ ├── 4、渔夫打渔.py │ └── 5、螺旋矩阵.py ├── 机考试题回忆2022.jpg └── 计算机学院2022年普通本科生转专业工作办法.pdf ├── 2023 ├── 2023年机考题解C++.pdf ├── 2023年转计算机学院机考试题(回忆版)--- Python.pdf ├── 2023计算机学院转入数据统计.xlsx ├── C++ │ ├── 1、整数求补码.cpp │ ├── 2、半素数.cpp │ ├── 3、黑洞数.cpp │ ├── 4、回文日期.cpp │ └── 5、填写矩阵.cpp ├── Python │ ├── 1、整数求补码.py │ ├── 2、H半素数.py │ ├── 3、黑洞数.py │ ├── 4、回文日期.py │ └── 5、矩阵.py ├── 计算机初筛统计.xlsx └── 计算机学院2023年普通本科生转专业工作办法.pdf ├── 2024 ├── 2024转专业报名.png ├── Python │ ├── 1.回文数字.py │ ├── 2.购买方案(组合).py │ ├── 2024转计算机学院机考试题 --Python.docx │ ├── 2024转计算机学院机考试题 --Python.pdf │ ├── 2024转计算机学院机考试题(回忆版)——Python.md │ ├── 3.冒泡排序逆序思想.py │ ├── 4.巧克力.py │ └── 5.等差素数数列.py ├── 统计图.js └── 计算机学院2024年普通本科生转专业实施方案.pdf ├── LICENSE ├── README.md ├── 各学院公共基础课程认证方案.pdf ├── 学分认证须知.md ├── 计算机学院2020版培养方案.pdf └── 软件工程2022版本科培养方案.pdf /2022/C++/成绩表格.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | struct stu 4 | { 5 | string num; 6 | int grade; 7 | string name; 8 | }a[100001]; 9 | bool cmp(stu a,stu b) 10 | { 11 | return a.grade>n; 17 | for(int i=1;i<=n;i++) 18 | { 19 | cin>>a[i].name>>a[i].num>>a[i].grade; 20 | wid[1]=max(wid[1],int(a[i].name.size())); 21 | wid[2]=max(wid[2],int(a[i].num.size())); 22 | } 23 | wid[3]=2; 24 | sort(a+1,a+n+1,cmp); 25 | for(int i=1;i<=n;i++) 26 | { 27 | cout< 2 | using namespace std; 3 | string dtob(double dec,int n) 4 | { 5 | string bin="0."; 6 | for(int i=1;i<=n;i++) 7 | { 8 | dec*=2; 9 | int d=int(dec); 10 | bin+=to_string(d); 11 | dec-=d; 12 | } 13 | return bin; 14 | } 15 | int main() 16 | { 17 | double decimal_number=0.625; 18 | string bin=dtob(decimal_number,8); 19 | cout< 2 | using namespace std; 3 | int a[101][101]; 4 | int vis[101][101]; 5 | int n; 6 | int main() 7 | { 8 | scanf("%d",&n); 9 | int x=1,y=1,pos1=0,pos2=1; 10 | memset(a,0,sizeof(a)); 11 | for(int i=1;i<=n*n;i++) 12 | { 13 | if(vis[x][y]==0) 14 | { 15 | a[x][y]=i; 16 | vis[x][y]=1; 17 | } 18 | if(pos2==1&&(y+pos2>n||vis[x+pos1][y+pos2]!=0)) 19 | { 20 | pos1=1; 21 | pos2=0; 22 | } 23 | if(pos1==1&&(x+pos1>n||vis[x+pos1][y+pos2]!=0)) 24 | { 25 | pos1=0; 26 | pos2=-1; 27 | } 28 | if(pos1==-1&&(x+pos1<=0||vis[x+pos1][y+pos2]!=0)) 29 | { 30 | pos1=0; 31 | pos2=1; 32 | } 33 | if(pos2==-1&&(y+pos2<=0||vis[x+pos1][y+pos2]!=0)) 34 | { 35 | pos1=-1; 36 | pos2=0; 37 | } 38 | x+=pos1; 39 | y+=pos2; 40 | } 41 | for(int i=1;i<=n;i++) 42 | { 43 | for(int j=1;j<=n;j++) 44 | { 45 | printf("%02d ",a[i][j]); 46 | } 47 | printf("\n"); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /2022/Python/1、纯粹素数.py: -------------------------------------------------------------------------------- 1 | # 一个素数,去掉最高位,剩下的数仍为素数,再去掉剩下的数的最高位,余下的数还是素数。 2 | def IsPrime(num: int) -> bool: 3 | """Check if num is prime""" 4 | if num <= 1: 5 | return False 6 | flag = True 7 | for i in range(2, int(num**0.5) + 1): 8 | if num % i == 0: 9 | flag = False 10 | break 11 | return flag 12 | 13 | 14 | def IsPurePrime(num: int) -> bool: 15 | """Check if num is pure prime""" 16 | flag = True 17 | num = list(str(num)) 18 | for i in range(len(num)): 19 | num_temp = num[i:] 20 | if not IsPrime(int("".join(num_temp))): 21 | flag = False 22 | break 23 | return flag 24 | 25 | 26 | if __name__ == "__main__": 27 | num = int(input()) 28 | ans_ispure = ["非纯粹素数", "为纯粹素数"][int(IsPurePrime(num))] 29 | if IsPrime(num): 30 | print(f"{num}是素数,且{ans_ispure}") 31 | else: 32 | print(f"{num}不是素数,且{ans_ispure}") 33 | -------------------------------------------------------------------------------- /2022/Python/2、浮点数的进制转换.py: -------------------------------------------------------------------------------- 1 | """ 2 | 十进制小数转换为二进制小数的方法: 3 | 将小数部分不断乘2,取整数部分作为二进制的一位。 4 | 将小数部分保留的小数部分再次乘2,取整数部分作为下一位二进制。 5 | 重复上述步骤,直到小数部分为0或者达到一定的精度。 6 | """ 7 | 8 | 9 | def decimal_to_binary(decimal, precision=8): 10 | binary = "0." 11 | 12 | for _ in range(precision): 13 | decimal *= 2 14 | digit = int(decimal) 15 | binary += str(digit) 16 | decimal -= digit 17 | 18 | return binary 19 | 20 | 21 | decimal_number = 0.625 22 | binary_representation = decimal_to_binary(decimal_number) 23 | print(binary_representation) 24 | -------------------------------------------------------------------------------- /2022/Python/3、成绩表格.py: -------------------------------------------------------------------------------- 1 | """ 2 | 测试数据: 3 | 10 4 | John 20230002 88 5 | Emily 20230003 92 6 | Michael 20230004 78 7 | Sophia 20230005 85 8 | Jacob 20230006 94 9 | Olivia 20230007 76 10 | William 20230008 89 11 | Ava 20230009 81 12 | Ethan 20230010 70 13 | Mia 20230011 96 14 | """ 15 | 16 | n = int(input()) 17 | data = [["Name", "ID", "Score"]] 18 | student_info = [input().split(" ") for _ in range(n)] 19 | 20 | # 按照成绩排序 21 | student_info = sorted(student_info, key=lambda x: x[2], reverse=True) 22 | 23 | # 计算每列的最大宽度 24 | data += student_info 25 | max_widths = [len(i) for i in data[0]] 26 | for data_single in data[1:]: 27 | # max_widths = [len(data_single[i]) if len(data_single[i]) > max_widths[i] else max_widths[i] for i in range(len(data[0]))] 28 | for i in range(len(data[0])): 29 | if len(data_single[i]) > max_widths[i]: 30 | max_widths[i] = len(data_single[i]) 31 | 32 | 33 | # 打印表格 34 | separation = ( 35 | "|" + "|".join("-" * (max_widths[i] + 2) for i in range(len(data[0]))) + "|" 36 | ) 37 | print(separation) 38 | for data_single in data: 39 | print( 40 | "| " 41 | + " | ".join(f"{field:<{max_widths[i]}}" for i, field in enumerate(data_single)) 42 | + " |" 43 | ) 44 | print(separation) 45 | -------------------------------------------------------------------------------- /2022/Python/4、渔夫打渔.py: -------------------------------------------------------------------------------- 1 | import datetime 2 | 3 | print("日期输入格式2022-01-01") 4 | start = input("请输入起始时间:") 5 | start_datetime = datetime.datetime.strptime(start, "%Y-%m-%d") 6 | end = input("请输入截至时间:") 7 | end_datetime = datetime.datetime.strptime(end, "%Y-%m-%d") 8 | 9 | delta_datetime = end_datetime - start_datetime 10 | days = delta_datetime.days 11 | print(f"经过{days}天") 12 | 13 | workdays = (days // 5) * 3 14 | if days % 5 < 4: 15 | workdays += days % 5 16 | else: 17 | workdays += 3 18 | print(f"打渔{workdays}天,摸鱼{days-workdays}天") 19 | -------------------------------------------------------------------------------- /2022/Python/5、螺旋矩阵.py: -------------------------------------------------------------------------------- 1 | # https://leetcode.cn/problems/spiral-matrix-ii/ 2 | 3 | 4 | def generateMatrix(n: int): 5 | # 初始化矩阵 6 | matrix = [[0] * n for _ in range(n)] 7 | # 定义边界变量 8 | left, right, top, bottom = 0, n - 1, 0, n - 1 9 | # 定义要填充的元素值 10 | num = 1 11 | while left <= right and top <= bottom: 12 | # 填充上边界 13 | for i in range(left, right + 1): 14 | matrix[top][i] = num 15 | num += 1 16 | top += 1 17 | # 填充右边界 18 | for i in range(top, bottom + 1): 19 | matrix[i][right] = num 20 | num += 1 21 | right -= 1 22 | # 填充下边界 23 | for i in range(right, left - 1, -1): 24 | matrix[bottom][i] = num 25 | num += 1 26 | bottom -= 1 27 | # 填充左边界 28 | for i in range(bottom, top - 1, -1): 29 | matrix[i][left] = num 30 | num += 1 31 | left += 1 32 | return matrix 33 | 34 | 35 | matrix = generateMatrix(4) 36 | for row in matrix: 37 | row_str = " ".join(f"{num:>02}" for num in row) 38 | print(row_str) 39 | -------------------------------------------------------------------------------- /2022/机考试题回忆2022.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuzWeAre/CUMT_Program-Test/9369675849cdbfb30a75edf460a60e418bc3bcc8/2022/机考试题回忆2022.jpg -------------------------------------------------------------------------------- /2022/计算机学院2022年普通本科生转专业工作办法.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuzWeAre/CUMT_Program-Test/9369675849cdbfb30a75edf460a60e418bc3bcc8/2022/计算机学院2022年普通本科生转专业工作办法.pdf -------------------------------------------------------------------------------- /2023/2023年机考题解C++.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuzWeAre/CUMT_Program-Test/9369675849cdbfb30a75edf460a60e418bc3bcc8/2023/2023年机考题解C++.pdf -------------------------------------------------------------------------------- /2023/2023年转计算机学院机考试题(回忆版)--- Python.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuzWeAre/CUMT_Program-Test/9369675849cdbfb30a75edf460a60e418bc3bcc8/2023/2023年转计算机学院机考试题(回忆版)--- Python.pdf -------------------------------------------------------------------------------- /2023/2023计算机学院转入数据统计.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuzWeAre/CUMT_Program-Test/9369675849cdbfb30a75edf460a60e418bc3bcc8/2023/2023计算机学院转入数据统计.xlsx -------------------------------------------------------------------------------- /2023/C++/1、整数求补码.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | int main() 4 | { 5 | int n; 6 | cin>>n; 7 | cout<(n); 8 | return 0; 9 | } 10 | -------------------------------------------------------------------------------- /2023/C++/2、半素数.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | vectora,ans; 4 | bool is_Hprime(int n) 5 | { 6 | for(int i=0;i 2 | using namespace std; 3 | int a[5]; 4 | bool cmp(int x,int y) 5 | { 6 | return x>y; 7 | } 8 | int main() 9 | { 10 | int n; 11 | cin>>n; 12 | for(int i=1;i<=4;i++) 13 | { 14 | a[i]=n%10; 15 | n/=10; 16 | } 17 | int ans=0,cnt=0; 18 | while(ans!=6174) 19 | { 20 | cnt++; 21 | int minn=0,maxn=0; 22 | sort(a+1,a+5); 23 | for(int i=1;i<=4;i++) 24 | { 25 | minn*=10; 26 | minn+=a[i]; 27 | } 28 | sort(a+1,a+5,cmp); 29 | for(int i=1;i<=4;i++) 30 | { 31 | maxn*=10; 32 | maxn+=a[i]; 33 | } 34 | ans=maxn-minn; 35 | cout< 2 | using namespace std; 3 | bool is_valid(int yyyy,int mm,int dd) 4 | { 5 | if(1000>daytime; 21 | year=daytime/10000; 22 | month=(daytime-year*10000)/100; 23 | day=daytime%100; 24 | while(year<=9999) 25 | { 26 | year+=1; 27 | month=year%10*10+year/10%10; 28 | day=year/100%10*10+year/1000; 29 | daytime=year*10000+year%10*1000+year/10%10*100+year/100%10*10+year/1000; 30 | if(is_valid(year,month,day)) 31 | { 32 | printf("%d",daytime); 33 | break; 34 | } 35 | } 36 | return 0; 37 | } 38 | -------------------------------------------------------------------------------- /2023/C++/5、填写矩阵.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | int a[1001][1001]; 4 | int vis[1001][1001]; 5 | int main() 6 | { 7 | int n,x=1,y=1,pos1=0,pos2=1,cnt; 8 | cin>>n; 9 | n-=1; 10 | cnt=1; 11 | for(int i=1;i<=n*n;i++) 12 | { 13 | a[x][y]=cnt; 14 | vis[x][y]=1; 15 | if(pos2==1&&(y==n||vis[x+pos1][y+pos2])) 16 | { 17 | pos2=0; 18 | pos1=1; 19 | } 20 | else if(pos1==1&&(x==n||vis[x+pos1][y+pos2])) 21 | { 22 | pos2=-1; 23 | pos1=0; 24 | } 25 | else if(pos2==-1&&(y==1||vis[x+pos1][y+pos2])) 26 | { 27 | pos2=0; 28 | pos1=-1; 29 | } 30 | else if(pos1==-1&&(x==2||vis[x+pos1][y+pos2])) 31 | { 32 | pos1=0; 33 | pos2=1; 34 | cnt+=1; 35 | } 36 | x+=pos1; 37 | y+=pos2; 38 | } 39 | for(int i=1;i<=n;i++) 40 | { 41 | for(int j=1;j<=n;j++) 42 | { 43 | printf("%d ",a[i][j]); 44 | } 45 | printf("\n"); 46 | } 47 | return 0; 48 | } 49 | -------------------------------------------------------------------------------- /2023/Python/1、整数求补码.py: -------------------------------------------------------------------------------- 1 | '''给定一个整数,求他的16位补码。 2 | 正整数的补码和该数值的原码(即该数值的二进制形式)相同,例1的原码和补码都是0000000000000001 3 | 负数的补码求法是符号位不变,其他位取反,然后结果加1。例-1的原码是1000000000000001,补码是1111111111111111。''' 4 | 5 | n = int(input()) 6 | if n >= 0: 7 | n = bin(n)[2:].zfill(16) 8 | print(n) 9 | else: 10 | n = abs(n) 11 | n =list(bin(n)[2:].zfill(15)) 12 | for i in range(len(n)): 13 | if n[i]=='0': 14 | n[i]='1' 15 | else: 16 | n[i]='0' 17 | ans = int('1'+''.join(n),2)+1 18 | print(bin(ans)[2:]) -------------------------------------------------------------------------------- /2023/Python/2、H半素数.py: -------------------------------------------------------------------------------- 1 | '''H数指满足4n+1(n∈N,n>=0)的数,例如1、5、9、13…… 2 | H素数是在H数集中仅能被1和本身整除的数,例如5、9、13…… 3 | H半素数是可以分解为两个H素数相乘的数,例如25、45、81、85…… 4 | 求150以内的H半素数''' 5 | 6 | import itertools 7 | 8 | def ishprime(n:int) -> bool: #:int ->bool可以不写,说明性的代码 9 | '''判断是否为h素数''' 10 | if n <=1: 11 | return False 12 | 13 | #依赖于全局变量lst_h,需要在lst_h给出后再运行函数。实际上也可以改写函数名为ishprime(n:int,lst_h:list),把lst_h作为参数传递进来 14 | for i in lst_h[1:]:#把1去了 15 | if n%i == 0 and n!=i: 16 | return False 17 | return True 18 | 19 | lst_h = [4*n+1 for n in range(150) if 4*n+1<150] #range(150)是个随便的值,实际上只要4*n+1能取到最接近150的值范围任意 20 | lst_hprime = [x for x in lst_h if ishprime(x)] 21 | hprime_combinations = itertools.combinations(lst_hprime,2)#翘课了,这个库蛮好用的建议学。递归造轮子太折磨TAT 22 | #print(list(hprime_combinations)) #去掉注释执行可观察返回的样子 23 | #print(hprime_combinations) #和上面比较一下有什么不同 24 | lst_halfprime = [[k[0]*k[1],k] for k in hprime_combinations if k[0]*k[1]<150] 25 | lst_halfprime += [[k**2,(k,k)] for k in lst_hprime if k**2<150]#加上k**2排序方便 26 | lst_halfprime.sort() 27 | for i in lst_halfprime: 28 | print(f'{i[0]}={i[1][0]}*{i[1][1]}') -------------------------------------------------------------------------------- /2023/Python/3、黑洞数.py: -------------------------------------------------------------------------------- 1 | '''读取一个四位不全相同的数字,这四个数字排列组合出最大的数和最小的数做差,之后重复这个步骤,最多7次数字最终便会变成 6174。 2 | 现在要求你编写程序,从键盘读入一个四位不全相同的数字,求需要像上面那样处理多少次掉入黑洞 3 | 例如1234这个数字只需要3次就会掉入黑洞 4 | ''' 5 | 6 | N =list(input()) 7 | for i in range(1,8): 8 | #最多7次掉入黑洞 9 | N_min = int(''.join(sorted(N))) 10 | N_max = int(''.join(sorted(N,reverse=True))) 11 | N = N_max-N_min 12 | if N == 6174: 13 | print(i) 14 | break 15 | N = list(str(N)) -------------------------------------------------------------------------------- /2023/Python/4、回文日期.py: -------------------------------------------------------------------------------- 1 | '''回文日期指的是一个日期表示为yyyymmdd的形式后,yyyymmdd是个回文数。例如20200202是一个回文日期,它的下一个回文日期是20211202。 2 | 给定一个yyyymmdd的日期,求下一个回文日期是在哪一天。''' 3 | 4 | #ChatGpt提供的答案 5 | #鼠鼠我啊,机考没做出来,疯狂造轮子,考得是一点不会(T▽T) 6 | from datetime import datetime, timedelta 7 | 8 | def is_palindrome(num): 9 | """判断给定的整数是否为回文数""" 10 | str_num = str(num) 11 | return str_num == str_num[::-1] 12 | 13 | def next_palindrome_date(date): 14 | """计算给定日期的下一个回文日期""" 15 | curr_date = datetime.strptime(date, "%Y%m%d") 16 | # 逐个增加日期,直到找到回文日期为止 17 | while True: 18 | curr_date += timedelta(days=1) 19 | next_date_str = datetime.strftime(curr_date, "%Y%m%d") 20 | if is_palindrome(int(next_date_str)): 21 | return next_date_str 22 | 23 | date_str = input()#"输入一个日期(格式为YYYYMMDD) 24 | datetime.strptime(date_str, "%Y%m%d") 25 | next_palindrome = next_palindrome_date(date_str) 26 | print(next_palindrome) 27 | 28 | 29 | #不用库的版本 30 | def is_palindrome(num): 31 | """判断给定的整数是否为回文数""" 32 | str_num = str(num) 33 | return str_num == str_num[::-1] 34 | 35 | def is_valid_date(date): 36 | """判断给定的日期是否合法""" 37 | year, month, day = int(date[:4]), int(date[4:6]), int(date[6:]) 38 | if year < 1000 or year > 9999 or month < 1 or month > 12: 39 | return False 40 | if month in {1, 3, 5, 7, 8, 10, 12}: 41 | return day >= 1 and day <= 31 42 | elif month in {4, 6, 9, 11}: 43 | return day >= 1 and day <= 30 44 | elif year % 4 == 0 and (year % 100 != 0 or year % 400 == 0): 45 | return day >= 1 and day <= 29 46 | else: 47 | return day >= 1 and day <= 28 48 | 49 | def next_palindrome_date(date): 50 | """计算给定日期的下一个回文日期""" 51 | year, month, day = int(date[:4]), int(date[4:6]), int(date[6:]) 52 | while True: 53 | # 逐个增加日期 54 | day += 1 55 | if day > 31 or (day > 30 and month in {4, 6, 9, 11}) or (day > 29 and month == 2) or (day > 28 and month == 2 and (year % 4 != 0 or (year % 100 == 0 and year % 400 != 0))): 56 | day = 1 57 | month += 1 58 | if month > 12: 59 | month = 1 60 | year += 1 61 | # 构造下一个日期并判断是否为回文日期 62 | next_date = f"{year:04d}{month:02d}{day:02d}" 63 | if is_valid_date(next_date) and is_palindrome(next_date): 64 | return next_date 65 | -------------------------------------------------------------------------------- /2023/Python/5、矩阵.py: -------------------------------------------------------------------------------- 1 | #比22年机考题简单,类似题目可看leetcode.cn 54,59题 关键词:螺旋矩阵 2 | '''键盘读入一个正偶数n,生成一个(n-1)*(n-1)的矩阵,从外到里递增,即最里面的数是n/2。 3 | 例:输入10 4 | 1 1 1 1 1 1 1 1 1 5 | 1 2 2 2 2 2 2 2 1 6 | 1 2 3 3 3 3 3 2 1 7 | 1 2 3 4 4 4 3 2 1 8 | 1 2 3 4 5 4 3 2 1 9 | 1 2 3 4 4 4 3 2 1 10 | 1 2 3 3 3 3 3 2 1 11 | 1 2 2 2 2 2 2 2 1 12 | 1 1 1 1 1 1 1 1 1 13 | ''' 14 | 15 | n = int(input()) 16 | matrix = [[0 for _ in range(n-1)] for _ in range(n-1)] #_代表不需用到迭代数具体值 17 | for i in range(n-1): 18 | for up in range(i,n-1-i): 19 | matrix[i][up]=i+1 20 | for down in range(i,n-1-i): 21 | matrix[-i-1][down]=i+1 22 | for left in range(i,n-1-i): 23 | matrix[left][i]=i+1 24 | for right in range(i,n-1-i): 25 | matrix[right][-i-1]=i+1 26 | 27 | for x in matrix: 28 | x = map(str,x) 29 | print(' '.join(x)) 30 | 31 | #可以把上面的循环注释掉,下面的代码去掉注释,以便于观察每次操作后矩阵的变化 32 | # for x in matrix: 33 | # x = map(str,x) 34 | # print(' '.join(x)) 35 | 36 | # print() -------------------------------------------------------------------------------- /2023/计算机初筛统计.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuzWeAre/CUMT_Program-Test/9369675849cdbfb30a75edf460a60e418bc3bcc8/2023/计算机初筛统计.xlsx -------------------------------------------------------------------------------- /2023/计算机学院2023年普通本科生转专业工作办法.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuzWeAre/CUMT_Program-Test/9369675849cdbfb30a75edf460a60e418bc3bcc8/2023/计算机学院2023年普通本科生转专业工作办法.pdf -------------------------------------------------------------------------------- /2024/2024转专业报名.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuzWeAre/CUMT_Program-Test/9369675849cdbfb30a75edf460a60e418bc3bcc8/2024/2024转专业报名.png -------------------------------------------------------------------------------- /2024/Python/1.回文数字.py: -------------------------------------------------------------------------------- 1 | """ 2 | 求10~1000内满足条件的回文整数。 3 | 4 | 要求如下 5 | 6 | (1)这个整数本身是回文数,假设该整数为i,则i的平方,i的立方也均为回文数。 7 | 8 | (2)逐行输出这些符合条件的数字,并把其对应的平方,立方在同一行输出。 9 | 10 | 输出结果展示: 11 | 12 | 13 | 11 121 1331 14 | 101 10201 1030301 15 | 111 12321 1367631 16 | """ 17 | 18 | 19 | def is_palindrome(num_str): 20 | """判断一个字符串是否是回文数,非常常见题型,随便写一个能过的就好""" 21 | return num_str == num_str[::-1] 22 | 23 | 24 | for i in range(10, 1000): 25 | if all(is_palindrome(str(x)) for x in (i, i ** 2, i ** 3)): 26 | print(f"{i} {i ** 2} {i ** 3}") 27 | -------------------------------------------------------------------------------- /2024/Python/2.购买方案(组合).py: -------------------------------------------------------------------------------- 1 | """ 2 | 买礼物,输入礼物的价格(升序空格隔开),挑选其中三件,输出有多少种购买方式(组合) 3 | 4 | 例如: 5 | 输入 6 | 1 2 3 4 5 7 | 8 | 输出 9 | 10 10 | """ 11 | 12 | def calculate_combinations(n): 13 | """ 14 | 计算组合数 C(n, 3) 15 | """ 16 | if n < 3: 17 | return 0 18 | if n == 3: 19 | return 1 20 | 21 | result = 1 22 | for i in range(1, 4): 23 | result *= (n - i + 1) 24 | result //= i 25 | 26 | return result 27 | 28 | gift_prices = list(map(int, input().split())) 29 | num = len(gift_prices) 30 | print(calculate_combinations(num)) -------------------------------------------------------------------------------- /2024/Python/2024转计算机学院机考试题 --Python.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuzWeAre/CUMT_Program-Test/9369675849cdbfb30a75edf460a60e418bc3bcc8/2024/Python/2024转计算机学院机考试题 --Python.docx -------------------------------------------------------------------------------- /2024/Python/2024转计算机学院机考试题 --Python.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuzWeAre/CUMT_Program-Test/9369675849cdbfb30a75edf460a60e418bc3bcc8/2024/Python/2024转计算机学院机考试题 --Python.pdf -------------------------------------------------------------------------------- /2024/Python/2024转计算机学院机考试题(回忆版)——Python.md: -------------------------------------------------------------------------------- 1 | # 2024转计算机学院机考试题(回忆版)——Python 2 | 3 | author: [iamSper](https://github.com/iamSper) 4 | 5 | --- 6 | 7 | 2024年转专业机考,我是生死未卜。今年与以往两年有所不同,题目类型变了,是蓝桥杯里的题目了。 8 | 9 | ------ 10 | 11 | 暑期增加:第五题,等差素数数列原先答案有问题,已经做出更改,感谢24级的刘家蔚同学,指正了我原先的代码错误,并给出了他的使用递归方法而写出的题解。也非常感谢创建项目的哥,以及诸多计算机转专业群内的大佬们,热心答疑,为我指明方向,虽然没有成功,但是我也收获颇多,非常感动,谢谢各位! 12 | 13 | ## 1.回文数字 14 | 15 | 求10~1000内满足条件的回文整数。 16 | 17 | 要求如下 18 | 19 | (1)这个整数本身是回文数,假设该整数为i,则i的平方,i的立方也均为回文数。 20 | 21 | (2)逐行输出这些符合条件的数字,并把其对应的平方,立方在同一行输出。 22 | 23 | 输出结果展示: 24 | 25 | ``` 26 | 11 121 1331 27 | 101 10201 1030301 28 | 111 12321 1367631 29 | ``` 30 | 31 | ### 参考题解 32 | 33 | ```python 34 | def is_palindrome(num_str): 35 | return num_str == num_str[::-1] 36 | for i in range(10, 1000): 37 | if all(is_palindrome(str(x)) for x in (i, i**2, i**3)): 38 | print(f"{i}, {i**2}, {i**3}") 39 | ``` 40 | 41 | ## 2.购买方案(组合) 42 | 43 | 买礼物,输入礼物的价格(升序空格隔开),挑选其中三件,输出有多少种购买方式(组合) 44 | 45 | 例如: 46 | 47 | 输入 48 | 49 | ```in 50 | 1 2 3 4 5 51 | ``` 52 | 53 | 输出 54 | 55 | ```out 56 | 10 57 | ``` 58 | 59 | ### 参考题解 60 | 61 | ```python 62 | def combinations_count(n): 63 | #计算组合数C(n,3) 64 | if n < 3: 65 | return 0 66 | if n == 3: 67 | return 1 68 | result = 1 69 | for i in range(1, 4): 70 | result *= (n - i + 1) 71 | result //= i 72 | return result 73 | gift_prices = list(map(int,input().split())) 74 | num = len(gift_prices) 75 | print(combinations_count(num)) 76 | ``` 77 | 78 | 79 | 80 | ## 3.冒泡排序找字符 81 | 82 | 小蓝最近学习了一些排序算法,其中冒泡排序让他印象深刻。在冒泡排序中,每次只能交换相邻的两个元素。小蓝发现,如果对一个字符串中的字符排序,只允许交换相邻的两个字符,则在所有可能的排序方案中,冒泡排序的总交换次数是最少的。 83 | 84 | 例如,对于字符串 lan 排序,只需要 1次交换。对于字符串 qiao 排序,总共需要 4 次交换。小蓝的幸运数字是 V,他想找到一个只包含小写英文字母的字符串,对这个串中的字符进行冒泡排序,正好需要 V 次交换。 85 | 86 | 请帮助小蓝找一个这样的字符串。如果可能找到多个,请告诉小蓝最短的那个。如果最短的仍然有多个,请告诉小蓝字典序最小的那个。请注意字符串中可以包含相同的字符。 87 | 88 | 输入格式 89 | 90 | 输入一行包含一个整数"V" ,为小蓝的幸运数字。 91 | 92 | 输出格式 93 | 94 | 输出一个字符串,为所求的答案。 95 | 96 | 样例输入 97 | 98 | ``` 99 | 4 100 | ``` 101 | 102 | 样例输出 103 | 104 | ``` 105 | bbaa 106 | ``` 107 | 108 | 样例输入 109 | 110 | ``` 111 | 100 112 | ``` 113 | 114 | 样例输出 115 | 116 | ``` 117 | Jihgfeeddccbbaa 118 | ``` 119 | 120 | ### 题解 121 | 122 | ```python 123 | def length(v): 124 | i = 1 125 | while i * (i - 1) // 2 < v: 126 | i += 1 127 | return i 128 | def create_string(length): 129 | goal_string = "" 130 | alpha = 'a' 131 | for _ in range(length): 132 | goal_string += alpha 133 | alpha = chr((ord(alpha) - ord('a') + 1) % 26 + ord('a')) 134 | return goal_string 135 | def add(add_number, demo_string, length): 136 | list_demo_string = list(demo_string) 137 | alpha = 'a' 138 | index = 0 139 | while add_number > 0: 140 | # 由于index从0开始,所以插入位置应该对应demo_string的索引+1 141 | list_demo_string.insert(index + 1, alpha) 142 | index += 2 143 | alpha = chr((ord(alpha) - ord('a') + 1) % 26 + ord('a')) 144 | add_number -= 1 145 | return ''.join(sorted(list_demo_string,reverse=True)) 146 | V = int(input()) 147 | len_needed = length(V) 148 | add_chars = len_needed * (len_needed - 1) // 2 - V 149 | demo_string = create_string(len_needed - add_chars) 150 | final_string = add(add_chars, demo_string, len_needed) 151 | print(final_string) 152 | ``` 153 | 154 | 155 | 156 | 鼠鼠真的是太菜了!当我看到这道题目时候,知道冒泡排序,但就是没有任何思路了5555....考完试重新做,加上参考大佬的做法,发现好像...主要还是自己题目理解有问题。没搞清楚就一头雾水的扎进去了,当然...这也与备考题目类型差异过大有关(不是对自己菜的辩白),我想,机考作为一次应试考试,准备上来说...的确不是可以只看某一方面的内容的,盲求抱佛脚。 157 | 158 | 这道题,感觉题目的确写的比较抽象,字典序最小,那里是关键所在。比起正常的来说困难的地方我觉得在补这个过程中,容易出问题。 159 | 160 | ## 4.分巧克力 161 | 162 | 儿童节那天有K位小朋友到小明家做客。小明拿出了珍藏的巧克力招待小朋友们。小明一共有N块巧克力,其中第i块是Hi x Wi的方格组成的长方形。为了公平起见,小明需要从这 N 块巧克力中切出K块巧克力分给小朋友们。切出的巧克力需要满足: 163 | 164 | (1)形状是正方形,边长是整数(2)大小相同 165 | 166 | 例如,一块6x5的巧克力可以切出6块2x2的巧克力,或者2块3x3的巧克力。 167 | 168 | 当然小朋友们都希望得到的巧克力尽可能大,你能帮小Hi计算出,最大的边长是多少么? 169 | 170 | 输入 171 | 172 | 第一行包含两个整数N和K。(1 <= N, K <= 100000) 173 | 174 | 以下N行每行包含两个整数Hi和Wi。(1 <= Hi, Wi <= 100000) 175 | 176 | 输入保证每位小朋友至少能获得一块1x1的巧克力。 177 | 178 | 输出 179 | 180 | 输出切出的正方形巧克力最大可能的边长。 181 | 182 | 运行示例 183 | 184 | 输入 185 | 186 | ``` 187 | 2 10 188 | 6 5 189 | 5 6 190 | ``` 191 | 192 | 输出 193 | 194 | ``` 195 | 2 196 | ``` 197 | 198 | 199 | 200 | ### 题解 201 | 202 | ```python 203 | def cho_minx(cho0, n, k): 204 | x_min = 0 205 | for i in range(n): 206 | if min(cho0[i]) > x_min: 207 | x_min = min(cho0[i]) 208 | x_min = x_min // k 209 | return x_min 210 | def cho_att(x_min, n, k): 211 | count = k + 1 212 | x = x_min - 1 213 | while count >= k: 214 | x += 1 215 | if x == 0: 216 | x = 1 217 | count = 0 218 | for i in range(n): 219 | a = cho0[i][0] // x 220 | b = cho0[i][1] // x 221 | count += a * b 222 | return x - 1 223 | n, k = map(int, input().split()) 224 | cho0 = [] 225 | for i in range(n): 226 | cho0.append(list(map(int, input().split()))) 227 | x_min = cho_minx(cho0, n, k) 228 | x = cho_att(x_min, n, k) 229 | print(x) 230 | ``` 231 | 232 | ## 5.等差素数数列 233 | 234 | 2,3,5,7,11,13,....是素数序列。 235 | 236 | 类似我1们有:7,37,67,97,127,157这样完全由素数组成的等差数列,叫等差素数数列,而这个等差素数数列的公差为30,长度为 6。 237 | 238 | 2004 年,格林与华人陶哲轩合作证明了:存在任意长度的素数等差数列。 这是数论领域一项惊人的成果! 239 | 240 | 有这一理论为基础,请你借助手中的计算机,满怀信心地搜索: 241 | 242 | 长度为10的等差素数列,其公差最小值是多少? 243 | 244 | 245 | 246 | 机考时候我极其昏头......想不出来解决办法,只知道暴力算(鼠鼠脑子太笨了)还是只写了一半(事后发现没保存...太抽象了),这绝对是我的大错特错qaq。 247 | 248 | **在暑期时,24级的刘家蔚同学,指正了我原先的代码错误,并给出了他的使用递归方法而写出的题解:** 249 | 250 | ### 题解(刘同学提供) 251 | 252 | ```python 253 | # 由计算机转专业群,24数学刘家蔚同学提供 254 | 255 | def is_prime(n): #素数筛 256 | for i in range(2, int(n**0.5)+1): 257 | if n % i == 0: 258 | return False 259 | return True 260 | 261 | def loop_check(num,step,time): #本函数用于检测是否符合等差素数数列条件 262 | if time == 0: #base case 263 | return True 264 | if is_prime(num+step): #递归 265 | return loop_check(num+step,step,time-1) 266 | return False 267 | 268 | stop = 0 #状态值,0为继续,1为停止 269 | for n in range(2,10000): 270 | if not is_prime(n): 271 | continue 272 | elif stop == 0: 273 | for step in range(2,10000): #枚举等差,逐个尝试 274 | if loop_check(n,step,8): 275 | print(step) 276 | stop = 1 #设置为停止 277 | break 278 | elif stop == 1: 279 | break 280 | ``` 281 | 282 | 非常感谢刘同学的提醒,也让我能回头审视当时的一直未被完全解决的问题,但是这个暑期很忙碌,后续如果有时间,还会再好好修改的,感谢这个项目的作者,能为我们这些想要转入计算机的同学增添力量。 283 | 284 | ## 个人感想 285 | 286 | ​ 本人码力较差,写的内容也比较平庸,此回忆版题目是在出成绩的前一天凌晨所写,花了挺长时间的。只是在转机考上,我最后差了一点分数(这纯属是我个人原因了,计算机学院的老师是会捞人的)。这里大家不要学我,在应试心态和精神状态上出了大问题,我没有把握好这个机会。所以,我也希望想继续转入计算机的同学,一定要做足机试的心理建设和应试准备,加油,相信你一定可以的! 287 | 288 | ​ 想起翁恺老师的话:学计算机,一定要有一个非常强大的心理状态,计算机的所有东西都是人做出来的,别人想得出来,我也一定想得出来。在计算机里头没有任何黑魔法。所有东西只不过是我现在不知道而已。总有一天,我会把所有的细节,所有的内部的东西全都搞明白的。 289 | 290 | ​ 我觉得,不管你是有没有转入成功,只要你是热爱计算机科学的,只要你愿意在这条路上坚持下去,开拓眼界,与时俱进,你一定能够在计算机领域,创造属于你的价值的!!! -------------------------------------------------------------------------------- /2024/Python/3.冒泡排序逆序思想.py: -------------------------------------------------------------------------------- 1 | """ 2 | 小蓝最近学习了一些排序算法,其中冒泡排序让他印象深刻。在冒泡排序中,每次只能交换相邻的两个元素。小蓝发现,如果对一个字符串中的字符排序,只允许交换相邻的两个字符,则在所有可能的排序方案中,冒泡排序的总交换次数是最少的。 3 | 例如,对于字符串 lan 排序,只需要 1次交换。对于字符串 qiao 排序,总共需要 4 次交换。小蓝的幸运数字是 V,他想找到一个只包含小写英文字母的字符串,对这个串中的字符进行冒泡排序,正好需要 V 次交换。 4 | 5 | 请帮助小蓝找一个这样的字符串。如果可能找到多个,请告诉小蓝最短的那个。如果最短的仍然有多个,请告诉小蓝字典序最小的那个。请注意字符串中可以包含相同的字符。 6 | 7 | 输入格式 8 | 输入一行包含一个整数"V" ,为小蓝的幸运数字。 9 | 输出格式 10 | 输出一个字符串,为所求的答案。 11 | 12 | 样例输入 13 | 4 14 | 15 | 样例输出 16 | bbaa 17 | 18 | 样例输入 19 | 100 20 | 21 | 样例输出 22 | Jihgfeeddccbbaa 23 | """ 24 | 25 | 26 | def length(v): 27 | """ 28 | 根据V计算所需字符串的最小长度 29 | """ 30 | i = 1 31 | while i * (i - 1) // 2 < v: 32 | i += 1 33 | return i 34 | 35 | 36 | def create_string(length): 37 | """ 38 | 创建一个给定长度的字符串,按字母序排列(重复使用a-z) 39 | """ 40 | base_ord = ord('a') 41 | return ''.join(chr(base_ord + i % 26) for i in range(length)) 42 | 43 | 44 | def add_chars(add_number, base_string): 45 | """ 46 | 在基本字符串中插入字符,使得逆序对数符合要求 47 | """ 48 | # 将基本字符串转换为列表以进行插入操作 49 | result = list(base_string) 50 | alpha_ord = ord('a') 51 | index = 0 52 | 53 | # 插入字符 54 | for _ in range(add_number): 55 | result.insert(index + 1, chr(alpha_ord)) 56 | index += 2 57 | alpha_ord = (alpha_ord - ord('a') + 1) % 26 + ord('a') 58 | 59 | # 返回逆序排序的字符串 60 | return ''.join(sorted(result, reverse=True)) 61 | 62 | 63 | if __name__ == "__main__": 64 | V = int(input("请输入幸运数字:").strip()) 65 | 66 | # 计算最小长度及多余字符的数量 67 | len_needed = length(V) 68 | add_chars_needed = len_needed * (len_needed - 1) // 2 - V 69 | 70 | # 创建基本字符串并插入多余字符 71 | base_string = create_string(len_needed - add_chars_needed) 72 | result_string = add_chars(add_chars_needed, base_string) 73 | 74 | print(result_string) 75 | -------------------------------------------------------------------------------- /2024/Python/4.巧克力.py: -------------------------------------------------------------------------------- 1 | """ 2 | 儿童节那天有K位小朋友到小明家做客。小明拿出了珍藏的巧克力招待小朋友们。小明一共有N块巧克力,其中第i块是Hi x Wi的方格组成的长方形。为了公平起见,小明需要从这 N 块巧克力中切出K块巧克力分给小朋友们。切出的巧克力需要满足: 3 | (1)形状是正方形,边长是整数(2)大小相同 4 | 例如,一块6x5的巧克力可以切出6块2x2的巧克力,或者2块3x3的巧克力。 5 | 当然小朋友们都希望得到的巧克力尽可能大,你能帮小Hi计算出,最大的边长是多少么? 6 | 7 | 输入 8 | 第一行包含两个整数N和K。(1 <= N, K <= 100000) 9 | 以下N行每行包含两个整数Hi和Wi。(1 <= Hi, Wi <= 100000) 10 | 输入保证每位小朋友至少能获得一块1x1的巧克力。 11 | 12 | 输出 13 | 输出切出的正方形巧克力最大可能的边长。 14 | 15 | 运行示例 16 | 输入 17 | 2 10 18 | 6 5 19 | 5 6 20 | 21 | 输出 22 | 2 23 | """ 24 | class SolutionMethod1: 25 | @staticmethod 26 | def cho_minx(cho0, n, k): 27 | """ 28 | 找到每块巧克力中最小边长的最大值,作为初始边长下界。 29 | 30 | 参数: 31 | - cho0: 巧克力块的列表,每块巧克力用 [高度, 宽度] 表示。 32 | - n: 巧克力块的总数量。 33 | - k: 需要切出的正方形块数。 34 | 35 | 返回: 36 | - x_min: 所有巧克力最小维度的最大值,除以 k。 37 | """ 38 | x_min = 0 39 | for i in range(n): 40 | # 找到每块巧克力的最小边并更新 x_min 41 | if min(cho0[i]) > x_min: 42 | x_min = min(cho0[i]) 43 | x_min = x_min // k # 初始边长下界 44 | return x_min 45 | 46 | @staticmethod 47 | def cho_att(cho0, x_min, n, k): 48 | """ 49 | 找到能切出至少 k 个正方形的最大边长。 50 | 51 | 参数: 52 | - cho0: 巧克力块的列表,每块巧克力用 [高度, 宽度] 表示。 53 | - x_min: 初始可能的最小边长。 54 | - n: 巧克力块的总数量。 55 | - k: 需要切出的正方形块数。 56 | 57 | 返回: 58 | - 能切出至少 k 个正方形的最大边长。 59 | """ 60 | count = k + 1 # 初始化一个大于 k 的 count 以进入循环 61 | x = x_min - 1 # 初始化 x,从 x_min-1 开始 62 | while count >= k: 63 | x += 1 64 | if x == 0: 65 | x = 1 # 确保 x 至少为 1 66 | count = 0 67 | for i in range(n): 68 | # 计算每块巧克力能切出的边长为 x 的正方形数量 69 | a = cho0[i][0] // x 70 | b = cho0[i][1] // x 71 | count += a * b 72 | return x - 1 # 返回找到的最大边长 73 | 74 | 75 | class SolutionMethod2: 76 | @staticmethod 77 | def max_square_side(N, K, chocolates): 78 | """ 79 | 确定能从给定巧克力块中切出的最大正方形边长。 80 | 81 | 参数: 82 | - N: 巧克力块的总数量。 83 | - K: 需要切出的正方形块数。 84 | - chocolates: 每个巧克力块的尺寸列表,每个元组表示 (高度, 宽度)。 85 | 86 | 返回: 87 | - 可以切出的正方形的最大边长。 88 | """ 89 | 90 | def can_cut_squares(side): 91 | """ 92 | 检查是否可以从巧克力块中切出至少 K 个边长为 side 的正方形。 93 | 94 | 参数: 95 | - side: 正方形的边长。 96 | 97 | 返回: 98 | - 如果可以切出至少 K 个正方形,返回 True;否则返回 False。 99 | """ 100 | count = 0 101 | for h, w in chocolates: 102 | # 计算当前巧克力块可以切出的正方形数量 103 | count += (h // side) * (w // side) 104 | if count >= K: # 提前退出,如果满足所需数量 105 | return True 106 | return count >= K 107 | 108 | # 使用二分查找找到最大边长 109 | left, right = 1, min(max(h for h, w in chocolates), max(w for h, w in chocolates)) 110 | while left <= right: 111 | mid = (left + right) // 2 112 | if can_cut_squares(mid): 113 | left = mid + 1 # 尝试更大的边长 114 | else: 115 | right = mid - 1 # 边长太大,尝试更小的边长 116 | 117 | return right 118 | 119 | 120 | if __name__ == "__main__": 121 | # 输入部分 122 | N, K = map(int, input("输入巧克力数量和需要的正方形数量: ").split()) 123 | chocolates = [list(map(int, input(f"输入第 {i+1} 块巧克力的尺寸 (高度 宽度): ").split())) for i in range(N)] 124 | 125 | # 解法1 126 | method1 = SolutionMethod1() 127 | x_min = method1.cho_minx(chocolates, N, K) 128 | result1 = method1.cho_att(chocolates, x_min, N, K) 129 | print(f"方法1: 能切出的最大正方形边长为 {result1}") 130 | 131 | # 解法2 132 | method2 = SolutionMethod2() 133 | result2 = method2.max_square_side(N, K, chocolates) 134 | print(f"方法2: 能切出的最大正方形边长为 {result2}") 135 | -------------------------------------------------------------------------------- /2024/Python/5.等差素数数列.py: -------------------------------------------------------------------------------- 1 | """ 2 | 2,3,5,7,11,13.是素数序列。 3 | 类似我1们有:7,37,67,97,127,157这样完全由素数组成的等差数列,叫等差素数数列, 4 | 而这个等差素数数列的公差为30,长度为6。 5 | 2004年,格林与华人陶哲轩合作证明了:存在任意长度的素数等差数列。这是数论领域一项惊人的成果! 6 | 有这一理论为基础,请你借助手中的计算机,满怀信心地搜索长度为10的等差素数列,其公差最小值是多少? 7 | """ 8 | 9 | import math 10 | 11 | 12 | def is_prime(n): 13 | """判断一个数是否是素数""" 14 | if n <= 1: 15 | return False 16 | for i in range(2, int(math.sqrt(n)) + 1): 17 | if n % i == 0: 18 | return False 19 | return True 20 | 21 | 22 | class SolutionBase: 23 | """所有解法类的基类,包含常用的方法""" 24 | 25 | @staticmethod 26 | def is_prime(n): 27 | """判断一个数是否是素数""" 28 | return is_prime(n) 29 | 30 | def find_next_prime(self, n): 31 | """找到比 n 大的下一个素数""" 32 | n += 1 33 | while not self.is_prime(n): 34 | n += 1 35 | return n 36 | 37 | 38 | class SolutionMethod1(SolutionBase): 39 | """方法一:暴力枚举法""" 40 | 41 | def arr_diff_equal(self, arr): 42 | """ 43 | 判断一个数组的差值是否相等(即是否为等差数列) 44 | 45 | 参数: 46 | - arr: 素数序列数组 47 | 48 | 返回: 49 | - 布尔值,表示数组是否为等差数列 50 | """ 51 | if len(arr) < 2: 52 | return True 53 | diff = arr[1] - arr[0] 54 | return all(arr[i] - arr[i - 1] == diff for i in range(1, len(arr))) 55 | 56 | def find_diff_prime(self, arr_length): 57 | """ 58 | 找到一个长度为 arr_length 的等差素数数列 59 | 60 | 参数: 61 | - arr_length: 等差数列的长度 62 | 63 | 返回: 64 | - 公差和等差素数数列 65 | """ 66 | i = 2 67 | while True: 68 | prime_arr = [] 69 | diff = self.find_next_prime(i) - i 70 | for j in range(arr_length): 71 | candidate = i + j * diff 72 | if self.is_prime(candidate): 73 | prime_arr.append(candidate) 74 | else: 75 | break # 只要有一个不是素数,立即停止检查 76 | 77 | if len(prime_arr) == arr_length and self.arr_diff_equal(prime_arr): 78 | return diff, prime_arr 79 | i = self.find_next_prime(i) 80 | 81 | 82 | class SolutionMethod2(SolutionBase): 83 | """ 84 | 方法二:递归检查法 (由转计算机交流群, 24数学刘家蔚同学提供) 85 | """ 86 | 87 | def loop_check(self, num, step, arr_length): 88 | """ 89 | 递归检查是否可以形成长度为 arr_length 的等差素数数列 90 | 91 | 参数: 92 | - num: 等差数列的起始素数 93 | - step: 等差数列的公差 94 | - arr_length: 需要的素数数列长度 95 | 96 | 返回: 97 | - 布尔值,表示是否可以形成等差素数数列 98 | """ 99 | if arr_length == 0: 100 | return True 101 | return self.is_prime(num + step) and self.loop_check(num + step, step, arr_length - 1) 102 | 103 | def find_out(self, arr_length): 104 | """ 105 | 找到长度为 arr_length 的等差素数数列的最小公差 106 | 107 | 参数: 108 | - arr_length: 等差数列的长度 109 | 110 | 返回: 111 | - 公差 112 | """ 113 | for n in range(2, 10000): 114 | if not self.is_prime(n): 115 | continue 116 | for step in range(2, 10000): 117 | if self.loop_check(n, step, arr_length): 118 | return step 119 | 120 | 121 | class SolutionMethod3(SolutionBase): 122 | """方法三:利用等差数列的性质优化解法""" 123 | 124 | def generate_primes(self, limit): 125 | """ 126 | 生成所有小于 limit 的素数列表 127 | 128 | 参数: 129 | - limit: 最大范围 130 | 131 | 返回: 132 | - 素数列表 133 | """ 134 | return [num for num in range(2, limit) if self.is_prime(num)] 135 | 136 | def find_arithmetic_prime_sequence(self, arr_length): 137 | """ 138 | 找到长度为 arr_length 的等差素数数列及其公差 139 | 140 | 参数: 141 | - arr_length: 等差数列的长度 142 | 143 | 返回: 144 | - 公差和等差素数数列 145 | """ 146 | primes = self.generate_primes(arr_length) 147 | step = 1 148 | for prime in primes: 149 | step *= prime # 用素数的乘积作为公差 150 | 151 | start = 2 152 | while True: 153 | sequence = [start + i * step for i in range(arr_length)] 154 | if all(self.is_prime(num) for num in sequence): 155 | return step, sequence 156 | start = self.find_next_prime(start) 157 | 158 | 159 | def main(): 160 | arr_length = int(input("请输入等差数列的长度:")) 161 | print("请选择算法方法:") 162 | print("1. 方法一:暴力枚举") 163 | print("2. 方法二:递归检查") 164 | print("3. 方法三:等差数列的性质") 165 | 166 | choice = input("请输入选择(1/2/3):") 167 | 168 | if choice == '1': 169 | sm1 = SolutionMethod1() 170 | diff, prime_arr = sm1.find_diff_prime(arr_length) 171 | print(f"方法1 - 公差为:{diff}") 172 | print(f"等差素数数列为:{prime_arr}") 173 | elif choice == '2': 174 | sm2 = SolutionMethod2() 175 | print(f"方法2 - 公差为:{sm2.find_out(arr_length)}") 176 | elif choice == '3': 177 | sm3 = SolutionMethod3() 178 | diff, prime_sequence = sm3.find_arithmetic_prime_sequence(arr_length) 179 | print(f"方法3 - 公差为:{diff}") 180 | print(f"等差素数数列为:{prime_sequence}") 181 | else: 182 | print("无效的选择,请重新运行程序并选择 1, 2 或 3") 183 | 184 | 185 | if __name__ == '__main__': 186 | main() 187 | -------------------------------------------------------------------------------- /2024/统计图.js: -------------------------------------------------------------------------------- 1 | import * as echarts from 'echarts'; 2 | 3 | var chartDom = document.getElementById('main'); 4 | var myChart = echarts.init(chartDom); 5 | var option; 6 | 7 | option = { 8 | title: { 9 | text: '2024转专业报名' 10 | }, 11 | tooltip: { 12 | trigger: 'axis' 13 | }, 14 | legend: {}, 15 | toolbox: { 16 | show: true, 17 | feature: { 18 | dataZoom: { 19 | yAxisIndex: 'none' 20 | }, 21 | dataView: { readOnly: false }, 22 | magicType: { type: ['line', 'bar'] }, 23 | restore: {}, 24 | saveAsImage: {} 25 | } 26 | }, 27 | xAxis: { 28 | type: 'category', 29 | boundaryGap: 'false', 30 | data: [ 31 | '10:44', 32 | '14:17', 33 | '15:07', 34 | '15:20', 35 | '15:48', 36 | '16:01', 37 | '16:02', 38 | '16:43' 39 | ] 40 | }, 41 | yAxis: { 42 | type: 'value', 43 | axisLabel: { 44 | formatter: '{value} 人' 45 | } 46 | }, 47 | series: [ 48 | { 49 | name: '计科', 50 | type: 'line', 51 | data: [36, 39, 39, 38, 39, 39, 39, 40], 52 | markPoint: { 53 | data: [ 54 | { type: 'max', name: '最大值' }, 55 | { type: 'min', name: '最小值' } 56 | ] 57 | }, 58 | markLine: { 59 | data: [{ type: 'average', name: '平均值' }] 60 | } 61 | }, 62 | { 63 | name: '大数据', 64 | type: 'line', 65 | data: [9, 12, 12, 12, 12, 12, 13, 13], 66 | markPoint: { 67 | data: [ 68 | { type: 'max', name: '最大值' }, 69 | { type: 'min', name: '最小值' } 70 | ] 71 | }, 72 | markLine: { 73 | data: [{ type: 'average', name: '平均值' }] 74 | } 75 | }, 76 | { 77 | name: '人工智能', 78 | type: 'line', 79 | data: [10, 13, 13, 13, 14, 14, 16, 16], 80 | markPoint: { 81 | data: [ 82 | { type: 'max', name: '最大值' }, 83 | { type: 'min', name: '最小值' } 84 | ] 85 | }, 86 | markLine: { 87 | data: [{ type: 'average', name: '平均值' }] 88 | } 89 | }, 90 | { 91 | name: '软工', 92 | type: 'line', 93 | data: [11, 13, 12, 12, 12, 13, 15, 15], 94 | markPoint: { 95 | data: [ 96 | { type: 'max', name: '最大值' }, 97 | { type: 'min', name: '最小值' } 98 | ] 99 | }, 100 | markLine: { 101 | data: [{ type: 'average', name: '平均值' }] 102 | } 103 | }, 104 | { 105 | name: '信安', 106 | type: 'line', 107 | data: [12, 14, 15, 15, 15, 15, 17, 16], 108 | markPoint: { 109 | data: [{ name: '最低', value: -2, xAxis: 1, yAxis: -1.5 }] 110 | }, 111 | markLine: { 112 | data: [{ type: 'average', name: '平均值' }] 113 | } 114 | } 115 | ] 116 | }; 117 | 118 | option && myChart.setOption(option); -------------------------------------------------------------------------------- /2024/计算机学院2024年普通本科生转专业实施方案.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuzWeAre/CUMT_Program-Test/9369675849cdbfb30a75edf460a60e418bc3bcc8/2024/计算机学院2024年普通本科生转专业实施方案.pdf -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 写在前面 2 | Flag Counter 3 | **感谢转专业群以及群里的各位同学,没有你们的热情相助转专业不会如此顺利!** 4 | 5 | 转专业之前希望你可以先问自己一个问题:**你为什么要转专业**。这对你未来的人生十分重要。 6 | 我向来喜欢计算机,而高考的分数尴尬,不能兼顾学校与专业。所以本着“先上车,再中转”的想法来到了矿大。 7 | 为了能通过无数英雄折戟的机考,我提前准备着计算机学院的转专业选拔。因为计算机的知识浩如烟海,我一度找不到学习的方向。 8 | 但是受益于学长学姐的耐心答疑以及前辈留下的22年的真题回忆,机考过程无比顺利,题型也与去年相像。前辈留下的真题,起了大用。 9 | 前人栽树,后人乘凉。那么就让我尽自己的微薄之力,让这棵曾为我荫凉的树长得更高大,惠及更多人吧。 10 | 遂整理原题,发布于此。 11 | 希望本项目能够对各位意图转入计算机学院学习的同学有所帮助。 12 | 这个项目并不完善,题解也并不唯一,大家的想法对本项目很重要!欢迎提出Issue和pr,让我们无限进步🍻! 13 | 14 | 对于有志于进入计算机行业的同学,请在遇到问题时首先尝试检索信息自行解决。对于尝试过但仍难以解决的,请阅读《[提问的智慧](https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md)》学会如何聪明的提问。 15 | 注意,没有人有义务无偿为你解决问题,请有别于中小学。绝大多数人乐意帮助解答疑惑,考虑到他们的付出和您的收获,如果提问时能保持基本礼貌会是个双赢局面。 16 | 欢迎志向转入计算机学院的同学加入CUMT转计算机交流群:866766652。 17 | 矿大转专业交流群831110233 18 | 计算机资源分享群916483545 19 | https://pintia.cn/ 20 | https://leetcode.cn/ 21 | https://www.luogu.com.cn/ 22 | https://programmercarl.com/ 23 | -------------------------------------------------------------------------------- /各学院公共基础课程认证方案.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuzWeAre/CUMT_Program-Test/9369675849cdbfb30a75edf460a60e418bc3bcc8/各学院公共基础课程认证方案.pdf -------------------------------------------------------------------------------- /学分认证须知.md: -------------------------------------------------------------------------------- 1 | # 学分认证须知 2 | 3 | 1. 认证为专业选修课不能超过专选课要求的40%,认证为公选课不得超过要求的60%即6个学分,无论认证成专业选修课或是公选课,每门课认证学分最多不超过2个学分 4 | 2. 实践类的课程如果在课堂内学的可以认证为公选课,不能认证为别的课程,一般认证的原则是专业必修课可以认证为专业选修课、公选课 5 | 3. 金工实习不能认证为认知实习,可以认证为公选课或者专选课。 6 | 4. 认证前的课程学分如果少于认证后的学分,一定要再选别的课程补足学分,否则会影响毕业总学分。 7 | 5. 认证分为两种: 8 | - A课程认证为B课程,请在教务系统选择申请课程替代,点击“报名申请——校内课程替代申请; 9 | - 课程性质认证,即课程的课程性质从A认证为B,点击“报名申请——校内课程学分节点替代申请” 。(系统有个要求,课程性质的认证要求一次性申请完!!!就是说只能申请一次,这学期申请了,以后就不能申请了,这个在大四毕业前申请完成就可以。)具体见操作指南。 -------------------------------------------------------------------------------- /计算机学院2020版培养方案.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuzWeAre/CUMT_Program-Test/9369675849cdbfb30a75edf460a60e418bc3bcc8/计算机学院2020版培养方案.pdf -------------------------------------------------------------------------------- /软件工程2022版本科培养方案.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuzWeAre/CUMT_Program-Test/9369675849cdbfb30a75edf460a60e418bc3bcc8/软件工程2022版本科培养方案.pdf --------------------------------------------------------------------------------