// 面试题29:顺时针打印矩阵 // 题目:输入一个矩阵,按照从外向里以顺时针的顺序依次打印出每一个数字。 #include <cstdio> void PrintMatrixInCircle(int** numbers, int columns, int rows, int start); vo ...
分类:
其他好文 时间:
2020-03-29 12:52:45
阅读次数:
62
[toc] Description A number is called quasibinary if its decimal representation contains only digits 0 or 1. For example, numbers 0, 1, 101, 110011 — a ...
分类:
其他好文 时间:
2020-03-28 20:25:08
阅读次数:
93
SOS问题 模板 cpp //iterative version for(int mask = 0; mask https://codeforces.com/blog/entry/45223 https://blog.csdn.net/weixin_38686780/article/details/ ...
分类:
其他好文 时间:
2020-03-28 01:17:25
阅读次数:
106
The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elev ...
分类:
其他好文 时间:
2020-03-27 12:53:59
阅读次数:
79
地址:https://leetcode-cn.com/problems/guess-numbers/ <?php /** 小A 和 小B 在玩猜数字。小B 每次从 1, 2, 3 中随机选择一个,小A 每次也从 1, 2, 3 中选择一个猜。他们一共进行三次这个游戏,请返回 小A 猜对了几次? 输入 ...
分类:
其他好文 时间:
2020-03-27 12:29:34
阅读次数:
122
给定一棵有根树,每个结点有权值 $a_i$,记 $c_i$ 为 $i$ 的子树中权值 $ using namespace std; define int long long const int N = 2005; vector g[N]; priority_queue hp; int ans[N], ...
分类:
其他好文 时间:
2020-03-23 09:19:09
阅读次数:
64
Given an integer array with all positive numbers and no duplicates, find the number of possible combinations that add up to a positive integer target. ...
分类:
其他好文 时间:
2020-03-22 19:30:38
阅读次数:
66
题目描述 输入n个整数,找出其中最小的K个数。例如输入4,5,1,6,2,7,3,8这8个数字,则最小的4个数字是1,2,3,4,。 这道题目对js来讲应该是很简单了,js有自带的 函数,我们将输入的数组进行排序之后,输出前k个数就是题目要求 的结果。 ...
分类:
其他好文 时间:
2020-03-22 11:12:40
阅读次数:
59
1,在 JavaScript 中 怎么转换列表? 我们使用 map() 函数使 numbers 数组中的元素值翻倍,将 map() 返回的新数组分配给变量 doubled 2,React中,转换数组为元素列表的方式,和上述方法基本相同 import React, { Component } from ...
分类:
其他好文 时间:
2020-03-22 01:06:05
阅读次数:
69
模拟整数乘法,比较简单的乘法模拟,因为一个因数是2,只有一位。注意处理可能产生的进位,测试点2和7测的就是这个。(理解题意很重要,pat可能有的题不难,但是得仔细琢磨坑点在哪里) 用digit1[]记录原数字中各位数字的出现次数,digit2[]存储结果中各位数字出现的次数,逐个比较,如果次数不相等 ...
分类:
其他好文 时间:
2020-03-21 19:41:48
阅读次数:
97