https://www.luogu.com.cn/problem/P3366 1 #define IO std::ios::sync_with_stdio(0) 2 #include <bits/stdc++.h> 3 #define pb push_back 4 using namespace s ...
分类:
其他好文 时间:
2020-11-26 15:24:23
阅读次数:
48
problem: 给你n个数字,和m个查询. 将[l,r]之间数第一次出现的位置信息弄成一个新的数组,然后找出其中k/2大的数.(k为位置的数量) #include<bits/stdc++.h> using namespace std; const int maxn=2e5+100; const i ...
分类:
其他好文 时间:
2020-11-26 14:12:20
阅读次数:
3
Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: Integers in each row are sorted i ...
分类:
其他好文 时间:
2020-11-25 12:59:50
阅读次数:
14
#include<bits/stdc++.h> #define ll long long #define N 100015 #define rep(i,a,n) for (int i=a;i<=n;i++) #define per(i,a,n) for (int i=n;i>=a;i--) #def ...
分类:
其他好文 时间:
2020-11-25 12:45:31
阅读次数:
4
https://codeforces.ml/contest/888/problem/G struct TrieNode { int cnt; int num; int nxt[2]; void Init() { cnt = 0; num = 0; memset(nxt, 0, sizeof(nxt) ...
分类:
其他好文 时间:
2020-11-24 12:58:41
阅读次数:
10
LeetCode82 删除排序链表中的重复元素II 题目描述 给定一个排序链表,删除所有含有重复数字的节点,只保留原始链表中 没有重复出现 的数字。 样例 输入: 1->2->3->3->4->4->5 输出: 1->2->5 输入: 1->1->1->2->3 输出: 2->3 算法分析 时间复杂 ...
分类:
编程语言 时间:
2020-11-24 12:38:37
阅读次数:
6
HDU2040 亲和数 题目链接 Problem Description 古希腊数学家毕达哥拉斯在自然数研究中发现,220的所有真约数(即不是自身的约数)之和为: 1+2+4+5+10+11+20+22+44+55+110=284。 而284的所有真约数为1、2、4、71、 142,加起来恰好为22 ...
分类:
其他好文 时间:
2020-11-24 12:32:09
阅读次数:
8
给定一个只包括 '(',')','{','}','[',']' 的字符串,判断字符串是否有效。 有效字符串需满足: 左括号必须用相同类型的右括号闭合。 左括号必须以正确的顺序闭合。 注意空字符串可被认为是有效字符串。 示例 1: 输入: "()" 输出: true 示例 2: 输入: "()[]{} ...
分类:
其他好文 时间:
2020-11-24 12:14:38
阅读次数:
7
LeetCode81 搜索旋转排序数组II 题目描述 假设按照升序排序的数组在预先未知的某个点上进行了旋转。 ( 例如,数组 [0,0,1,2,2,5,6] 可能变为 [2,5,6,0,0,1,2] )。 编写一个函数来判断给定的目标值是否存在于数组中。若存在返回 true,否则返回 false。 ...
分类:
编程语言 时间:
2020-11-24 12:11:34
阅读次数:
7
HDU2030 汉字统计 题目链接 Problem Description 统计给定文本文件中汉字的个数。 Input 输入文件首先包含一个整数n,表示测试实例的个数,然后是n段文本。 Output 对于每一段文本,输出其中的汉字的个数,每个测试实例的输出占一行。 [Hint:]从汉字机内码的特点考 ...
分类:
其他好文 时间:
2020-11-24 12:06:56
阅读次数:
7