当前位置: 首页 > news >正文

【PTA】攀拓(PAT)- 程序设计(甲级)2023年春季考试

个人学习记录,代码难免不尽人意。

今天又斥资买了今年春季的真题一试,呃,感觉尽力了,89分,在当年排名23,感觉还不错,没有出现读不懂的题目和没有思路的情况,扣的11分分别是第二题两个测试点超时(其实考试时已经有解决思路了,只是时间到了没有提交上,其中一个测试点超时我在考完试后五分钟解决了),还有最后一个大题有一个测试点错误。(这个我现在也想明白了,忘记判断必须是“心型”了,光是对称的不够,必须满足叶子节点的高度是先增再减再增再减的!当时忘了唉,不过题目给的数据到是挺集中,这个条件只有一个过不去

A-1 The Winner over Squares and Primes
This is about a game of fighting all the squrare numbers and prime numbers.

At the very beginning, N people are sitting in N seats, and the seats are numbered from 1 to N, from left to right. Then for all the seats with their numbers being squares (such as 1, 4, 9, 16, …), those people sitting in must leave, and everyone else must shift toward left so that there is no empty seat between any of them. If there are more than one people left, the game continues, but instead of square numbers, this round will let everyone sitting in the prime seats leave, and then the rest of them will shift to fill the empty seats again.

The game continues with checking the square seats and prime seats alternatively, until there is only one winner left. You are supposed to tell the initial seat number for this winner.

Input Specification:
Each input file contains one test case, in which a positive integer N (≤10
5
) is given.

Output Specification:
For each test case, print in a line the initial seat number for this winner.

Sample Input:
10
Sample Output:
6
Hint:
Round 1: People sitting in square seats 1, 4, and 9 will leave. The initial seat numbers for the rest of them sitting from 1 to 7 are 2, 3, 5, 6, 7, 8, 10.

Round 2: People sitting in prime seats 2, 3, 5, and 7 will leave. The initial seat numbers for the rest of them sitting from 1 to 3 are 2, 6, 8.

Round 3: People sitting in square seat 1 will leave. The initial seat numbers for the rest of them sitting from 1 to 2 are 6, 8.

Round 4: People sitting in prime seat 2 will leave. The initial seat numbers for the final winner is 6.

#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<cmath>
using namespace std;
vector<int> res,temp;
const int maxn=100100;//写成10010最后三个测试点过不去。
int hashtable[maxn]={0};
void getsquare(){int i=1;while(i*i<=maxn){hashtable[i*i]=1;i++;}
}
bool isprime(int n){if(n<=1) return false;int mid=(int)sqrt(1.0*n);for(int i=2;i<=mid;i++){if(n%i==0) return false;}return true;
}
int main(){int n;scanf("%d",&n);for(int i=1;i<=n;i++){res.push_back(i);}getsquare();while(res.size()>1){for(int i=0;i<res.size();i++){if(hashtable[i+1]!=1){temp.push_back(res[i]);}}res.clear();for(int i=0;i<temp.size();i++){if(!isprime(i+1)){res.push_back(temp[i]);}}temp.clear();}printf("%d\n",res[0]);} 

很简单的一道题,先求出平方数表然后判断即可。

A-2 LRU-K
Least Recently Used (LRU) cache scheme is to remove the least recently used frame (the one hasn’t been used for the longest amount of time) when the cache is full and a new page is referenced which is not there in cache.

LRU-K is a variant of the LRU algorithm, where K represents the number of recent uses. LRU can be considered as LRU-1. Unlike LRU, the LRU-K requires the maintenance of two different queues (for historical access and cache). The data in the historical access queue is not moved to the cache queue until the data is hit K times.

For example, assuming that the length of both queues is 5, and the memory is initialized to be empty. LRU-2 is used to process the data sequence in order: 9,5,6,7,8,3,8,9,5,9,8,3,4,7,5,6. The changes of the historical access queue and the cache queue are shown in the following table:
在这里插入图片描述
Your job is to implement this LRU-K cache scheme.

Input Specification:
Each input file contains one test case. For each case, the first line gives 3 positive integers: K (≤5), N (≤10 4 ) and M (≤10 5 ) which are the number of hits for cache, the size of the queues (assuming both queues have the same size) and the number of referenced page ID’s. Then M referenced page ID’s are given in the next line. A page ID is a number in the range [1,2×10 4 ]. All the numbers in a line are separated by a space.

Output Specification:
For each test case, output in the first line the page ID’s in the historical access queue, and in the second line, those in the cache queue. The ID’s are ordered from front to rear of each queue. All the numbers in a line must be separated by 1 space, and there must be no extra space at the beginning or the end of the line. In case that a queue is empty, output - in a line instead.

Sample Input 1:
2 5 17
9 5 6 7 8 3 8 9 5 9 8 3 4 7 5 6 9
Sample Output 1:
4 9
8 3 7 5 6
Sample Input 2:
3 5 10
9 5 6 7 8 3 8 9 5 9
Sample Output 2:
7 3 8 5 9

20分代码(应该是)

#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<cmath>
#include<unordered_set>
#include<set>
using namespace std;
unordered_set<int> v1,v2;
const int maxn=100100;
int list[maxn];
int hashtable[maxn]={0};int main(){int k,n,m;scanf("%d %d %d",&k,&n,&m);for(int i=0;i<m;i++)
{scanf("%d",&list[i]);
}for(int i=0;i<m;i++){unordered_set<int>::iterator it2=v2.find(list[i]);if(it2!=v2.end()){v2.erase(it2);v2.insert(list[i]);}else{unordered_set<int>::iterator it1=v1.find(list[i]);if(it1==v1.end()){if(v1.size()<n){v1.insert(list[i]);}else{int cnt=v1.size();unordered_set<int>::iterator temp=v1.begin();for(int i=0;i<cnt-1;i++){temp++;}v1.erase(temp);v1.insert(list[i]);}}else{//hithashtable[list[i]]++;if(hashtable[list[i]]>=k-1){v1.erase(it1);if(v2.size()<n){v2.insert(list[i]);}else{int cnt=v2.size();unordered_set<int>::iterator temp=v2.begin();for(int i=0;i<cnt-1;i++){temp++;}v2.erase(temp);v2.insert(list[i]);}}else{v1.erase(it1); v1.insert(list[i]);}	}}//if(v1.empty()) printf("-\n");
//   else{
//   	int cnt=v1.size();
//   	for(unordered_set<int>::iterator it=v1.begin();it!=v1.end();it++){
//   	printf("%d",*it);
//   	cnt--;
//   	if(cnt>0) printf(" ");
//   	else printf("\n");
//   }
//   }
//   if(v2.empty()) printf("-");
//   else{
//   	int cnt=v2.size();
//   	for(unordered_set<int>::iterator it=v2.begin();it!=v2.end();it++){
//   	printf("%d",*it);
//   	cnt--;
//   	if(cnt>0) printf(" ");
//
//   }
//   }
//   printf("-----------------------------------------\n"); }vector<int> vec1,vec2; for(unordered_set<int>::reverse_iterator it=v1.rbegin();it!=v1.rend();it++){vec1.push_back(*it);}for(unordered_set<int>::iterator it=v2.begin();it!=v2.end();it++){
vec2.push_back(*it);}
if(v1.empty()) printf("-\n");
else{for(int i=vec1.size()-1;i>=0;i--){printf("%d",vec1[i]);if(i!=0)printf(" ");else printf("\n");}
}if(v2.empty()) printf("-");else{for(int i=vec2.size()-1;i>=0;i--){printf("%d",vec2[i]);if(i!=0)printf(" ");}}} 

这道题不是很难想,但是有两个测试点用vector来做一定会超时(涉及太多的删除和移动),因此我们遇到频繁删除和移动的题尽量用set或者map来做,在我改了之后代码应该可以过除了最后一个测试点以外的点。

A-3 K Vertex
Given a directed graph, a K-vertex is a vertex of which the out degree is larger than the indegree. For example, the vertices a and b in the figure are K-vertices.
在这里插入图片描述
Your job is to list all the K-vertices in a given graph.

Input Specification:
Each input file contains one test case. For each case, the first line contains 2 positive integers: N (≤200) and M, which are the number of vertices and the number of edges, respectively. Then M lines follow, each gives a directed edge <v1, v2> in the format:

v1 v2
Here we assume that all the vertices are numbered from 0 to N−1. It is guaranteed that v1 is never the same as v2.

Finally a line of N strings is given, where the i-th string corresponds to the key of the i-th vertex (i=0,⋯,N−1). Each string consists of no more than 2 lower-cased English letters.

Output Specification:
Output the keys of all the K-vertices, each occupies a line, in alphabetical order. It is guaranteed that there is at least one output.

Sample Input:
4 5
0 1
2 1
3 1
2 0
3 2
c d b a
Sample Output:
a
b

#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<cmath>using namespace std;
const int maxn=210;
const int INF=1000000000;
int G[maxn][maxn];
int indegree[maxn]={0};
int outdegree[maxn]={0};
vector<string> v;
int main(){for(int i=0;i<maxn;i++){for(int j=0;j<maxn;j++){G[i][j]=INF;}}int n,m;scanf("%d %d",&n,&m);for(int i=0;i<m;i++){int a,b;scanf("%d %d",&a,&b);G[a][b]=1;indegree[b]++;outdegree[a]++;}for(int i=0;i<n;i++){string str;cin >> str;if(outdegree[i]>indegree[i]){v.push_back(str);}}sort(v.begin(),v.end());for(int i=0;i<v.size();i++){cout << v[i];if(i!=v.size()-1) cout << endl;}
}       

有些简单了…

A-4 Tree of Love
在这里插入图片描述
If a binary tree has its left and right subtrees perfectly symmetric. And more, if from left to right, the depths of leaves are first in increasing (or non-decreasing) then decreasing (or non-increasing), then again increasing (or non-decreasing), and finally decreasing (or non-increasing) order, then the shape of this tree looks like a heart (as shown by the above figure), and hence is called “Tree of Love”.

Given the inorder and postorder traversal sequences of a binary tree, your job is to construct this tree and test if it is a tree of love, and output its outer contour(外轮廓). “Outer contour” consists of nodes visited from the root, along the left most path to a leaf, then all the leaves from left to right, and finally back to the root along the right most path.

Input Specification:
Each input file contains one test case. For each case, the first line gives a positive integer N (<100), which is the number of nodes in the tree. Then the next two lines each contains N positive keys as the inorder and postorder traversal sequences, respectively. All the keys are distinct integers no more than 10
3
. The numbers in a line are separated by spaces. It is guaranteed that a unique binary tree can be constructed from the input.

Output Specification:
For each test case, if the tree is a tree of love, output Yes in the first line, or No if not. Then output the outer contour in the second line.

All the numbers in a line must be separated by 1 space, and there must be no extra space at the beginning or the end of the line.

Sample Input 1:
27
5 4 6 22 3 23 7 20 2 21 8 18 9 1 10 19 11 24 17 25 12 26 16 27 13 15 14
5 6 22 4 7 23 20 3 8 21 9 18 2 10 11 24 19 12 26 25 13 27 14 15 16 17 1
Sample Output 1:
Yes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
Sample Input 2:
11
4 8 10 2 5 1 6 3 9 11 7
10 8 4 5 2 6 11 9 7 3 1
Sample Output 2:
No
1 2 4 10 5 6 11 7 3
Hint for Sample 2:
The answer is No because the tree is not symmetric. It would be Yes if we swap 9 and 11 in the inorder sequence.

28分代码

#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<cmath>
#include<queue>
using namespace std;
const int maxn=210;
int in[maxn];
int post[maxn];
vector<int> v;
struct node{int data;node* lchild;node* rchild;
};
node* newnode(int data){node* root=new node;root->data=data;root->lchild=NULL;root->rchild=NULL;return root; 
}
node* create(int postl,int postr,int inl,int inr){if(postl>postr) return NULL;int mid=post[postr];int index;for(int i=inl;i<=inr;i++){if(in[i]==mid){index=i;break;}}int leftnum=index-inl;node* root=newnode(mid);root->lchild=create(postl,postl+leftnum-1,inl,index-1);root->rchild=create(postl+leftnum,postr-1,index+1,inr);return root;
}
bool bfs(node* left,node* right){queue<node*> q1,q2;q1.push(left);q2.push(right);while(!q1.empty()&&!q2.empty()){node* lefttemp=q1.front();q1.pop();node* righttemp=q2.front();q2.pop();int tag1=0,tag2=0,tag3=0,tag4=0;if(lefttemp->lchild!=NULL){q1.push(lefttemp->lchild);tag1=1; }if(lefttemp->rchild!=NULL){q1.push(lefttemp->rchild);tag2=1; }//右子树应该先入右子树节点 if(righttemp->rchild!=NULL){q2.push(righttemp->rchild);tag3=1; }if(righttemp->lchild!=NULL){q2.push(righttemp->lchild);tag4=1; }if(tag1!=tag3||tag2!=tag4){
//			cout <<lefttemp->data<<endl;
//			cout << righttemp->data<<endl;
//			cout << tag1<<tag3<<tag2<<tag4<<endl; return false;}}if(!q1.empty()||!q2.empty()){return false;} else return true; 
}
void dfs(node* root){if(root==NULL) return;dfs(root->lchild);if(root->lchild==NULL&&root->rchild==NULL){v.push_back(root->data);}dfs(root->rchild);
}
void getleft(node* root){if(root==NULL) return;if(!(root->lchild==NULL&&root->rchild==NULL))v.push_back(root->data);getleft(root->lchild);
}
void getright(node* root){if(root==NULL) return;getright(root->rchild);if(!(root->lchild==NULL&&root->rchild==NULL))v.push_back(root->data);
}
int main(){int n;scanf("%d",&n);for(int i=0;i<n;i++){scanf("%d",&in[i]);}for(int i=0;i<n;i++){scanf("%d",&post[i]);}node* root=create(0,n-1,0,n-1);bool flag;if(root->lchild==NULL&&root->rchild==NULL){//测试点2需要特判数量为1 printf("Yes\n");printf("%d",root->data);return 0;}if(root->lchild==NULL&&root->rchild!=NULL||(root->rchild==NULL&&root->lchild!=NULL)){flag=false;}else flag=bfs(root->lchild,root->rchild);if(!flag){printf("No\n");}else printf("Yes\n");getleft(root);dfs(root);getright(root);v.pop_back();//右边多加了一个根节点 for(int i=0;i<v.size();i++){printf("%d",v[i]);if(i!=v.size()-1) printf(" ");}}   

这道题我忘记判断叶子节点的高度必须从左到右满足先增后减再增再减了,如果想要补上的话应该用bfs更新每个节点的高度,同时将所有叶子节点的高度存储在数组中,查看是不是先增后减再增再减(这个也好判断,设置信标即可),如果是再输出yes。

相关文章:

【PTA】攀拓(PAT)- 程序设计(甲级)2023年春季考试

个人学习记录&#xff0c;代码难免不尽人意。 今天又斥资买了今年春季的真题一试&#xff0c;呃&#xff0c;感觉尽力了&#xff0c;89分&#xff0c;在当年排名23&#xff0c;感觉还不错&#xff0c;没有出现读不懂的题目和没有思路的情况&#xff0c;扣的11分分别是第二题两个…...

Spring Cloud Gateway 实现原理

Spring Cloud Gateway是Spring Cloud生态系统中的一个组件&#xff0c;用于构建基于Spring Boot的微服务架构中的网关服务。它的主要目的是提供一种灵活的方式来路由、过滤和转换HTTP请求&#xff0c;从而允许您构建强大、高性能的微服务应用程序。 以下是Spring Cloud Gatewa…...

嘉泰实业:真实低门槛,安全有保障

在互联网金融大行其道的当下&#xff0c;无论用户是多么的青睐、喜爱这种便捷的理财方式&#xff0c;也一定得把资金安全放在心上。要投就投那些实力背景雄厚&#xff0c;诚信经营的平台&#xff0c;可以选择投资用户基数庞大的理财老品牌&#xff0c;也可以选择发展势头迅猛的…...

spring boot 2.7 -> 3.0升级指南

spring boot提供一个版本迁移指南 2.7 -> 3.0...

MQTT 连接优化指南

&#x1f337;&#x1f341; 博主猫头虎&#xff08;&#x1f405;&#x1f43e;&#xff09;带您 Go to New World✨&#x1f341; &#x1f984; 博客首页——&#x1f405;&#x1f43e;猫头虎的博客&#x1f390; &#x1f433; 《面试题大全专栏》 &#x1f995; 文章图文…...

算法和数据结构学习中的一些小的工具函数

算法和数据结构学习中的一些小的工具函数 作者&#xff1a;Grey 原文地址&#xff1a; 博客园&#xff1a;算法和数据结构学习中的一些小的工具函数 CSDN&#xff1a;算法和数据结构学习中的一些小的工具函数 提取一个数二进制最右侧的 1 比如二进制为&#xff1a;0100 0…...

解决2K/4K高分屏下Vmware等虚拟机下Kail Linux界面显示问题

问题现象 在我们日常使用VirtualBox、Vmware workstation、Hyper-V等虚拟机安装使用Kali系统&#xff0c;在2K/4K高分辨率电脑下Kali系统界面显示太小&#xff0c;包括各种软件及命令终端字体均无法很直观的看出&#xff0c;影响我们的正常测试及使用。 常规处理思路 很多人…...

【校招VIP】java语言考点之双亲委派模型

考点介绍&#xff1a; 双亲委派是校招面试中的高频考点之一。双亲委派机制定义: 当一个类加载器收到了类加载的请求的时候&#xff0c;他不会直接去加载指定的类&#xff0c;而是把这个请求委托给自己的父加载器去加载&#xff0c;只有父加载器无法加载这个类的时候&#xff0…...

2023年阿里云新用户云服务器价格表

阿里云&#xff0c;作为国内领先的云计算服务提供商&#xff0c;一直致力于为全球用户提供安全、稳定、高效的云计算服务。对于新用户来说&#xff0c;阿里云服务器是一个非常不错的选择。那么&#xff0c;阿里云新用户云服务器的价格是怎样的呢&#xff1f;本文将为大家详细介…...

信号相关名词概念汇总-采样周期、泄露、窗函数等

信号相关名词概念汇总-采样周期、泄露、窗函数等 以下为信号相关名词概念的汇总 1 名词解释 采样周期/间隔&#xff1a;采样频率的倒数&#xff0c;两次相邻采样之间的时间间隔采样时间&#xff1a;采样的总时长&#xff0c;即采样点数N和采样周期的乘积采样频率&#xff1a; …...

数字化新零售营销模式如何落地?数字化新零售营销功能推荐

​通过科技手段&#xff0c;针对对线下零售店面的客户进行消费行为、频次等的分析&#xff0c;并进一步整合线上线下资源&#xff0c;实现实体零售的效率充分化&#xff0c;便是目前很火的新零售营销模式&#xff0c;能够将实体门店与数字化技术进行有机结合&#xff0c;通过为…...

712. 两个字符串的最小ASCII删除和 -- 动规

712. 两个字符串的最小ASCII删除和 class MinimumDeleteSum:"""712. 两个字符串的最小ASCII删除和https://leetcode.cn/problems/minimum-ascii-delete-sum-for-two-strings/"""def solution(self, s1: str, s2: str) -> int:""&qu…...

python中的小tips

1、注释 1、注释快捷键&#xff1a; Ctrl/ 可以注释掉光标所在的这一行&#xff0c;或者是选中的区域。 对于注释掉的这一行或者这一区域&#xff0c;按下ctrl/则会去掉注释。 2、多行注释 在写多行注释时&#xff0c;英文状态下写三个"&#xff0c;会自动变成六个"&…...

高精度(加减乘除)

高精度算法出现的原因 当参与运算的数的范围大大的超出了标准数据类型&#xff0c;如int&#xff08;-2147483648 ~ 2147483647&#xff09;或者long long的范围&#xff0c;就需要使用高精度算法来进行数的运算。高精度运算的特点是代码长度比较长&#xff0c;本质是对数学运算…...

java企业数据管理系统

项目介绍 此项目为企业数据管理系统的后端部分&#xff0c;前端部分请参考vue-admin&#xff0c;项目实现了菜单管理、用户管理、角色管理和权限管理四个基础模块&#xff0c;前端菜单管理结合动态路由可自由添加菜单。结合Shiro权限管理实现了菜单和按钮的权限控制。 ❝ 前端…...

【云原生进阶之PaaS中间件】第二章Zookeeper-3.1分布式架构介绍

1 分布式架构详解 1.1 分布式发展历程 1.1.1 单点集中式 特点&#xff1a;App、DB、FileServer都部署在一台机器上。并且访问请求量较少 1.1.2 应用服务和数据服务拆分 特点&#xff1a;App、DB、FileServer分别部署在独立服务器上。并且访问请求量较少 1.1.3 使用缓存改善…...

2023-09-11力扣每日一题

链接&#xff1a; 630. 课程表 III 题意 一个课程花费ai天&#xff0c;需要在bi天之前修好才算成功&#xff0c;求最多能修几个课 解&#xff1a; ddl越靠后的应该越晚做&#xff0c;所以先按照b排序&#xff08;这还用问为什么吗&#xff1f; 然后通过维护一个优先队列存…...

windows10使用wheel安装tensorflow2.13.0/2.10.0 (保姆级教程)

安装过程 安装虚拟环境安装virtualenv安装满足要求的python版本使用virtualenv创建指定python版本的虚拟环境 安装tensorflow安装tensorflow-docs直接下载使用wheel下载 在VSCode编辑器中使用虚拟环境下的python解释器&#xff0c;并使用tensorflow常见错误 注意&#xff1a; t…...

【LeetCode与《代码随想录》】贪心算法篇:做题笔记与总结-JavaScript版

代码随想录 贪心的本质是选择每一阶段的局部最优&#xff0c;从而达到全局最优。 文章目录 455. 分发饼干376. 摆动序列53. 最大子数组和122. 买卖股票的最佳时机 II55. 跳跃游戏45. 跳跃游戏 II1005. K 次取反后最大化的数组和134. 加油站135. 分发糖果&#xff08;困难&#…...

Http客户端OkHttp的基本使用

简介 OkHttp是一个强大的开源HTTP客户端&#xff0c;它被广泛用于Android和Java应用程序中。OkHttp具有简单易用的API&#xff0c;提供了许多高级功能&#xff0c;如连接池、请求压缩和缓存等。 依赖 要使用OkHttp&#xff0c;需要在项目的构建文件中添加以下依赖&#xff1…...

Vim 调用外部命令学习笔记

Vim 外部命令集成完全指南 文章目录 Vim 外部命令集成完全指南核心概念理解命令语法解析语法对比 常用外部命令详解文本排序与去重文本筛选与搜索高级 grep 搜索技巧文本替换与编辑字符处理高级文本处理编程语言处理其他实用命令 范围操作示例指定行范围处理复合命令示例 实用技…...

挑战杯推荐项目

“人工智能”创意赛 - 智能艺术创作助手&#xff1a;借助大模型技术&#xff0c;开发能根据用户输入的主题、风格等要求&#xff0c;生成绘画、音乐、文学作品等多种形式艺术创作灵感或初稿的应用&#xff0c;帮助艺术家和创意爱好者激发创意、提高创作效率。 ​ - 个性化梦境…...

Ubuntu系统下交叉编译openssl

一、参考资料 OpenSSL&&libcurl库的交叉编译 - hesetone - 博客园 二、准备工作 1. 编译环境 宿主机&#xff1a;Ubuntu 20.04.6 LTSHost&#xff1a;ARM32位交叉编译器&#xff1a;arm-linux-gnueabihf-gcc-11.1.0 2. 设置交叉编译工具链 在交叉编译之前&#x…...

测试markdown--肇兴

day1&#xff1a; 1、去程&#xff1a;7:04 --11:32高铁 高铁右转上售票大厅2楼&#xff0c;穿过候车厅下一楼&#xff0c;上大巴车 &#xffe5;10/人 **2、到达&#xff1a;**12点多到达寨子&#xff0c;买门票&#xff0c;美团/抖音&#xff1a;&#xffe5;78人 3、中饭&a…...

Android15默认授权浮窗权限

我们经常有那种需求&#xff0c;客户需要定制的apk集成在ROM中&#xff0c;并且默认授予其【显示在其他应用的上层】权限&#xff0c;也就是我们常说的浮窗权限&#xff0c;那么我们就可以通过以下方法在wms、ams等系统服务的systemReady()方法中调用即可实现预置应用默认授权浮…...

Python Ovito统计金刚石结构数量

大家好,我是小马老师。 本文介绍python ovito方法统计金刚石结构的方法。 Ovito Identify diamond structure命令可以识别和统计金刚石结构,但是无法直接输出结构的变化情况。 本文使用python调用ovito包的方法,可以持续统计各步的金刚石结构,具体代码如下: from ovito…...

Web中间件--tomcat学习

Web中间件–tomcat Java虚拟机详解 什么是JAVA虚拟机 Java虚拟机是一个抽象的计算机&#xff0c;它可以执行Java字节码。Java虚拟机是Java平台的一部分&#xff0c;Java平台由Java语言、Java API和Java虚拟机组成。Java虚拟机的主要作用是将Java字节码转换为机器代码&#x…...

基于江科大stm32屏幕驱动,实现OLED多级菜单(动画效果),结构体链表实现(独创源码)

引言 在嵌入式系统中&#xff0c;用户界面的设计往往直接影响到用户体验。本文将以STM32微控制器和OLED显示屏为例&#xff0c;介绍如何实现一个多级菜单系统。该系统支持用户通过按键导航菜单&#xff0c;执行相应操作&#xff0c;并提供平滑的滚动动画效果。 本文设计了一个…...

CSS3相关知识点

CSS3相关知识点 CSS3私有前缀私有前缀私有前缀存在的意义常见浏览器的私有前缀 CSS3基本语法CSS3 新增长度单位CSS3 新增颜色设置方式CSS3 新增选择器CSS3 新增盒模型相关属性box-sizing 怪异盒模型resize调整盒子大小box-shadow 盒子阴影opacity 不透明度 CSS3 新增背景属性ba…...

基于stm32F10x 系列微控制器的智能电子琴(附完整项目源码、详细接线及讲解视频)

注&#xff1a;文章末尾网盘链接中自取成品使用演示视频、项目源码、项目文档 所用硬件&#xff1a;STM32F103C8T6、无源蜂鸣器、44矩阵键盘、flash存储模块、OLED显示屏、RGB三色灯、面包板、杜邦线、usb转ttl串口 stm32f103c8t6 面包板 …...