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
WHERE子句之In、Like语句 本篇将介绍WHERE子句里面的两个语法:In语法和Like语法 where子句之In语法 where子句之like语法 where子句之in语法: where子句之in语法的作用:允许在where子句中规定过个值 语法: select column_name fr ...
分类:
其他好文 时间:
2020-11-26 14:19:56
阅读次数:
2
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
#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
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
HDU2030 汉字统计 题目链接 Problem Description 统计给定文本文件中汉字的个数。 Input 输入文件首先包含一个整数n,表示测试实例的个数,然后是n段文本。 Output 对于每一段文本,输出其中的汉字的个数,每个测试实例的输出占一行。 [Hint:]从汉字机内码的特点考 ...
分类:
其他好文 时间:
2020-11-24 12:06:56
阅读次数:
7
CodeForces - Problem 1446 - Knapsack - 思维 对于所有物品按照重量从小到大排序,然后从后向前遍历: 对于重量已经超过了$\omega$的物品,将其忽略掉; 对于重量处于$[\lceil \frac{\omega}{2} \rceil,\omega]$的物品(如果 ...
分类:
其他好文 时间:
2020-11-21 12:04:37
阅读次数:
5
Link: https://www.luogu.com.cn/problem/P1903 Solution 这个 sort 我暂且蒙在鼓里 先贴个代码。 本来我 T 了三个点的 cmp 函数如下 bool cmp(const s_q &a, const s_q &b) { if (belong[a. ...
分类:
其他好文 时间:
2020-11-21 11:54:33
阅读次数:
4