欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
  • PAT甲级1006水题飘过

    题目分析:由于不存在相同的两个时间(24:00:00和00:00:00不会同时存在),则我们假设两个全局变量存放到达的最早的时间和达到的最晚的时间,设置最早的初值为“23:59:59”,设置最晚的初值为“00:00:00”,只要一个人到达的时间比最早的早则更新最早时间同时将id记录下来,最晚的情况也 ...

    程序员文章站2023-11-06
  • PAT 甲级真题 1006 Sign In and Sign Out (25分) python实现

    PAT 甲级真题 1006 Sign In and Sign Out (25分) python实现

    1006 Sign In and Sign Out (25分)At the beginning of every day, the first person who signs in the computer room will unlock the door, and the last one who signs out will lock the door. Given the records of signing in’s and out’s, you are supposed to find th

    程序员文章站2022-08-06
    IT编程
  • PAT甲级练习题1001、1002

    PAT甲级练习题1001、10021001 A+B Format (20 分) Calculate a+b and output the sum in standard format -- that is, the digits must be separated into groups of th...

    程序员文章站2022-07-15
  • PAT甲级练习题1001、1002

    1001 A+B Format (20 分) Calculate a+b and output the sum in standard format -- that is, the digits must be separated into groups of three by commas (un...

    程序员文章站2022-07-15
  • PAT 甲级练习 1002

    1002 A+B for PolynomialsThis time, you are supposed to find A+B where A and B are two polynomials.InputEach input file contains one test case. Each ca...

    程序员文章站2022-07-15
  • PAT 甲级 1122. Hamiltonian Cycle (25)

    The “Hamilton cycle problem” is to find a simple cycle that contains every vertex in a graph. Such a cycle is called a “Hamiltonian cycle”.In this pro...

    程序员文章站2022-07-15
  • PAT*1022 Werewolf(甲级1148升级版)

    PAT*1022 Werewolf(甲级1148升级版)题目:Werewolf(狼人杀) is a game in which the players are partitioned into two parties: the werewolves and the human beings. Su...

    程序员文章站2022-07-15
  • PAT甲级 1122. Hamiltonian Cycle (25)

    1122. Hamiltonian Cycle (25)时间限制300 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueThe "Hamilton cycle problem" is to find a simple cycle that cont...

    程序员文章站2022-07-15
  • PAT 甲级 A1029 Median

    自己写的代码#include <cstdio>#include <algorithm>using namespace std;const int maxn = 1000010;const int INF = 0x3fffffff;int n1[maxn], m1[maxn];...

    程序员文章站2022-07-15
  • 【PAT甲级】【1002】 A+B for Polynomials (25分)

    【PAT甲级】【1002】 A+B for Polynomials (25分)

    问题描述:This time, you are supposed to find A+B where A and B are two polynomials.Input Specification:Each input file contains one test case. Each case o...

    程序员文章站2022-07-15
  • *PAT_甲级_1073 Scientific Notation (20point(s)) (C++)【字符串处理/科学计数法】

    *PAT_甲级_1073 Scientific Notation (20point(s)) (C++)【字符串处理/科学计数法】

    目录1,题目描述 题目描述2,思路我的算法3,AC代码我的代码柳神解法4,解题过程第一搏 第二搏第三搏第四搏1,题目描述Sample Input 1:+1.23400E-03 Sample Output 1:0.00123400 Sample Input 2:-1.2E+10 Sample Outp...

    程序员文章站2022-07-15
  • PAT甲级 1151 LCA in a Binary Tree (30分) 最近公共祖先

    PAT甲级 1151 LCA in a Binary Tree (30分) 最近公共祖先

    PAT甲级 1151 LCA in a Binary Tree (30分) 最近公共祖先题目大意:给出中序序列和先序序列,再给出两个点,求这两个点的最近公共祖先不建树的做法:已知某个树的根结点,若a和b在根结点的左边,则a和b的最近公共祖先在当前子树根结点的左子树寻找,如果a和b在当前子树根结点的两...

    程序员文章站2022-07-14
  • PAT甲级1143 Lowest Common Ancestor BST+LCA

    PAT甲级1143 Lowest Common Ancestor BST+LCA

    本想建树然后通过递归左右子树的形式去做,但是发现题中说明最多有一万个结点,写完以后果然超时....判别LCA的方法判断当前的两个点的位置情况,如果一个在左子树,一个在右子树,那么根便是最小公共祖先;如果都在左子树,递归左子树判断;如果都在右子树,递归右子树判断;如果一个就是根,那么它便是最小公共祖先...

    程序员文章站2022-07-14
  • PAT_甲级_1050 String Subtraction (20分) (C++)【签到题/二分查找/字符串处理】

    PAT_甲级_1050 String Subtraction (20分) (C++)【签到题/二分查找/字符串处理】

    目录1,题目描述 题目大意2,思路3,代码4,测试效果1,题目描述Sample Input:They are students.aeiou Sample Output:Thy r stdnts. 题目大意将一个字符串s1中出现在另一个字符串s2的字符全部删除。 2,思路题意很明确,所以关键在如何高效...

    程序员文章站2022-07-14
  • PAT_甲级_1065 A+B and C (64bit) (20分) (C++)【大数相加】

    PAT_甲级_1065 A+B and C (64bit) (20分) (C++)【大数相加】

    目录1,题目描述2,思路3,AC代码4,解题过程及知识补充第一搏 第二搏第三搏第四搏1,题目描述Sample Input:31 2 32 3 49223372036854775807 -9223372036854775808 0 Sample Output:Case #1: falseCase #2...

    程序员文章站2022-07-13
  • 2019秋季PAT甲级_C++题解

    2019秋季PAT甲级_C++题解

    2019 秋季 PAT (Advanced Level) C++题解 考试拿到了满分但受考场状态和知识水平所限可能方法不够简洁,此处保留记录,仍需多加学习。备考总结(笔记目录)在 "这里" 7 1 Forever (20 分) "Forever number" is a positive integ ...

    程序员文章站2022-07-09
    IT编程
  • PAT甲级1086 Tree Traversals Again (25分)|C++实现

    PAT甲级1086 Tree Traversals Again (25分)|C++实现

    一、题目描述原题链接Input Specification:​​Output Specification:For each test case, print the postorder traversal sequence of the corresponding tree in one line....

    程序员文章站2022-07-08
  • PAT甲级——A1053 Path of Equal Weight【30】

    PAT甲级——A1053 Path of Equal Weight【30】

    Given a non-empty tree with root R, and with weight W​i​​ assigned to each tree node T​i​​. The weight of a path from R to L is defined to be the sum ...

    程序员文章站2022-07-07
  • PAT甲级——A1053 Path of Equal Weight

    PAT甲级——A1053 Path of Equal Weight

    Given a non-empty tree with root R, and with weight W​i​​ assigned to each tree node T​i​​. The weight of a path from R to L is defined to be the sum ...

    程序员文章站2022-07-07
  • PAT甲级——1002. A+B for Polynomials (25)(C++)

    解题思路创建一个数组float map[1001] = {0.0}作为哈希表,用数组的索引表示指数,对应位置存储的元素表示系数。开始我用的是cin, cout标准输入输出(在标准输出中保留小数点后1位的写法:cout

    程序员文章站2022-06-25