PAT甲级训练刷题代码记录】的更多相关文章

刷题链接:https://www.patest.cn/contests/pat-a-practise 1001 #include <iostream> #include <stdio.h> using namespace std; ]; int main() { int a,b,sum,index; while(scanf("%d%d",&a,&b)!=EOF){ sum=a+b; ){ printf("-"); sum=-s…
修改code completion快捷键位CTRL+ENTER,帮助提示函数名称 修改命令行提示符的属性,开启快速编辑模式,方便调试 添加c++11语言标准支持 开启代码调试功能 对输入的字符串进行切割时,可以使用scanf按照指定格式分别输入达到切割效果,比如: //对于这样的输入 3-10 99 11-5 87 102-1 0 //对于这种格式不绝对统一的字符串,可以自己构造相应的scanf分割对应的数据 scanf("%d-%d %d", &t, &num, &a…
字符串处理题 目录 <算法笔记> 重点摘要 1001 A+B Format (20) 1005 Spell It Right (20) 1108 Finding Average (20) 1132 Cut Integer (20) 1140 Look-and-say Sequence <算法笔记> 3.6 字符串处理 重点摘要 注意分析输入输出格式 注意细节和边界情况 1001 A+B Format (20) #include<iostream> using names…
散列 PAT (Advanced Level) Practice 散列题 目录 <算法笔记> 重点摘要 1002 A+B for Polynomials (25) 1009 Product of Polynomials (25) 1084 Broken Keyboard (20) 1092 To Buy or Not to Buy (20) 1116 Come on! Let's C (20) 1121 Damn Single (25) <算法笔记> 4.2 散列 重点摘要 1.…
二叉树 PAT (Advanced Level) Practice 二叉树 相关题 目录 <算法笔记> 重点摘要 1020 Tree Traversals (25) 1086 Tree Traversals Again (25) 1102 Invert a Binary Tree (25) 1119 Pre- and Post-order Traversals (30) 1127 ZigZagging on a Tree (30) 1138 Postorder Traversal (25) 1…
图 PAT (Advanced Level) Practice 用到图的存储方式,但没有用到图的算法的题目 目录 1122 Hamiltonian Cycle (25) 1126 Eulerian Path (25) 1134 Vertex Cover (25) 1142 Maximal Clique (25) 1154 Vertex Coloring (25) 1122 Hamiltonian Cycle (25) 题目思路 用 n != queryV.size() 检查是否 query 覆盖…
2012d1t1 密码 模拟题 #include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<iostream> #include<algorithm> #include<set> #include<queue> #include<vector> using namespace std; ; ][]; ?…
Dijkstra PAT (Advanced Level) Practice Dijkstra 相关题 目录 <算法笔记>重点摘要 1003 Emergency (25) <算法笔记> 10.4.1 Dijkstra 重点摘要 对任意给出的图 G(V,E) 和 起点 S,终点 T,求 S 到 T 的最短路径 1. 简介 解决单源最短路问题 只能处理所有边权均非负的情况 若出现负数,最好使用 SPFA 算法 2. 邻接矩阵 const int MAXV = 1000; const i…
二叉查找树 PAT (Advanced Level) Practice 二叉查找树 相关题 目录 <算法笔记> 重点摘要 1099 Build A Binary Search Tree (30) 1115 Counting Nodes in a BST (30) 1143 Lowest Common Ancestor (30) <算法笔记> 9.4 二叉查找树 重点摘要 二叉查找树静态实现 ⭐ (1) 定义 struct Node{ typename data; int level…
题目分析:由于不存在相同的两个时间(24:00:00和00:00:00不会同时存在),则我们假设两个全局变量存放到达的最早的时间和达到的最晚的时间,设置最早的初值为“23:59:59”,设置最晚的初值为“00:00:00”,只要一个人到达的时间比最早的早则更新最早时间同时将id记录下来,最晚的情况也是同样的 #include<iostream> #include<string> using namespace std; int main(){ int n; while(scanf(…