首页 > TAG信息列表 > 25point

1083 List Grades (25point(s))

1083 List Grades (25point(s)) Given a list of N student records with name, ID and grade. You are supposed to sort the records with respect to the grade in non-increasing order, and output those student records of which the grades are in a given interval.

1015 德才论 (25point(s))

1015 德才论 (25point(s)) 宋代史学家司马光在《资治通鉴》中有一段著名的“德才论”:“是故才德全尽谓之圣人,才德兼亡谓之愚人,德胜才谓之君子,才胜德谓之小人。凡取人之术,苟不得圣人,君子而与之,与其得小人,不若得愚人。” 现给出一批考生的德才分数,请根据司马光的理论给出录取排

1005 继续(3n+1)猜想 (25point(s))

1005 继续(3n+1)猜想 (25point(s)) 卡拉兹(Callatz)猜想已经在1001中给出了描述。在这个题目里,情况稍微有些复杂。 当我们验证卡拉兹猜想的时候,为了避免重复计算,可以记录下递推过程中遇到的每一个数。例如对 n=3 进行验证的时候,我们需要计算 3、5、8、4、2、1,则当我们对 n=5

1028 List Sorting (25point(s))

首先,先贴柳神的博客 https://www.liuchuo.net/ 这是地址 想要刷好PTA,强烈推荐柳神的博客,和算法笔记 题目原题 Excel can sort records according to any column. Now you are supposed to imitate this function. Input Specification: Each input file contains one test case

1012 The Best Rank (25point(s))

目录 题目原文 Input Specification: Output Specification: Sample Input: Sample Output: 题目大意: 反思: 总结 首先,先贴柳神的博客 https://www.liuchuo.net/ 这是地址 想要刷好PTA,强烈推荐柳神的博客,和算法笔记 题目原文 To evaluate the performance of our first

PAT(甲级) 1013 Battle Over Cities (25point(s))

题目 题目链接 思路 这道题大意是给你一个连通图,删去某一点后,求有几个连通分量; 用邻接矩阵法存储图,因为删去城市有K种可能,所以要循环K次; 每次循环时都要依次dfs检查每个城市,看这个城市与哪个城市相连,共循环N ^ 2次 知识点 二维vector的初始化方法; 在Java中用户不能调用构造

1040 Longest Symmetric String (25point(s)) 需要二刷 *动态规划 回文子串问题

基本思想: 后续总结,详见数据结构典型问题——动态规划篇;   #include<iostream> #include<stdlib.h> #include<stdio.h> #include<vector> #include<string> #include<math.h> #include<algorithm> #include<cstring> #include<map> #include

1045 快速排序 (25point(s))

著名的快速排序算法里有一个经典的划分过程:我们通常采用某种方法取一个元素作为主元,通过交换,把比主元小的元素放到它的左边,比主元大的元素放到它的右边。 给定划分后的 N 个互不相同的正整数的排列,请问有多少个元素可能是划分前选取的主元? 例如给定 $N = 5$, 排列是1、3、2、4

【PAT】A1141 PAT Ranking of Institutions (25point(s))

文章目录A1141 PAT Ranking of Institutions (25point(s))Input Specification:Output Specification:Sample Input:Sample Output:CodeAnalysis Author: CHEN, Yue Organization: 浙江大学 Time Limit: 800 ms Memory Limit: 64 MB Code Size Limit: 16 KB A1141 PAT Ranki