题目链接:https://codeforces.com/contest/1265/problem/B 题意 给出大小为 $n$ 的一个排列,问对于每个 $i(1 \le i \le n)$,原排列中是否有一个大小为 $i$ 的连续子排列。 题解 从小到大构造排列,记录当前排列中数的最小下标和最大下标 ...
分类:
其他好文 时间:
2020-06-25 19:16:52
阅读次数:
58
description Given a positive integer N, return the number of positive integers less than or equal to N that have at least 1 repeated digit. Example In ...
分类:
其他好文 时间:
2020-06-25 14:09:06
阅读次数:
65
Next Permutation (M) 题目 Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such a ...
分类:
其他好文 时间:
2020-06-25 09:57:33
阅读次数:
51
You are given two arrays (without duplicates) nums1 and nums2 where nums1’s elements are subset of nums2. Find all the next greater numbers for nums1' ...
分类:
其他好文 时间:
2020-06-24 23:43:31
阅读次数:
50
安装 pip3 install setuptools pip3 install pykafka pip3 install kafka-python 单台kafka import sys from kafka import KafkaConsumer from kafka.structs import ...
分类:
编程语言 时间:
2020-06-24 21:46:18
阅读次数:
80
1095 Cars on Campus (30分) Zhejiang University has 8 campuses and a lot of gates. From each gate we can collect the in/out times and the plate numbers ...
分类:
编程语言 时间:
2020-06-24 00:20:12
阅读次数:
73
一、技术总结 这一题主要学习到两个知识点,一个是stoi函数的使用,之前已经讲过了,可以将一个字符串转化为10进制的数字; 还有就是字符串string中insert函数的使用,可以str.insert(0, num, '0');意思是在下标为0处插入num个字符‘0’; 还有就是使用dowhile; ...
分类:
其他好文 时间:
2020-06-23 21:22:54
阅读次数:
42
Being a nonconformist, Volodya is displeased with the current state of things, particularly with the order of natural numbers (natural number is posit ...
分类:
其他好文 时间:
2020-06-23 21:22:33
阅读次数:
63
import random def getBaseBigHapppyNumbers(): frontNumbers = set(); backNumbers = set(); while(len(frontNumbers)<5): cur = random.randint(1, 35) frontN ...
分类:
其他好文 时间:
2020-06-22 13:24:29
阅读次数:
60
一、Algorithm 【leetcode】009-Palindrome Number 二、Review Linux is ready for the end of time The Y2K bug is back, causing headaches for developers again 三、 ...
分类:
其他好文 时间:
2020-06-21 17:52:07
阅读次数:
49