随笔分类 - 有趣的题
摘要:https://www.nowcoder.com/practice/04c8a5ea209d41798d23b59f053fa4d6 题目 题目描述 输入n个整数,依次输出每个数的约数的个数 输入描述: 输入的第一行为N,即数组的个数(N using namespace std; mapsaveRe
阅读全文
摘要:刷题1:成绩排序 来源:https://www.nowcoder.com/practice/0383714a1bb749499050d2e0610418b1 题目: 查找和排序 题目:输入任意(用户,成绩)序列,可以获得成绩从高到低或从低到高的排列,相同成绩 都按先录入排列在前的规则处理。 示例:
阅读全文
摘要:来源:https://leetcode.com/problems/median-of-two-sorted-arrays/ 解答来源: https://www.cnblogs.com/grandyang/p/4465932.html 解答代码: 本题有些硬核了,解答也是看了很长时间才明白。 本题要找
阅读全文
摘要:题目来源:https://leetcode.com/problems/jump-game/ 我的程序(过分复杂了) 讨论里看到一个很好的代码:https://leetcode.com/problems/jump-game/discuss/318606/6line-C%2B%2B-beat-99-O(
阅读全文
摘要:题目内容见:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=757 这里贴出自己加了注释的代码,应该比较好理解了。源代码参考紫书
阅读全文
摘要:题目内容如下: Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example 1: Example 2: 虽然是暴
阅读全文
摘要:题目如下: Given a string, find the length of the longest substring without repeating characters. Example 1: Input: "abcabcbb" Output: 3 Explanation: The a
阅读全文
摘要:Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward. Example 1: Example 2: Example 3:
阅读全文
摘要:最近做了一道题目: Given a 32-bit signed integer, reverse digits of an integer. Example 1: Example 2: Example 3: Note:Assume we are dealing with an environment
阅读全文
摘要:题目如下: Arijit is a brilliant boy. He likes memory games. He likes to participate alone but this time he has to have a partner. So he chooses you. In th
阅读全文