1095 解码PAT准考证 (25分) 1095 解码PAT准考证 (25分)PAT 准考证号由 4 部分组成:第 1 位是级别,即 T 代表顶级;A 代表甲级;B 代表乙级;第 2~4 位是考场编号,范围从 101 到 999;第 5~10 位是考试日期,格式为年、月、日顺次各占 2 位;最后 11~13 位是考生编号,范围从 000 到 999。现给定一系列考生的准考证号和他们的成绩,请你按照要求输出各种统计信息。...
1093 字符串A+B (20分) 1093 字符串A+B (20分)给定两个字符串 A 和 B,本题要求你输出 A+B,即两个字符串的并集。要求先输出 A,再输出 B,但重复的字符必须被剔除。输入格式:输入在两行中分别给出 A 和 B,均为长度不超过 10610^6106 的、由可见 ASCII 字符 (即码值为32~126)和空格组成的、由回车标识结束的非空字符串。输出格式:在一行中输出题面要求的 A 和 B 的...
1092 最好吃的月饼 (20分) 1092 最好吃的月饼 (20分)月饼是久负盛名的中国传统糕点之一,自唐朝以来,已经发展出几百品种。若想评比出一种“最好吃”的月饼,那势必在吃货界引发一场腥风血雨…… 在这里我们用数字说话,给出全国各地各种月饼的销量,要求你从中找出销量冠军,认定为最好吃的月饼。输入格式:输入首先给出两个正整数 N(≤1000)和 M(≤100),分别为月饼的种类数(于是默认月饼种类从 1 到 N 编号)...
1091 N-自守数 (15分) 1091 N-自守数 (15分)如果某个数 K 的平方乘以 N 以后,结果的末尾几位数等于 K,那么就称这个数为“N-自守数”。例如 3×922=2539292^2=25392922=25392,而 25392 的末尾两位正好是 92,所以 92 是一个 3-自守数。本题就请你编写程序判断一个给定的数字是否关于某个 N 是 N-自守数。输入格式:输入在第一行中给出正整数 M(≤20),随后...
1094 谷歌的招聘 (20分) 1094 谷歌的招聘 (20分)2004 年 7 月,谷歌在硅谷的 101 号公路边竖立了一块巨大的广告牌(如下图)用于招聘。内容超级简单,就是一个以 .com 结尾的网址,而前面的网址是一个 10 位素数,这个素数是自然常数 e 中最早出现的 10 位连续数字。能找出这个素数的人,就可以通过访问谷歌的这个网站进入招聘流程的下一步。自然常数 e 是一个著名的超越数,前面若干位写出来是这样的:...
wordcloud词云 一:Abstract使用Python制作词云,需要wordcloud,PIL,numpy,matplotlib库。如果要制作中文词云,还需要jieba库。本篇blog介绍wordcloud库和英文词云,中文词云的制作。代码在github上二: WordCloudwordcloud库把词云当作一个WordCloud对象,制作词云并保存都需要WordCloud对象。我个人觉得需要设置的属性为:f...
python中self Abstract学习Python中,对self有些疑惑,就查了些资料,列出我看到资料进行整理。selfpython 里所有的 object 都有三个属性, 标识(identity), 类型(type) 和值(value). 其中 identity 可以用 id 函数获得, CPython 里的实现是 object 的内存地址. 值就是 object 具体存放的数据, 而 type, obj...
Python中 is和 == 的区别 Abstract突然想到这个问题,就搜了搜,列出我看到的资料并进行整合is ==is 是引用相等(reference equality),用C语言来说,就是地址是否相同== 是值相等(value equality)is 表示的是对象标示符(object identity),我们在检查 a is b 的时候,其实相当于检查 id(a) == id(b)。而检查 a == b 的时候,实际...
井字棋 基于minimax算法的人工智能 in C++ import osdef print_board(board): print(board['TL'] + '|' + board['TM'] + '|' + board['TR']) print('-+-+-') print(board['ML'] + '|' + board['MM'] + '|' + board['MR']) print('-+-+-')...
unsigned int无符号和int有符号的加法,乘法和取反 无符号和有符号在C语言里,整数的表示有有符号和无符号两种无符号有符号32位64位unsigned charchar11unsigned shortshort22unsigned intint44unsigned longlong48unsigned long longlong long88无符号是用原码表示,...
C 指针和数组的区别 Abstract本人正在学习Stanford CS107,课程中让人不停的看汇编,写汇编,让我对数组和指针有个很深的认识。区别int *a 是一个指针,他是一个变量,可以取地址。int a[2]中的a是一个值,代表数组的地址。不能取地址。汇编在汇编里:这两个是这样的:数组:指针:指针和数组 with 函数Addition#include <stdio.h&g...
Stanford CS107 Assignment 5: Raw Memory Abstract本人正在学习Stanford CS107。这门课很不错,我简单把这门课的信息说一下。keyvalue官网https://see.stanford.edu/Course/CS107课程名编程范式所需基础C,C++,数据结构与算法上课视频Bilibili搜索 https://www.bilibili.com/video/av97892...
Stanford CS107 Assignment 3: vector and hashset Abstract本人正在学习Stanford CS107。这门课很不错,我简单把这门课的信息说一下。keyvalue官网https://see.stanford.edu/Course/CS107课程名编程范式所需基础C,C++,数据结构与算法上课视频Bilibili搜索 https://www.bilibili.com/video/av978920...
Stanford CS107 Assignment 2: Six Degrees of Kevin Bacon Abstract本人正在学习Stanford CS107。这门课很不错,我简单把这门课的信息说一下。keyvalue官网https://see.stanford.edu/Course/CS107课程名编程范式所需基础C,C++上课视频Bilibili搜索 https://www.bilibili.com/video/av9789206(可能会失效...
Stanford CS107 Assignment 1: Random Sentence Generator(RSG) Abstract本人正在学习Stanford CS107。这门课很不错,我简单把这门课的信息说一下。keyvalue官网https://see.stanford.edu/Course/CS107课程名编程范式所需基础C,C++上课视频Bilibili搜索 https://www.bilibili.com/video/av9789206(可能会失效...
Lowest Common Ancestor in a Binary Search Tree 求BST两个结点的LCA因为是BST:所以可以使用BST的性质去找LCA。①左儿子的值小于父亲的值②右儿子的值大于父亲的值。所以对于结点1 Node1,结点2 Node2 的LCA:其LCA结点的值一定大于于Node1的值,小于Node2的值。所以寻找LCA就变得很容易。从root根结点开始遍历:遍历过程中:第一个结点的值大于Node1的值,小于Node2的值:就是Node1,Node2...
怎么判断两个链表是否有merge?如果有:在哪? Abstact刷OJ时,遇到一个题:判断两个链表是否有merge?如果有?在哪?如下图:merge point在值为3的地方。在StackOverflow上一个回答特别棒:check if two linked lists merge现在记录下来。Algorithm算法很简单:同时遍历两个链表。设右边为current1(对应第一条链表),current2(对应第二条链表)。当curre...
PAT 1087 All Roads Lead to Rome (30 分) 1087 All Roads Lead to Rome (30 分)Indeed there are many different tourist routes from our city to Rome. You are supposed to find your clients the route with the least cost while gaining the most happ...
PAT1072 Gas Station (30 分) 解析#include<iostream>#include<string>#include<vector>#include<algorithm>#include<unordered_map>using namespace std;const int INF = 0x3ffff
PAT 1018 Public Bike Management (30 分) 1018 Public Bike Management (30 分)There is a public bike service in Hangzhou City which provides great convenience to the tourists from all over the world. One may rent a bike at any station and retu...
PAT 1030 Travel Plan (30 分) 1030 Travel Plan (30 分)A traveler’s map gives the distances between cities along the highways, together with the cost of each highway. Now you are supposed to write a program to help a traveler to de...
PAT1003 Emergency (25 分) 解析#include<cstdio>#include<vector>#include<algorithm>using namespace std;const int maxn = 1000;const int INF = 0x3fffffff;struct Node{ int v, w; Node(int _v, int _w) :v(_...
PAT1048 Find Coins (25 分) 解析#include<iostream>#include<string>#include<vector>#include<algorithm>#include<unordered_set>usin
PAT1048 Find Coins (25 分) 解析#include<iostream>#include<string>#include<vector>#include<algorithm>#include<unordered_set>usin
PAT1050 String Subtraction (20 分) 解析是集合A中的元素去掉集合B的元素。#include<iostream>#include<cstdio>#include<string>#include<vector>#include<algorithm>#include<set>using namespace std;int main(){ str...
PAT1041 Be Unique (20 分) 1041 Be Unique (20 分)Being unique is so important to people on Mars that even their lottery is designed in a unique way. The rule of winning is simple: one bets on a number chosen from [1,10410^4104]...
PAT1092 To Buy or Not to Buy (20 分) 1092 To Buy or Not to Buy (20 分)Eva would like to make a string of beads with her favorite colors so she went to a small shop to buy some beads. There were many colorful strings of beads. However the...
PAT1084 Broken Keyboard (20 分) 1084 Broken Keyboard (20 分)On a broken keyboard, some of the keys are worn out. So when you type some sentences, the characters corresponding to those keys will not appear on screen.Now given a stri...
PAT1084 Broken Keyboard (20 分) 1084 Broken Keyboard (20 分)On a broken keyboard, some of the keys are worn out. So when you type some sentences, the characters corresponding to those keys will not appear on screen.Now given a stri...
PAT 1146 Topological Order (25 分) 1146 Topological Order (25 分)This is a problem given in the Graduate Entrance Exam in 2018: Which of the following is NOT a topological order obtained from the given directed graph? Now you are suppo...
PAT test1 :1108,1109,1110,1111 模考马上要考PAT甲级了。所以后面的题目就当模考了。第一次模考成绩成绩用时792小时55分钟最后一道图题好复杂,而且我没学好图。所以最后一道题只拿了第一个测试点的9分。解析1108 Finding Average这是乙级的一道题。当时做的时候强行把实现了stod。当时记得花了很长时间。现在是模考,时间要紧,所以STL有stod,就用了STL的。其实只是判...
PAT 1062 Talent and Virtue (25 分) 1062 Talent and Virtue (25 分)About 900 years ago, a Chinese philosopher Sima Guang wrote a history book in which he talked about people’s talent and virtue. According to his theory, a man being outst...
PAT 1107 Social Clusters (30 分) 解析#include<cstdio>#include<vector>#include<algorithm>using namespace std;const int maxn = 1010;int hobby[maxn]{0};bool isroot[maxn]{ false };int findFather(int x) { if (x =...
PAT 1076 Forwards on Weibo (30 分) 1076 Forwards on Weibo (30 分)Weibo is known as the Chinese version of Twitter. One user on Weibo may have many followers, and may follow many other users as well. Hence a social network is formed wit...
LeetCode 26. Remove Duplicates from Sorted Array 26. Remove Duplicates from Sorted Arrayclass Solution {public: int removeDuplicates(vector&lt;int&gt;&amp; nums) { if(nums.size()==0) return 0; int unique = 1; ...
PAT 1034 Head of a Gang (30 分) 1034 Head of a Gang (30 分)One way that the police finds the head of a gang is to check people’s phone calls. If there is a phone call between A and B, we say that A and B is related. The weight of a ...
LeetCode 917. Reverse Only Letterse 917. Reverse Only Letters/*using C++ STL*/class Solution {public: string reverseOnlyLetters(string S) { string Q; for(auto ch:S){ if(isalpha(ch)) Q...
LeetCode 917. Reverse Only Letterse 917. Reverse Only Letters/*using C++ STL*/class Solution {public: string reverseOnlyLetters(string S) { string Q; for(auto ch:S){ if(isalpha(ch)) Q...
Pillow学习笔记 Tutorial本文笔记来自于Pillow官网文档。仅供本人学习。Using the Image classReading and writing imagesCutting Pasting and merging imagesGeometrical transformsColor transformsImage enhancementImage sequencesPostsc...
PAT 1021 Deepest Root (25 分) 1021 Deepest Root (25 分)A graph which is connected and acyclic can be considered a tree. The hight of the tree depends on the selected root. Now you are supposed to find the root that results in a hi...
PAT 1013 Battle Over Cities (25 分) 1013 Battle Over Cities (25 分)It is vitally important to have all the cities connected by highways in a war. If a city is occupied by the enemy, all the highways from/toward that city are closed. We ...
PAT 1024 Palindromic Number (25 分) 1024 Palindromic Number (25 分)A number that will be the same when it is written forwards or backwards is known as a Palindromic Number. For example, 1234321 is a palindromic number. All single digit ...
PAT 1023 Have Fun with Numbers (20 分) 1023 Have Fun with Numbers (20 分)Notice that the number 123456789 is a 9-digit number consisting exactly the numbers from 1 to 9, with no duplication. Double it we will obtain 246913578, which happen...
算法笔记 --第十章 提高篇(4) --图算法专题 读书笔记图的定义图由顶点Vertex和边Edge组成,每条边的两端都必须是图的两个顶点。而记号G(V,E)表示图G的顶点集合为V,边集为E。一般来说:图可以分为有向图和无向图。有向图是所有边都有方向,无向图是所有边都是双向的。顶点的度是指和该顶点相连的边的条数。对于有向图来说:顶点的出边条数称为该顶点的出度,顶点的入边条数称为该顶点的入度。顶点和边都可以有权重。顶点的权值称为点权,边的权...
PAT 1059 Prime Factors (25 分) 解析#include<cstdio>#include<cmath>#include<vector>using namespace std;vector<bool> prime;vector<int> PNum;struct factor { int x, cnt;}fac[10];void makePrime(in...
LeetCode 258. Add Digits 258. Add Digits/*using recursion*/class Solution {public: int addDigits(int num) { if(num&lt;10) return num; else{ int result = 0; while(nu...
LeetCode 202. Happy Number 202. Happy Numberclass Solution {public: bool isHappy(int n) { unordered_map&lt;int,bool&gt; show; while(true){ int result = 0; while(n){ ...
PAT 1096 Consecutive Factors (20 分) 测试点 1096 Consecutive Factors (20 分)Among all the factors of a positive integer N, there may exist several consecutive numbers. For example, 630 can be factored as 3×5×6×7, where 5, 6, and 7 are the three...
PAT 1078 Hashing (25 分) 1078 Hashing (25 分)The task of this problem is simple: insert a sequence of distinct positive integers into a hash table, and output the positions of the input numbers. The hash function is defined t...
PAT 1081 Rational Sum (20 分) 1081 Rational Sum (20 分)Given N rational numbers in the form numerator/denominator, you are supposed to calculate their sum.Input Specification:Each input file contains one test case. Each case st...
坑:abs absA1088遇到了一个坑。我使用绝对值函数:abs完成对Long long的取绝对值。查看了cplusplus上abs的介绍发现可以使用。就开开心心的用。但是却不能AC。QAQ解决经过很长时间的查询资料和检查错误:我发现错误在abs上。abs在C上是没有重载的,只有在C++上才有。所以#include&lt;cstdlib&gt;int main(){ long long ...
PAT 1088 Rational Arithmetic (20 分) 1088 Rational Arithmetic (20 分)For two rational numbers, your task is to implement the basic arithmetics, that is, to calculate their sum, difference, product and quotient.Input Specification:Each...
LeetCode 191. Number of 1 Bits 191. Number of 1 Bitsclass Solution {public: int hammingWeight(uint32_t n) { const int array[]={0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4}; int count=0; uint32_t m = n&gt;&gt;16; ...
PAT 1049 Counting Ones (30 分) 1049 Counting Ones (30 分)The task is simple: given any positive integer N, you are supposed to count the total number of 1’s in the decimal form of the integers from 1 to N. For example, given N bein...
PAT 1104 Sum of Number Segments (20 分) 1104 Sum of Number Segments (20 分)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 have 10 segmen...
PAT 1069 The Black Hole of Numbers (20 分) 1069 The Black Hole of Numbers (20 分)For any 4-digit integer except the ones with all the digits being the same, if we sort the digits in non-increasing order first, and then in non-decreasing order,...
LeetCode 144. Binary Tree Preorder Traversal 144. Binary Tree Preorder Traversal/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(...
LeetCode 144. Binary Tree Preorder Traversal 144. Binary Tree Preorder Traversal/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(...
PAT 1064 Complete Binary Search Tree (30 分) 1064 Complete Binary Search Tree (30 分)A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties:The left subtree of a node contains only nodes with keys ...
PAT 1099 Build A Binary Search Tree (30 分) 1099 Build A Binary Search Tree (30 分)A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties:The left subtree of a node contains only nodes with keys l...
LeetCode 257. Binary Tree Paths 257. Binary Tree Paths/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(...
PAT 1043 Is It a Binary Search Tree (25 分) 1043 Is It a Binary Search Tree (25 分)A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties:The left subtree of a node contains only nodes with keys l...
PAT 1053 Path of Equal Weight (30 分) 1053 Path of Equal Weight (30 分)Given a non-empty tree with root R, and with weight WiW_iWi assigned to each tree node TiT_iTi. The weight of a path from R to L is defined to be the sum of the weig...
PAT 1004 Counting Leaves (30 分) 1004 Counting Leaves (30 分)A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child.Input Specification:Each input file contains one ...
PAT 1106 Lowest Price in Supply Chain (25 分) 1106 Lowest Price in Supply Chain (25 分)A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer.Startin...
PAT 1094 The Largest Generation (25 分) 1094 The Largest Generation (25 分)A family hierarchy is usually presented by a pedigree tree where all the nodes on the same level belong to the same generation. Your task is to find the generation w...
PAT 1090 Highest Price in Supply Chain (25 分) 1090 Highest Price in Supply Chain (25 分)A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer.Starti...
PAT 1079 Total Sales of Supply Chain (25 分) 1079 Total Sales of Supply Chain (25 分)A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer.Starting...
二叉树的遍历-非递归 Pseudo Code:Create a Stack.Push the root into the stack and set the root = root.left continue till it hits the NULL.If root is null and Stack is empty Thenreturn, we are done.ElsePop the top Nod...
二叉树的遍历-非递归 Pseudo Code:Create a Stack.Push the root into the stack and set the root = root.left continue till it hits the NULL.If root is null and Stack is empty Thenreturn, we are done.ElsePop the top Nod...
PAT 1102 Invert a Binary Tree (25 分) 1102 Invert a Binary Tree (25 分)The following is from Max Howell @twitter:Google: 90% of our engineers use the software you wrote (Homebrew), but you can’t invert a binary tree on a whiteboard so fu...
PAT 1086 Tree Traversals Again (25 分) 1086 Tree Traversals Again (25 分)An inorder binary tree traversal can be implemented in a non-recursive way with a stack. For example, suppose that when a 6-node binary tree (with the keys numbered f...
PAT 1020 Tree Traversals (25 分) 1020 Tree Traversals (25 分)Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, you are supposed to output the level order t...
Effective C++ Note1 导读声明式(declaration):是告诉编译器某个东西的名称和类型(type),但忽略细节函数的声明揭示其签名式(signature),也就是参数和返回类型。一个函数的签名等同于该函数的类型。通常我都会忘记怎么写函数指针,有了签名式这个概念:我明白了函数指针为什么这样写。定义式(definition):对于对象而言:定义式是编译器为此对象拨发内存的地方。对function或funct...
PAT 1052 Linked List Sorting (25 分) 1052 Linked List Sorting (25 分)A linked list consists of a series of structures, which are not necessarily adjacent in memory. We assume that each structure contains an integer key and a Next pointer...
PAT 1097 Deduplication on a Linked List (25 分) 1097 Deduplication on a Linked List (25 分)Given a singly linked list L with integer keys, you are supposed to remove the nodes with duplicated absolute values of the keys. That is, for each value K, ...
PAT 1032 Sharing (25 分) 1032 Sharing (25 分)To store English words, one method is to use linked lists and store a word letter by letter. To save some space, we may let the words share the same sublist if they share the same ...
PAT 1074 Reversing Linked List (25 分) 1074 Reversing Linked List (25 分)Given a constant K and a singly linked list L, you are supposed to reverse the links of every K elements on L. For example, given L being 1→2→3→4→5→6, if K=3, then yo...
LeetCode 231. Power of Two 231. Power of Twoclass Solution {public: bool isPowerOfTwo(int n) { if(n==0) return false; else if(n == 1) return true; else return is...
LeetCode 8 String to Integer(atoi) 8 String to Integer(atoi)class Solution {public: int myAtoi(string str) { int i=0,len = str.size(); long long result=0; while(i&amp;amp;lt;len &amp;amp;amp;&amp;amp;amp; str[i]==' ') ...
LeeetCode 7 . Reverse Integer 7. Reverse Integerclass Solution {public: int reverse(int x) { bool flag = x>=0; x = flag?x:-x; long long reverse_x = 0; do{ reverse_x = reverse_x*...
PAT 1051 Pop Sequence (25 分) 1051 Pop Sequence (25 分)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 pos...
LeetCode 58. Length of Last Word 58. Length of Last Wordclass Solution {public: int lengthOfLastWord(string s) { int len = 0; auto it = s.rbegin(); while (it != s.rend()) { if (*it == ' ') it++; ...
PAT 1022 Digital Library (30 分) 1022 Digital Library (30 分)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 assigne...
PAT 1071 Speech Patterns (25 分) 1071 Speech Patterns (25 分)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 h...
PAT 1054 The Dominant Color (20 分) 1054 The Dominant Color (20 分)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 pr...
PAT 1054 The Dominant Color (20 分) 1054 The Dominant Color (20 分)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 pr...
PAT 1100 Mars Numbers (20 分) 1100 Mars Numbers (20 分)People on Mars count their numbers with base 13:Zero on Earth is called “tret” on Mars.The numbers 1 to 12 on Earch is called “jan, feb, mar, apr, may, jun, jly, aug, sep, o...
PAT 1063 Set Similarity (25 分) 1063 Set Similarity (25 分)Given two sets of integers, the similarity of the sets is defined to be NcN_cNc/NtN_tNt×100%, where NcN_cNc is the number of distinct common numbers shared by the two set...
LeetCode 387. First Unique Character in a String 387. First Unique Character in a Stringclass Solution {public: int firstUniqChar(string s) { int alp[26],len = s.size(); fill(begin(alp),end(alp),-1); for(int i=0;i&lt;le...
PAT 1047 Student List for Course (25 分) 1047 Student List for Course (25 分)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 nam...
在PAT里使用map还是unordered_map? 时间复杂度O(?)mapunordered_mapOrderingincreasing orderno orderingImplementationSelf balancing BST(Red-Black Tree)Hash Tablesearch timelog(n)O(1) -> Average ,O(n) -> Worst Cas...
LeetCode 13. Roman to Integer 13. Roman to Integerclass Solution {public: int romanToInt(string s) { const map&lt;char,int&gt; roman{{'I',1},{'V',5},{'X',10},{'L',50},{'C',100},{'D',500},{'M',1000}}; int sum=...
PAT 1060 Are They Equal (25 分) 1060 Are They Equal (25 分)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×1050.123×10^50.123×105 with ...
LeetCode 242. Valid Anagram 242. Valid Anagramclass Solution {public: bool isAnagram(string s, string t) { int alp1[26]{0},alp2[26]{0}; for(auto ch:s) alp1[ch-'a']++; for(auto ch:t) ...
LeetCode 242. Valid Anagram 242. Valid Anagramclass Solution {public: bool isAnagram(string s, string t) { int alp1[26]{0},alp2[26]{0}; for(auto ch:s) alp1[ch-'a']++; for(auto ch:t) ...