甲级 真题1020 pat

PAT 甲级【1013 Battle Over Cities】

本题就是dfs.连通图个数-2; 但是java慢,最后一个case 超时 import java.io.*; import java.util.HashSet; import java.util.Set; public class Main { @SuppressWarnings("uncheck" ......
甲级 Battle Cities 1013 Over

PAT_B1008 数组元素循环右移问题

一个数组A中存有N(>0)个整数,在不允许使用另外数组的前提下,将每个整数循环向右移M(≥0)个位置,即将A中的数据由(A0​A1​⋯AN−1​)变换为(AN−M​⋯AN−1​A0​A1​⋯AN−M−1​)(最后M个数循环移至最前面的M个位置)。如果需要考虑程序移动数据的次数尽量少,要如何设计移动的 ......
数组 元素 问题 PAT_B 1008

PAT_A1049 Counting Ones【困难】

数学问题/简单数学 需要严格推理,具体见算法笔记上机指南p199.每次迭代,记录当前位出现1的个数;对当前位的数分三种情况讨论。 ......
Counting PAT_A 1049 Ones PAT

PAT_A1104 Sum of Number Segments

Given a sequence of positive numbers, a segment is defined to be a consecutive subsequence. For example, given the sequence { 0.1, 0.2, 0.3, 0.4 }, we ......
Segments Number PAT_A 1104 PAT

PAT 甲级【1012 The Best Rank】

本题用java极容易超时,提交了好几次才成功 另外90 88 77 77 50,名次应该是1 2 3 3 5 ,不是1 2 3 3 4 import java.io.*; public class Main { @SuppressWarnings("unchecked") public static ......
甲级 1012 Best Rank PAT

PAT_B1003 我要通过!

“答案正确”是自动判题系统给出的最令人欢喜的回复。本题属于 PAT 的“答案正确”大派送 —— 只要读入的字符串满足下列条件,系统就输出“答案正确”,否则输出“答案错误”。 得到“答案正确”的条件是: 字符串中必须仅有 P、 A、 T这三种字符,不可以包含其它字符; 任意形如 xPATx 的字符串都 ......
我要 PAT_B 1003 PAT

【华为OD机试真题 python】数轴上两个点集距离

python: def function(): l1 = input().split(" ") l2 = input().split(" ") l3 = input().split(" ") m, n, R = int(l1[0]), int(l1[1]), int(l1[2]) A = [int( ......
数轴 真题 两个 python

真题 luogu.com.cn

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ......
真题 luogu com cn

PAT 甲级【1011 World Cup Betting】

import java.io.IOException; import java.io.InputStreamReader; import java.io.StreamTokenizer; public class Main { @SuppressWarnings("unchecked") publi ......
甲级 Betting World 1011 PAT

PAT 甲级【1010 Radix】

本题范围long型(35)^10 枚举radix范围上限pow(n/a0,1/m)上,考虑上限加1.范围较大。使用二分查找枚举 代码如下 import java.io.BufferedReader; import java.io.IOException; import java.io.InputSt ......
甲级 Radix 1010 PAT

PAT_A1029 Median

two_pointers;令两个序列的最后都添加一个很大的数作为哨兵节点,可以简化代码,解决数组问题;使用cin、cout会超时。 ......
Median PAT_A 1029 PAT

PAT 甲级【1009 Product of Polynomials】

/* 系数为0不输出 貌似runtime异常也显示答案不正确*/import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.StreamToke ......
甲级 Polynomials Product 1009 PAT

PAT 甲级1008【1008 Elevator】

import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.StreamTokenizer; public class Main { @Supp ......
甲级 1008 Elevator PAT

PAT_A1089 Insert or Merge

According to Wikipedia: Insertion sort iterates, consuming one input element each repetition, and growing a sorted output list. Each iteration, insert ......
Insert PAT_A Merge 1089 PAT

不写代码、构建一个开源的 ChatGPT,总共需要几步?|Hugging News #1020

每一周,我们的同事都会向社区的成员们发布一些关于 Hugging Face 相关的更新,包括我们的产品和平台更新、社区活动、学习资源和内容更新、开源库和模型更新等,我们将其称之为「Hugging News」。本期 Hugging News 有哪些有趣的消息,快来看看吧! 🎉 给 Pro 订阅账户加 ......
ChatGPT Hugging 代码 1020 News

PAT 甲级【1007 Maximum Subsequence Sum】

本题是考察动态规划与java的快速输入: max[i]表示第i个结尾的最大的连续子串和。b begin[i]表示第[begin[i],i]为最大和的开始位置 超时代码: import java.io.BufferedReader; import java.io.IOException; import ......
甲级 Subsequence Maximum 1007 PAT

PAT_A1044 Shopping in Mars

Shopping in Mars is quite a different experience. The Mars people pay by chained diamonds. Each diamond has a value (in Mars dollars M$). When making ......
Shopping PAT_A 1044 Mars PAT

PAT 甲级1005【1005 Spell It Right】

用JAVA可以用BigInteger解决。 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.math.BigInteger; import ......
甲级 1005 Spell Right PAT

PAT 甲级考试【1003 Emergency】

PAT 甲级考试: dfs+dijktasla算法。 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.*; public cla ......
甲级 Emergency 1003 PAT

PAT_A 1010 Radix

Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answer is yes, if 6 is a decimal number and 110 is a ......
PAT_A Radix 1010 PAT

1020打卡

哈夫曼树 #include <iostream> using namespace std; struct node { int lchild; int rchild; int parent; int weight; }; struct hftree { node* data; int length; ......
1020

PAT_A 1085 Perfect Sequence

Given a sequence of positive integers and another positive integer p. The sequence is said to be a perfect sequence if M≤m×p where M and m are the max ......
Sequence Perfect PAT_A 1085 PAT

1020打卡

1. 搜索旋转数组(33) 给你 旋转后 的数组 nums 和一个整数 target ,如果 nums 中存在这个目标值 target ,则返回它的下标,否则返回 -1 。 你必须设计一个时间复杂度为 O(log n) 的算法解决此问题。 (class Solution { public int s ......
1020

华为路由器配置NAT,PAT

NAT概述 NAT(Network Address Translation)又称为网络地址转换,用于实现私有网络和公有网络之间的互访。 私有网络地址和公有网络地址 私有网络地址(以下简称私网地址)是指内部网络或主机的IP地址,公有网络地址(以下简称公网地址)是指在互联网上全球唯一的IP地址。IANA ......
路由 路由器 NAT PAT

风险真题

......
真题 风险

PAT_A 1038 Recover the Smallest Number

Given a collection of number segments, you are supposed to recover the smallest number from them. For example, given { 32, 321, 3214, 0229, 87 }, we c ......
Smallest Recover Number PAT_A 1038

PAT_A1067 Sort with Swap(0, i)

使用p数组存放各元素当前所处位置,e数组在这里无用。在寻找没有归位的元素时,如果每次从头开始寻找会超时。 ......
PAT_A 1067 Sort with Swap

PAT_A1070 Mooncake

Mooncake is a Chinese bakery product traditionally eaten during the Mid-Autumn Festival. Many types of fillings and crusts can be found in traditional ......
Mooncake PAT_A 1070 PAT

1987-2008年考研数二真题全面解析

1987 | 1988 | 1989 | 1990 | 1991 ......
真题 1987 2008
共280篇  :2/10页 首页上一页2下一页尾页