- 博客(35)
- 收藏
- 关注
原创 Docker在Window11系统上拉取镜像的问题
拉取镜像的时候出现下面提示错误Error response from daemon: Get "https://registry-1.docker.io/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
2024-09-19 02:12:13
1338
1
原创 【PAT A1090】Highest Price in Supply Chain(BFS和DFS)
A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer.Starting from one root supplier, everyone on the chain buys products from one's supplier in a price P a
2023-02-08 23:16:44
180
原创 【PAT A1051】Pop Sequence
Given a stack which can keep M numbers at most. Push N numbers in the order of 1, 2, 3, ..., N and pop randomly. You are supposed to tell if a given sequence of numbers is a possible pop sequence of the stack. For example, if M is 5 and N is 7, we can obta
2023-02-03 19:48:36
167
原创 【PAT A1022】Digital Library
A Digital Library contains millions of books, stored according to their titles, authors, key words of their abstracts, publishers, and published years. Each book is assigned an unique 7-digit number as its ID. Given any query from a reader, you are suppose
2023-02-03 11:55:48
185
原创 【PAT A1071】Speech Patterns
People often have a preference among synonyms of the same word. For example, some may prefer "the police", while others may prefer "the cops". Analyzing such patterns can help to narrow down a speaker's identity, which is useful when validating, for exampl
2023-02-02 22:19:19
123
原创 【PAT A1054】The Dominant Color
Behind the scenes in the computer's memory, color is always talked about as a series of 24 bits of information for each pixel. In an image, the color with the largest proportional area is called the dominant color. A strictly dominant color takes more than
2023-02-02 18:31:06
102
原创 【PAT A1100】Mars Numbers
People on Mars count their numbers with base 13:Zero on Earth is called "tret" on Mars.The numbers 1 to 12 on Earth is called "jan, feb, mar, apr, may, jun, jly, aug, sep, oct, nov, dec" on Mars, respectively.For the next higher digit, Mars people name
2023-02-02 12:51:59
174
原创 【PAT A1063】Set Similarity
Given two sets of integers, the similarity of the sets is defined to be N c /N t ×100%, where N c is the number of distinct common numbers shared by the two sets, and N t is the total number of distinct numbers in the two sets. Your job i
2023-02-01 15:45:46
97
原创 【PAT A1047】Student List for Course
Zhejiang University has 40,000 students and provides 2,500 courses. Now given the registered course list of each student, you are supposed to output the student name lists of all the courses.Input Specification:Each input file contains one test case. Fo
2023-02-01 13:57:22
89
原创 【PAT A1039】Course List for Student
Zhejiang University has 40000 students and provides 2500 courses. Now given the student name lists of all the courses, you are supposed to output the registered course list for each student who comes for a query.Input Specification:Each input file conta
2023-02-01 12:07:07
100
原创 【PAT A1060】Are They Equal
If a machine can save only 3 significant digits, the float numbers 12300 and 12358.9 are considered equal since they are both saved as 0.123×$10^5$ with simple chopping. Now given the number of significant digits on a machine and two float numbers, you a
2023-01-30 21:14:18
215
原创 【PAT A1093】Count PAT‘s
The string APPAPT contains two PAT's as substrings. The first one is formed by the 2nd, the 4th, and the 6th characters, and the second one is formed by the 3rd, the 4th, and the 6th characters.Now given any string, you are supposed to tell the number of
2023-01-17 16:44:14
100
原创 【PAT A1025】PAT Ranking
Programming Ability Test (PAT) is organized by the College of Computer Science and Technology of Zhejiang University. Each test is supposed to run simultaneously in several places, and the ranklists will be merged immediately after the test. Now it is your
2023-01-15 16:49:59
109
原创 【PAT A1082】Read Number in Chinese
Given an integer with no more than 9 digits, you are supposed to read it in the traditional Chinese way. Output Fu first if it is negative. For example, -123456789 is read as Fu yi Yi er Qian san Bai si Shi wu Wan liu Qian qi Bai ba Shi jiu. Note: zero (li
2023-01-14 23:08:15
185
1
原创 【PAT A1077】Kuchiguse
The Japanese language is notorious for its sentence ending particles. Personal preference of such particles can be considered as a reflection of the speaker's personality. Such a preference is called "Kuchiguse" and is often exaggerated artistically in Ani
2023-01-14 13:29:41
96
原创 【PAT A1005】Password
To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem is that there are always some confusing passwords since it is hard to distinguish 1 (one) from l (L in lowercase), or 0 (zero) from O (o in uppercase). One
2023-01-14 11:21:47
114
原创 【PAT A1005】Spell It Right
Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English.Input Specification:Each input file contains one test case. Each case occupies one line which contains an N (≤$10^{100}$
2023-01-13 21:12:24
140
原创 [PAT A1058] A+B in Hogwarts
Calculate a+b and output the sum in standard format -- that is, the digits must be separated into groups of three by commas (unless there are less than four digits).Input Specification:Each input file contains one test case. Each case contains a pair of
2023-01-13 19:57:46
175
原创 [PAT A1073] Scientific Notation
题目Scientific notation is the way that scientists easily handle very large numbers or very small numbers. The notation matches the regular expression [+-][1-9].[0-9]+E[+-][0-9]+ which means that the integer portion has exactly one digit, there is at least
2023-01-13 14:54:38
97
原创 [PAT A1061] Dating
题目Sherlock Holmes received a note with some strange strings: Let's date! 3485djDkxh4hhGE 2984akDfkkkkggEdsb s&hgsfdk d&Hyscvnm. It took him only a minute to figure out that those strange strings are actually referring to the coded time Thursday 14:04 -- s
2023-01-12 22:29:32
152
原创 [PAT A1058] A+B in Hogwarts
题目If you are a fan of Harry Potter, you would know the world of magic has its own currency system -- as Hagrid explained it to Harry, "Seventeen silver Sickles to a Galleon and twenty-nine Knuts to a Sickle, it's easy enough." Your job is to write a progr
2023-01-12 20:15:51
160
原创 [PAT A1027] Colors in Mars
题目People in Mars represent the colors in their computers in a similar way as the Earth people. That is, a color is represented by a 6-digit number, where the first 2 digits are for Red, the middle 2 digits for Green, and the last 2 digits for Blue. The on
2023-01-11 22:33:18
65
原创 [PAT A1019] General Palindromic Number
先将n转换为b进制数,并将每一位用数组std存储,然后将遍历数组前一半并将其于对称位置的数比较,若均相同则为回文数,最后倒序输出数组std存储的数字。给出两个整数n、b,问十进制整数n在b进制下是否是回文数,若是,输出Yes,若不是,输出No,并输出n在b进制下的表示。
2023-01-11 19:04:16
81
原创 [PAT A1031] Hello World for U
Given any string of N (≥5) characters, you are asked to form the characters into the shape of U. For example, helloworld can be printed as:h de ll rlowoThat is, the characters must be printed in the original order, starting top-down from the le
2023-01-10 22:47:25
99
原创 [PAT A1036]Boys vs Girls
题目This time you are asked to tell the difference between the lowest grade of all the male students and the highest grade of all the female students.Input Specification:Each input file contains one test case. Each case contains a positive integer N, fol
2023-01-09 22:48:32
91
原创 [PAT A1046]Shortest Distance
题目The task is really simple: given N exits on a highway which forms a simple cycle, you are supposed to tell the shortest distance between any pair of exits.Input Specification:Each input file contains one test case. For each case, the first line contai
2022-02-05 13:32:18
716
原创 [PAT A1042]Shuffling Machine
题目Shuffling is a procedure used to randomize a deck of playing cards. Because standard shuffling techniques are seen as weak, and in order to avoid “inside jobs” where employees collaborate with gamblers by performing inadequate shuffles, many casinos emp
2022-02-04 19:01:19
353
原创 力扣每日一题|简单题NO.80 合并两个有效数组(JAVA)
题目描述解题思路通过双指针i和j,分别指向处理好的数组末位和已经遍历过的数组的末位。当且仅当nums[i-2] = nums[j]时,nums[j]要被去除。解题代码int i=2,j=2,times = 0,len = nums.length; if(len <= 2) { return len; } while (j < nums.length) { if (nums[
2021-04-06 23:36:33
150
原创 力扣每日一题|简单题NO.88 合并两个有效数组(JAVA)
题目描述解题思路很基础的题目,可以直接将 nums2 中元素添加到 nums1 中,然后调用 sort 进行排序解题代码int j = 0;for (int i=m;i<nums1.length;i++) { nums1[i] = nums2[j++]; }Arrays.sort(nums1);
2021-04-06 00:41:51
149
原创 力扣每日一题|简单题NO.566 重塑矩阵(JAVA)
题目描述解答代码如下:class Solution { public int[][] matrixReshape(int[][] nums, int r, int c) { if (r*c==nums.length*nums[0].length) { int[][] ans = new int[r][c]; int n = nums[0].length; for(int i = 0;i<r*c;i+
2021-02-17 23:19:21
138
原创 力扣每日一题|简单题NO.485 最大连续个数的1(JAVA)
题目描述:解答代码如下:class Solution { public int findMaxConsecutiveOnes(int[] nums) { int max = 0,cot = 0;; for(int num:nums){ if(num == 1){ cot++; } if(num == 0) { max=(cot>max?
2021-02-15 19:37:11
134
原创 力扣每日一题|困难题NO.765 情侣牵手(JAVA)
题目描述解答代码如下:class Solution { public int minSwapsCouples(int[] row) { int cot = 0,p1,p2; int n = row.length; //用一个新数组记录每个人的位置 int[] index = new int[n]; for(int i=0;i<n;i++) { index[row[i]]
2021-02-14 12:37:13
286
原创 力扣每日一题|简单题NO.448(JAVA)
题目描述:解答代码如下:class Solution { public List<Integer> findDisappearedNumbers(int[] nums) { List<Integer> ans =new LinkedList<Integer>(); for(int i=0;i<nums.length;i++) { if(nums[i]>0)
2021-02-13 19:55:09
123
原创 CSP 202009-2|风险人群筛查 (JAVA)
CSP 202009-2|风险人群筛查题目分析代码题目分析本来是想用两个二维数组的,但是我发现每一行输入的数据只需要使用一次就行了,可以不使用数组存储,所以就仅仅使用了两个临时变量,这题想明白了还是挺简单的。代码import java.util.Scanner;public class Main { public static void main(String[] args) { Scanner s = new Scanner(System.in); .
2020-12-12 23:18:02
593
原创 CSP202009-1|称检测点查询(JAVA)
CSP202009-1|称检测点查询题目分析csp基本上每次第一题都是有手就行吧代码import java.util.Scanner;public class Main { public static void main(String[] args) { Scanner s = new Scanner(System.in); int n=s.nextInt(); int a=s.nextInt(); int b=s.nextI
2020-12-12 21:52:03
684
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅